The OEIS is supported by the many generous donors to the OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A338946 Lengths of Cunningham chains of the second kind that are sorted by first prime in the chain. 3
 3, 2, 1, 1, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 3, 2, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 3, 1, 1, 1, 1, 1, 1 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,1 COMMENTS Row lengths of A338944. 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 start with p = 2. Since 2(2) - 1 = 3 is prime, and further 2(3) - 1 = 5 is prime, but 2(5) - 1 is composite, we have chain length 3, so a(1) = 3. p = 7 is the smallest prime that hasn't appeared in a chain thus far; since 2(7) - 1 = 13 is prime but 2(13) - 1 = 25 is composite, we have a chain of length 2, so a(2) = 2. p = 11 is the smallest prime that hasn't appeared in a chain; 2(11) - 1 = 21 is composite, so we have a singleton chain, thus 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 Cf. A075712, A338944, A338945. Sequence in context: A316456 A370060 A344893 * A083716 A231820 A010268 Adjacent sequences: A338943 A338944 A338945 * A338947 A338948 A338949 KEYWORD nonn AUTHOR Michael De Vlieger, Nov 17 2020 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified August 6 17:13 EDT 2024. Contains 374980 sequences. (Running on oeis4.)