A187924 a(n) is the smallest multiple of n such that a(n) ends with n and S(a(n))=n where S(m) is the sum of the base ten digits of m, or 0 if no such a(n) exists.
1, 2, 3, 4, 5, 6, 7, 8, 9, 910, 0, 912, 11713, 6314, 915, 3616, 15317, 918, 17119, 9920, 18921, 9922, 82823, 19824, 9925, 46826, 18927, 18928, 78329, 99930, 585931, 388832, 1098933, 198934, 289835, 99936, 99937, 478838, 198939, 1999840
Offset: 1
Examples
For n=13 11713 is the least integer which is multiple of 13, ends with "13" and sum of digits in decimal notation also is 13.
Links
- Martins Opmanis, Table of n, a(n) for n = 1..582
Crossrefs
A075154 is similar but limited to equivalence of last two digits; therefore at least the first 99 terms are the same in both sequences.
Programs
-
Mathematica
Table[If[n == 11, 0, Block[{k = 1}, While[Nand[FromDigits@ Take[#, -IntegerLength@ n] == n, Total@ # == n] &@ IntegerDigits[k n], k++]; k n]], {n, 40}] (* Michael De Vlieger, Dec 09 2017 *)
-
PARI
a(n) = {if (n == 11, return (0)); my(k = 1); while (!((sumdigits(k*n) == n) && (nd = #digits(n)) && !((k*n - n) % 10^nd)), k++); k*n;} \\ Michel Marcus, Dec 23 2017
Extensions
Name corrected by Michel Marcus, Dec 24 2017
Comments