Gilbreath's Conjecture

Author

Eric W. Weisstein
August 16, 2002

This notebook downloaded from http://mathworld.wolfram.com/notebooks/PrimeNumbers/GilbreathsConjecture.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/GilbreathsConjecture.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Check

d[n_,1]:=d[n,1]=Prime[n+1]-Prime[n]
d[n_,k_]:=d[n,k]=Abs[d[n+1,k-1]-d[n,k-1]]

Block[{$RecursionLimit=1000},
Table[d[1,k],{k,200}]
]//Timing

Difference Table

With[{its=10},
NestList[Abs[Subtract@@@Partition[#,2,1]]&,Table[Prime[n],{n,its}],its-1]
]//TableForm

With[{its=20},
NestList[Abs[Subtract@@@Partition[#,2,1]]&,Table[Prime[n],{n,its}],its-1]
]//TableForm

A036262

l=With[{its=2000},
NestList[Abs[Subtract@@@Partition[#,2,1]]&,Table[Prime[n],{n,its}],its-1]
];

Flatten[Function[f,Position[f,_?(#>2&),{1},1]]/@Rest[l]]-1