|
|
A291302
|
|
a(n) = number of steps to reach a prime when x -> sigma(x)-1 is repeatedly applied to the product of the first n primes, or -1 if no prime is ever reached.
|
|
5
|
|
|
0, 1, 1, 2, 1, 3, 3, 1, 3, 4, 46, 57, 7, 9, 17, 1, 45, 1, 33, 8, 10, 4, 3, 32, 6, 47, 17, 21, 41, 17, 12, 11, 10, 31, 74, 25, 99, 11
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,4
|
|
LINKS
|
|
|
EXAMPLE
|
2*3*5*7*11*13 = 30030 -> 96767 -> 111359 -> 117239 takes three steps to reach a prime, so a(6) = 3.
|
|
MAPLE
|
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 ;
|
|
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
m, c = primorial(n), 0
while not isprime(m):
m = divisor_sigma(m) - 1
c += 1
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,more
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|