OFFSET
0
COMMENTS
The n-th 1 is followed by n^3 - 1 zeros.
Characteristic function of triangular numbers squared.
LINKS
Chai Wah Wu, Algorithms for Complementary Sequences, Integers (2025) Vol. 25, Art. No. A95. See p. 24.
FORMULA
a(n) = 1 if n is the sum of the first floor((4n)^(1/4)) cubes and a(n) = 0 otherwise.
MATHEMATICA
a[n_]:=Boole[IntegerQ[(Sqrt[1+8Sqrt[n]]-1)/2]]; Array[a, 87, 0] (* Stefano Spezia, Sep 08 2025 *)
PROG
(Python)
from math import isqrt
def A387646(n): return int(n==((m:=isqrt(isqrt(n<<2)))*(m+1)>>1)**2)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Chai Wah Wu, Sep 04 2025
STATUS
approved
