OFFSET
1,4
EXAMPLE
2*3*5*7*11*13 = 30030 -> 96767 -> 111359 -> 117239 takes three steps to reach a prime, so a(6) = 3.
MAPLE
A291302 := proc(n)
local a, x ;
a := 0 ;
x := mul(ithprime(i), i=1..n) ;
while not isprime(x) do
x := numtheory[sigma](x)-1 ;
a := a+1 ;
end do:
a ;
end proc: # R. J. Mathar, Sep 12 2017
MATHEMATICA
p[n_]:=Times@@Prime/@Range[n]; f[n_]:=DivisorSigma[1, n]-1;
a[n_]:=Length[NestWhileList[f, p[n], CompositeQ]]-1; a/@Range[34] (* Ivan N. Ianakiev, Sep 01 2017 *)
PROG
(Python)
from sympy import primorial, isprime, divisor_sigma
def A291302(n):
m, c = primorial(n), 0
while not isprime(m):
m = divisor_sigma(m) - 1
c += 1
return c # Chai Wah Wu, Aug 31 2017
CROSSREFS
KEYWORD
nonn,more
AUTHOR
N. J. A. Sloane, Aug 31 2017
EXTENSIONS
a(11)-a(35) from Chai Wah Wu, Aug 31 2017
a(36)-a(38) from Ivan N. Ianakiev, Sep 01 2017
STATUS
approved