OFFSET
0,4
LINKS
MATHEMATICA
a[0] = 0; a[n_] := a[n] = a[Floor[n/2]]*I + Mod[n, 2]; Table[Abs[a[n]]^2, {n, 0, 100}] (* Amiram Eldar, May 06 2021, after Jean-François Alcover at A131851 *)
PROG
(PARI) {a(n) = my(d=Vecrev(digits(n, 2))); norm(sum(k=1, #d, d[k]*I^k))}
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Seiichi Manyama, Dec 27 2019
STATUS
approved