OFFSET
1,1
COMMENTS
All terms are multiples of 3.
LINKS
Paolo P. Lava, Table of n, a(n) for n = 1..1000
EXAMPLE
3 = 2 + 1;
12 = 1+1 + 1+0 + 9;
15 = 1+4 + 1+3 + 1+2 + 1+1 + 1+0.
MAPLE
P:= proc(q) local a, b, c, k, n; for n from 1 to q do a:=0; b:=0;
while a<n do b:=b+1; c:=n-b; for k from 1 to ilog10(n-b)+1 do a:=a+(c mod 10); c:=trunc(c/10);
od; od; if a=n then print(n); fi; od; end: P(10^6);
MATHEMATICA
Select[Range[3, 1000], (x = # - 1; s = Total[IntegerDigits[x]]; While[s < #, x--; s += Total[IntegerDigits[x]]]; s == #) &] (* Robert Price, May 22 2019 *)
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Paolo P. Lava, Feb 25 2016
STATUS
approved