OFFSET
1,1
COMMENTS
Inspired by and analogous to A305382.
Just as for A305382, it is conjectured that a(n) is finite for all n.
All primes less than prime(125000000) have been checked.
First occurrence of k=2,3,4,...: 2, 1, 4, 5, 7, 11, 15, 19, 26, 58, 80, 125, 169, 121, 67, 525, 808, 938, 1799, 1926, 2760, 10658, 4661, 14433, 47463, 22304, 11878, 32103, 101513, 146448, 249616, 266149, 2580007, 2060718, 2883547, 11483667, 8388622, 19786313, ..., .
EXAMPLE
a(5) = 5 because the 5th prime, 11 -> 21 -> 3 & 7 -> 5 & 13 -> 9 & 25 -> 3 & 5. Thus there are 5 primes in order of appearance {5, 11, 3, 7, 13}.
MATHEMATICA
g[lst_List] := Union@ Join[lst, First@# & /@ Flatten[ FactorInteger[2lst -1], 1]]; f[n_] := Length@ NestWhile[g@# &, {Prime@n}, UnsameQ, All]; Table[ f[n], {n, 100}]
PROG
(PARI) a(n) = {va = [prime(n)]; done = 0; while (! done, done = 1; for (k=1, #va, f = factor(2*va[k]-1); for (j=1, #f~, if (! vecsearch(va, f[j, 1]), va = Set(concat(va, f[j, 1])); done = 0); ); ); ); #select(x->isprime(x), va); } \\ Michel Marcus, Jul 03 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Jun 18 2018
STATUS
approved