Annual Appeal: Please make a donation (tax deductible in USA) to keep the OEIS running. Over 4500 articles have referenced us, often saying "we would not have discovered this result without the OEIS".

A138376

a(n+1) = abs[ a(n) + Sum_of_digits_of(n+1)], with a(0)=0.

a(n+1) = abs[ a(n) + Sum_of_digits_of(n+1)], with a(0)=0.

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);