OFFSET
1,2
LINKS
Nathaniel Johnston, Table of n, a(n) for n = 1..10000
EXAMPLE
84 is a term because 12 (its sum of digits) is divisible by 3 (its digital root).
MAPLE
A087143 := proc(n) option remember: local k: if(n=1)then return 1:fi: for k from procname(n-1)+1 do if(add(d, d=convert(k, base, 10)) mod (((k-1) mod 9) + 1) = 0)then return k: fi: od: end: seq(A087143(n), n=1..100); # Nathaniel Johnston, May 05 2011
MATHEMATICA
sddrQ[n_]:=Module[{sd=Total[IntegerDigits[n]], dr}, dr=sd; While[dr>9, dr= Total[ IntegerDigits[dr]]]; Divisible[sd, dr]]; Select[Range[100], sddrQ] (* Harvey P. Dale, May 22 2013 *)
PROG
(PARI) is(n)=sumdigits(n)%((n-1)%9+1) == 0 \\ Charles R Greathouse IV, Oct 13 2022
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Reinhard Zumkeller, Aug 18 2003
STATUS
approved