OFFSET
1,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..2000
EXAMPLE
n=19 -> Sum_digits(19)=10; Sum_digits(20)=2 -> 10+2=12; Sum_digits(19+20)=12
MAPLE
P:=proc(n) local a, b, i, k, w, y, x; for i from 0 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; x:=0; k:=i+1; while k>0 do x:=x+k-(trunc(k/10)*10); k:=trunc(k/10); od; y:=0; k:=2*i+1; while k>0 do y:=y+k-(trunc(k/10)*10); k:=trunc(k/10); od; if w+x=y then print(i); fi; od; end: P(1000);
MATHEMATICA
Select[Range[0, 1000], Total[IntegerDigits[#]] + Total[IntegerDigits[# + 1]] == Total[IntegerDigits[ 2*# + 1]] &] (* G. C. Greubel, Oct 01 2016 *)
PROG
(PARI) is(n)=my(s=sumdigits, t); t=s(2*n+1)-s(n); t>0 && t==s(n+1) \\ Charles R Greathouse IV, Oct 01 2016
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Paolo P. Lava and Giorgio Balzarotti, Dec 18 2007
STATUS
approved