A067849 a(n) = max{k: f(n),...,f^k(n) are prime}, where f(m) = 2m+1 and f^k denotes composition of f with itself k times.
2, 4, 1, 0, 3, 1, 0, 1, 1, 0, 2, 0, 0, 2, 1, 0, 0, 1, 0, 3, 1, 0, 1, 0, 0, 2, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 2, 0, 0, 6, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 2, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 2, 0, 0, 5, 1
Offset: 1
Keywords
Examples
f(2) = 5, f(f(2)) = 11, f(f(f(2))) = 23, f(f(f(f(2)))) = 47, all prime, but f^5(2) = 95 is not prime, so a(2) = 4.
Links
- Glen Whitney, Table of n, a(n) for n = 1..10000
- Number-theoretic puzzle game DIVE
- Glen Whitney, Python program to compute a(n)
Programs
-
Mathematica
f[n_] := Module[{a = 2n + 1, i = 0}, While[PrimeQ[a], i++; a = 2a + 1]; i]; Table[f[i], {i, 1, 60}]
-
PARI
a(n) = {my(nb = 0, newn); while (isprime(newn=2*n+1), nb++; n = newn); nb;} \\ Michel Marcus, Nov 10 2018
Extensions
More terms from Michel Marcus, Nov 10 2018
Comments