A181437 Size of the longest increasing sequence of primes starting with 2, 3 and with second-order differences bounded by n.
4, 57, 57, 421, 421, 1860, 1860, 24661, 24661, 380028, 380028, 2964603, 2964603
Offset: 1
Examples
For n = 1, the sequence is (2, 3, 5, 7) which has 4 members, so a(1) = 4. For n = 2, a sequence is (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 37, 43, 47, 53, 61, 71, 83, 97, 113, 131, 151, 173, 197, 223, 251, 281, 313, 347, 383, 421, 461, 503, 547, 593, 641, 691, 743, 797, 853, 911, 971, 1033, 1097, 1163, 1231, 1301, 1373, 1447, 1523, 1597, 1669, 1741, 1811, 1879, 1949, 2017, 2083) which has 57 members, so a(2) = 57.
Links
- MathOverflow, Is there an infinite increasing sequence of primes with bounded second or larger differences
- Esteban Crespi de Valldaura, C++ program used in computations.
Programs
-
Mathematica
Valid[lst_List]:=Module[{r1,r2}, r1=-n+2*lst[[-1]]-lst[[-2]]; r2=r1+2*n; r1=Max[lst[[-1]]+1,r1]; Select[Range[r1,r2],PrimeQ]]; FindPath[lst_List]:=Module[{p,ln}, p=Valid[lst]; If[p=={}, ln=Length[lst]; If[ln>len, len=ln; Print[{len,lst}]], Do[FindPath[Append[lst,i]], {i,p}]]]; n=2; len=0; t={2,3}; FindPath[t]; len (* T. D. Noe, Feb 03 2011 *)
Comments