OFFSET
0,3
COMMENTS
a(4*k)=0, with k>=1
a(4*k-2)=1, with k>=1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
MAPLE
P:=proc(n) local a, i, k, w; a:=0; print(a); for i from 1 by 1 to n do w:=0; k:=i; while k>0 do w:=w+k-(trunc(k/10)*10); k:=trunc(k/10); od; a:=abs(a+(-1)^i*w); print(a); od; end: P(100);
MATHEMATICA
nxt[{n_, a_}]:={n+1, Abs[a+(-1)^(n+1) Total[IntegerDigits[n+1]]]}; NestList[nxt, {0, 0}, 100][[All, 2]] (* Harvey P. Dale, Jan 04 2019 *)
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Paolo P. Lava and Giorgio Balzarotti, May 08 2008
EXTENSIONS
Definition corrected by N. J. A. Sloane, Jan 04 2019
STATUS
approved