login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A138376 a(n+1) = abs[ a(n) + (-1)^(n+1) * Sum_of_digits_of(n+1)], with a(0)=0. 1
0, 1, 3, 0, 4, 1, 7, 0, 8, 1, 2, 0, 3, 1, 6, 0, 7, 1, 10, 0, 2, 1, 5, 0, 6, 1, 9, 0, 10, 1, 4, 0, 5, 1, 8, 0, 9, 1, 12, 0, 4, 1, 7, 0, 8, 1, 11, 0, 12, 1, 6, 0, 7, 1, 10, 0, 11, 1, 14, 0, 6, 1, 9, 0, 10, 1, 13, 0, 14, 1, 8, 0, 9, 1, 12, 0, 13, 1, 16, 0, 8, 1, 11, 0, 12, 1, 15, 0, 16, 1, 10, 0, 11, 1, 14 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
a(4*k)=0, with k>=1
a(4*k-2)=1, with k>=1
LINKS
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
Cf. A037123.
Sequence in context: A195084 A306803 A319974 * A077140 A003815 A306562
KEYWORD
easy,nonn,base
AUTHOR
EXTENSIONS
Definition corrected by N. J. A. Sloane, Jan 04 2019
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 20 22:53 EDT 2024. Contains 375341 sequences. (Running on oeis4.)