login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A359950
a(n) is the greatest prime factor of n^n - n!.
1
2, 7, 29, 601, 29, 116929, 11887, 4778489, 82207, 296987, 2767, 464089, 36922117, 71722471217, 10219277051, 9406703479, 2040247819, 122450719, 1265072927, 18353142818474353, 21514105057, 46999724987, 29693667067, 5684341885088084044195811037649, 692132186353, 12114317049616531
OFFSET
2,1
LINKS
FORMULA
a(n) = A006530(A036679(n)) = A006530(n*A126130(n-1)).
EXAMPLE
a(5) = greatest prime factor of 5^5 - 5! = greatest prime factor of 3125 - 120 = greatest prime factor of 3005 = 3005/5 = 601.
MATHEMATICA
Table[Max[First/@FactorInteger[n^n-n!]], {n, 2, 27}] (* Stefano Spezia, Jan 22 2023 *)
PROG
(PARI) a(n) = vecmax(factor(n^n - n!)[, 1]); \\ Michel Marcus, Jan 22 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from Michel Marcus, Jan 22 2023
STATUS
approved