login
A379148
a(n) is the number of iterations of the function x --> 2*x + 1 such that x remains prime, starting from A005384(n).
0
4, 1, 3, 2, 1, 1, 2, 1, 1, 5, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 3, 1, 3, 1, 2, 2, 1, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 1, 1, 1, 1, 1, 2, 1
OFFSET
1,1
COMMENTS
Cunningham chain of the first kind of length i is a sequence of prime numbers (p_1, ..., p_i) such that p_(r + 1) = 2*p_r + 1 for all 1 =< r < i. This sequence tells the length of the Cunningham chain of the first kind for primes from A005384.
FORMULA
a(A371980(n)) = 1.
EXAMPLE
n = 1: A005384(1) = 2 --> 5 --> 11 --> 23 --> 47 --> 95, 95 is not a prime, thus a(1) = 4.
n = 2: A005384(2) = 3 --> 7 --> 15, 15 is not a prime, thus a(2) = 1.
MATHEMATICA
s[n_] := -2 + Length[NestWhileList[2*# + 1 &, n, PrimeQ[#] &]]; Select[Array[s, 5000], # > 0 &] (* Amiram Eldar, Dec 16 2024 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Ctibor O. Zizka, Dec 16 2024
STATUS
approved