A280720 For p = prime(n), number of iterations of the function f(x) = 5x + 2 that leave p prime.
0, 1, 0, 1, 0, 2, 0, 3, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 2, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1
Keywords
Links
- John Cerkan, Table of n, a(n) for n = 1..10001
Programs
-
Mathematica
Table[Length@ NestWhileList[5 # + 2 &, Prime@ n, PrimeQ] - 2, {n, 120}] (* Michael De Vlieger, Jan 09 2017 *)
-
PARI
a016873(n) = 5*n+2 a(n) = my(p=prime(n), i=0); while(1, if(!ispseudoprime(a016873(p)), return(i), p=a016873(p); i++))
Comments