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.
EXAMPLE
MATHEMATICA
s[n_] := -2 + Length[NestWhileList[2*# - 1 &, n, PrimeQ[#] &]]; Select[Array[s, 5000], # > 0 &] (* Amiram Eldar, Dec 16 2024 *)
CROSSREFS
KEYWORD
nonn,new
AUTHOR
Ctibor O. Zizka, Dec 16 2024
STATUS
approved