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
