OFFSET
1,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10000
FORMULA
MATHEMATICA
Array[Length@ NestWhileList[2 # - 1 &, #, PrimeQ@ # &] - 1 &, 120] (* Michael De Vlieger, Apr 26 2017 *)
PROG
(Python)
from sympy import isprime
def a(n): return 0 if isprime(n) == 0 else 1 + a(2*n - 1) # Indranil Ghosh, Apr 26 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Apr 26 2017
STATUS
approved