OFFSET
1,1
REFERENCES
From a puzzle proposed by Marc LeBrun.
LINKS
Indranil Ghosh, Table of n, a(n) for n = 1, 10000
MAPLE
succfactorization := proc(n) local p, d; if(1 = n) then RETURN(2); fi; p := 1; for d in ifactors(n)[ 2 ] do p := p * (nextprime(d[ 1 ])^d[ 2 ]); od; RETURN(p); end;
MATHEMATICA
a[1] = 2; a[p_?PrimeQ] := a[p] = Prime[PrimePi[p] + 1]; a[n_] := a[n] = Times @@ (a[First[#]]^Last[#] &) /@ FactorInteger[n]; Table[ a[n], {n, 1, 65}] (* Jean-François Alcover, Jul 18 2013 *)
PROG
(Haskell)
a045965 n = if n == 1 then 2 else a003961 n
-- Reinhard Zumkeller, Jul 12 2012
(Python)
from sympy import factorint, primepi, prime, prod
def a(n):
f=factorint(n)
return 2 if n==1 else prod(prime(primepi(i) + 1)**f[i] for i in f) # Indranil Ghosh, May 15 2017
(PARI) a(n) = if (n==1, 2, my(f=factor(n)); for(i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f)); \\ Michel Marcus, May 18 2020
CROSSREFS
KEYWORD
easy,nonn,nice
AUTHOR
EXTENSIONS
More terms from David W. Wilson
STATUS
approved