OFFSET
1,1
EXAMPLE
For n=1: a(1) = 83 is followed by [6,8,4].
For n=2: a(2) = 2903 is followed by [6,2,4,18,2,4].
For n=3: a(3) = 5897 is followed by [6,20,4,12,14,28,6,20,4].
For n=4: a(4) = 319499 is followed by [12,8,22,6,20,10,12,2,10,6,32,34].
For n=5: a(5) = 346943 is followed by [18,2,40,....,30,2,10] differences corresponding to n "wavelet" of [0,2,4] remainders modulo 6.
MATHEMATICA
(* generates a(5) *) d[x_] := Prime[x+1]-Prime[x]; md[x_] := Mod[Prime[x+1]-Prime[x], 6]; h={k1=0, k2=2, k3=4}; k=0; Do[If[Equal[md[n], k1]&&Equal[md[n+1], k2]&& Equal[md[n+2], k3]&&Equal[md[n+3], k1]&&Equal[md[n+4], k2]&&Equal[md[n+5], k3] &&Equal[md[n+6], k1]&&Equal[md[n+7], k2]&&Equal[md[n+8], k3] &&Equal[md[n+9], k1]&&Equal[md[n+10], k2]&&Equal[md[n+11], k3]&& Equal[md[n+12], k1]&&Equal[md[n+13], k2]&&Equal[md[n+14], k3], k=k+1; Print[{k, n, Prime[n], Table[md[n+j], {j, -1, 15}], Table[d[n+j], {j, -1, 15}]}]], {n, 2, 10000000}]
PROG
(PARI) lista(pmax) = {my(rec = 0, m = 0, c = 0, prv = 2, p0 = 0, d); forprime(p = 3, pmax, d = (p-prv)%6; if(d == 0 && m == 0, p0 = prv); if(d == c, m++; c = (c+2)%6; if(!(m%3) && m/3 > rec, print1(p0, ", "); rec++; m = 0), if(d == 0, p0 = prv; c = 2; m = 1, c = 0; m = 0)); prv = p); } \\ Amiram Eldar, Nov 04 2024
CROSSREFS
KEYWORD
nonn,more,changed
AUTHOR
Labos Elemer, Jun 02 2003
EXTENSIONS
a(9)-a(12) from Amiram Eldar, Nov 04 2024
STATUS
approved