A114136 Numbers k such that k divides the sum of digits of all numbers from 1 to k.
1, 3, 5, 7, 9, 18, 21, 24, 38, 58, 78, 98, 298, 498, 501, 537, 698, 702, 707, 711, 716, 898, 1141, 1197, 1501, 1557, 1998, 2703, 2706, 2712, 2715, 3998, 4502, 4509, 4529, 4536, 5998, 7998, 8001, 8097, 9998, 29998, 36001, 36297, 49998, 54504, 54507, 54510
Offset: 1
Links
- Giovanni Resta, Table of n, a(n) for n = 1..320 (terms < 5*10^12, first 203 terms from Robert G. Wilson v)
Crossrefs
Cf. A037123.
Programs
-
Mathematica
lst = {}; k = 1; s = 0; While[k < 10001, If[ Mod[s += Plus @@ IntegerDigits@k, k++] == 0, AppendTo[lst, k -1]]]; lst (* Robert G. Wilson v, Jul 06 2018 *) nxt[{t_,n_}]:={t+Total[IntegerDigits[n+1]],n+1}; Select[NestList[nxt,{1,1},55000],Divisible[#[[1]],#[[2]]]&][[All,2]] (* Harvey P. Dale, Jan 18 2019 *)
-
PARI
isok(n) = (sum(k=1, n, sumdigits(k)) % n) == 0; \\ Michel Marcus, Jul 16 2018
Comments