OFFSET
0,8
COMMENTS
FORMULA
PROG
(Python)
from math import isqrt, comb
from sympy import integer_nthroot
def A056557(n): return (k:=isqrt(r:=n+1-comb((m:=integer_nthroot(6*(n+1), 3)[0])-(n<comb(m+2, 3))+2, 3)<<1))-((r<<2)<=(k<<2)*(k+1)+1) # Chai Wah Wu, Nov 04 2024
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
Henry Bottomley, Jun 26 2000
STATUS
approved