login
A372229
a(n) is the largest prime factor of n^n - n.
3
2, 3, 7, 13, 311, 43, 337, 193, 333667, 13421, 266981089, 28393, 29914249171, 10678711, 1321, 184417, 7563707819165039903, 236377, 192696104561, 920421641, 12271836836138419, 39700406579747, 58769065453824529, 152587500001, 4315817869647001, 797161
OFFSET
2,1
LINKS
FORMULA
a(n) = A006530(A061190(n)).
MAPLE
pf := n -> NumberTheory:-PrimeFactors(n): a := n -> max(pf(n^n - n));
seq(a(n), n = 2..27); # Peter Luschny, Apr 27 2024
MATHEMATICA
Table[f = FactorInteger[n^n-n]; f[[Length[f]]][[1]], {n, 2, 25}] (* Vaclav Kotesovec, Apr 26 2024 *)
PROG
(Python)
from sympy import primefactors
def A372229(n): return max(max(primefactors(n), default=1), max(primefactors(n**(n-1)-1), default=1)) # Chai Wah Wu, Apr 27 2024
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
Tyler Busby, Apr 23 2024
STATUS
approved