OFFSET
1,2
EXAMPLE
a(2) = 4+5 = 9= 3^2. a(8)= 1+2+3+4+5+6+7+8 = 36 = 6^2.
PROG
(PARI) a(n) = if (!(n%4) && ((n/4^valuation(n, 4)) % 2), 0, my(o=n*(n+1)/2, k=0); while(!issquare(o+n*k), k++); o+n*k); \\ Michel Marcus, Sep 09 2025
(Python)
from itertools import count
from sympy.ntheory.primetest import is_square
def A076115(n):
if not (n&1 or (~n & n-1).bit_length()&1): return 0
return next(m for a in count(1) if is_square(m:=n*(n+(a<<1)-1)>>1)) # Chai Wah Wu, Sep 16 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Oct 09 2002
EXTENSIONS
More terms from David Wasserman, Apr 02 2005
STATUS
approved
