OFFSET
1,1
COMMENTS
Row lengths of A075712.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
Chris K. Caldwell, Cunningham Chain (PrimePages, Prime Glossary).
Wikipedia, Cunningham chain.
EXAMPLE
We begin with the smallest prime 2. Since 2(5) + 1 = 11 is prime, further, 2(11) + 1 = 23, 2(23) + 1 = 47 are prime but 2(47) + 1 = 95 is not, we have the complete chain {2, 5, 11, 23, 47} of length 5, thus a(1) = 5.
We resume with 3, since 3 has not appeared in any chain generated thus far. Since 2(3) + 1 = 7, but 2(7) + 1 = 15, we have the complete chain {3, 7}, therefore a(2) = 2.
Starting from 13, we find 2(13) + 1 = 27, thus we have a singleton chain and have a(3) = 1, etc.
MATHEMATICA
Block[{a = {2}, b = {}, j = 0, k, p}, Do[k = Length@ b + 1; If[PrimeQ@ a[[-1]], AppendTo[a, 2 a[[-1]] + 1]; j++, While[! FreeQ[a, Set[p, Prime[k]]], k++]; AppendTo[b, j]; Set[j, 0]; Set[a, Append[a[[1 ;; -2]], p]]], 10^3}; b]
CROSSREFS
KEYWORD
nonn
AUTHOR
Michael De Vlieger, Nov 17 2020
STATUS
approved