OFFSET
1,2
LINKS
David A. Corneth, Table of n, a(n) for n = 1..386 (terms < 10^1000)
FORMULA
a(p) = p^p - 1 for odd prime p. - David A. Corneth, Mar 29 2021
EXAMPLE
n | a(n) | T(a(n)) = n^n * A342931(n).
----+----------+------------------------------------
1 | 1 | 1 = 1^1 * 1.
2 | 7 | 28 = 2^2 * 7.
3 | 26 | 351 = 3^3 * 13.
4 | 511 | 130816 = 4^4 * 511.
5 | 3124 | 4881250 = 5^5 * 1562.
6 | 16767 | 140574528 = 6^6 * 3013.
7 | 823542 | 339111124653 = 7^7 * 411771.
8 | 33554431 | 562949936644096 = 8^8 * 33554431.
PROG
(PARI) a(n) = my(k=1, m=n^n); while(k*(k+1)/2%m!=0, k++); k;
(PARI) a(n) = { my(p = 2*n^n, f = factor(p), res = oo); for(i = 2^(#f~-1), 2^#f~-1, b = binary(i); pr = prod(j = 1, #f~, f[j, 1]^(b[j]*f[j, 2])); ipr = p/pr; for(j = -1, 0, c = lift(chinese(Mod(-1-j, ipr), Mod(j, pr))); if(c > 0, res = min(res, c)))); res } \\ David A. Corneth, Mar 29 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Seiichi Manyama, Mar 29 2021
EXTENSIONS
More terms from David A. Corneth, Mar 29 2021
STATUS
approved