OFFSET
1,2
COMMENTS
a(10*t-1) = 0 for t > 0, because if the first 10*t-1 multiples of a number k have the same sum of digits, then 10*t*k also has the same sum, since sod(10*t*k) = sod(t*k).
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..1000
EXAMPLE
a(4) = 135 since 1*135 = 135, 2*135 = 270, 3*135 = 405 and 4*135 = 540 all have the same sum of digits (9) while 5*135 = 675 has a different sum of digits.
MATHEMATICA
sod[n_] := Plus @@ IntegerDigits@n; okQ[n_, k_] := Catch@Block[{s = sod@k}, Do[If[ sod[j*k] != s, Throw@ False], {j, 2, n}]; sod[k*(n + 1)] != s]; a[n_] := If[ Mod[n, 10] == 9, 0, Block[{k = 1}, While[! okQ[n, k], k++]; k]]; Array[a, 20]
PROG
(PARI) for(r=2, 46, n=0; if(Mod(r, 10)==0, print1(n, ", "), until(m==r, n++; s=sumdigits(n); m=1; until(!(sumdigits(n*m)==s), m++)); print1(n, ", "))); \\ Arkadiusz Wesolowski, Feb 21 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Giovanni Resta, Feb 17 2014
STATUS
approved