A379148 a(n) is the number of iterations of the function x --> 2*x + 1 such that x remains prime, starting from A005384(n).
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
Keywords
Examples
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.
Programs
-
Mathematica
s[n_] := -2 + Length[NestWhileList[2*# + 1 &, n, PrimeQ[#] &]]; Select[Array[s, 5000], # > 0 &] (* Amiram Eldar, Dec 16 2024 *)
Formula
a(A371980(n)) = 1.
Comments