OFFSET
1,1
LINKS
Sean A. Irvine, Table of n, a(n) for n = 1..82
EXAMPLE
1 + lcm(1..8) = 29^2, so its smallest prime divisor is 29; it occurs as the 7th term in the sequence because 8 is the 7th prime power: A000961(7) = 8.
MATHEMATICA
Join[{2}, With[{ppwr=Select[Range[200], PrimePowerQ]}, Table[FactorInteger[LCM@@Take[ ppwr, n]+ 1][[1, 1]], {n, 40}]]] (* Harvey P. Dale, May 28 2024 *)
PROG
(Magma) a:=[]; lcm:=1; for k in [1..83] do if (k eq 1) or IsPrimePower(k) then lcm:=Lcm(lcm, k); a:=a cat [Factorization(1+lcm)[1][1]]; end if; end for; a; // Jon E. Schoenfield, May 28 2018
(PARI) a(n) = {my(nb = 1, lc = 1, k = 2); while (nb != n, if (isprimepower(k), nb++; lc = lcm(lc, k)); k++; ); vecmin(factor(lc +1)[, 1]); } \\ Michel Marcus, May 29 2018
(Python)
from math import prod
from sympy import primepi, integer_nthroot, integer_log, primerange, primefactors
def A051454(n):
def f(x): return int(n+x-1-sum(primepi(integer_nthroot(x, k)[0]) for k in range(1, x.bit_length())))
m, k = n, f(n)
while m != k:
m, k = k, f(k)
return min(primefactors(1+prod(p**integer_log(m, p)[0] for p in primerange(m+1)))) # Chai Wah Wu, Aug 15 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved