login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A379144
a(n) is the number of iterations of the function x --> 2*x - 1 such that x remains prime, starting from A005382(n).
0
2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 2, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 2, 1, 1, 1, 1
OFFSET
1,1
COMMENTS
Cunningham chain of the second 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 second kind for primes from A005382.
FORMULA
a(A110581(n)) = 1.
a(A057326(n)) = 2.
EXAMPLE
n = 1: A005382(1) = 2 --> 3 --> 5 --> 9, 9 is not a prime, thus a(1) = 2.
n = 3: A005382(3) = 7 --> 13 --> 25, 25 is not a prime, thus a(3) = 1.
MATHEMATICA
s[n_] := -2 + Length[NestWhileList[2*# - 1 &, n, PrimeQ[#] &]]; Select[Array[s, 5000], # > 0 &] (* Amiram Eldar, Dec 16 2024 *)
KEYWORD
nonn,new
AUTHOR
Ctibor O. Zizka, Dec 16 2024
STATUS
approved