login
A395820
a(n) is the largest k such that k*(k+1)/2 | n^n.
2
1, 1, 2, 1, 1, 8, 1, 1, 2, 4, 1, 8, 1, 7, 9, 1, 1, 8, 1, 4, 6, 1, 1, 8, 1, 1, 2, 7, 1, 80, 1, 1, 242, 16, 49, 8, 1, 1, 26, 4, 1, 63, 1, 1, 9, 1, 1, 8, 1, 4, 17, 1, 1, 8, 10, 7, 18, 1, 1, 80, 1, 31, 6, 1, 25, 242, 1, 16, 2, 49, 1, 8, 1, 1, 9, 1, 1, 26, 1, 4, 2, 1, 1, 63
OFFSET
1,3
COMMENTS
From David A. Corneth, May 13 2026: (Start)
Equivalent to a(n) is the largest k such that k*(k + 1) | 2*n^n.
The advantage over this sequence is we can exploit k, k+1 being coprime and so not go over all divisors of n^n. (End)
LINKS
David A. Corneth, Table of n, a(n) for n = 1..1544 (first 389 terms from Chai Wah Wu)
FORMULA
If p != 3 and p is prime, then a(p) = 1. - Chai Wah Wu, May 08 2026
PROG
(Python)
from math import isqrt
from sympy import divisors
from sympy.ntheory.primetest import is_square
def A395820(n): return next(isqrt((d<<3)+1)>>1 for d in reversed(divisors(n**n)) if is_square((d<<3)+1)) # Chai Wah Wu, May 08 2026
CROSSREFS
KEYWORD
nonn
AUTHOR
Hugo Pfoertner, May 08 2026
STATUS
approved