OFFSET
1,2
COMMENTS
It can be proved that a(11)=0 and, for infinitely many n, a(n) is the least integer with S(n)=n. Conjecture: 11 is the only n for which a(n)=0.
The conjecture is correct. Let m = (n*10^((n-S(n))/9) - n) * 10^floor(1+log_10(n)) + n. If n != 11, then it can be proved that m has all the required properties of a(n) except that it may not be the smallest candidate. If n=11, then S(m)=20 instead of the required 11. - Ørjan Johansen, Dec 08 2017
LINKS
Martins Opmanis, Table of n, a(n) for n = 1..582
EXAMPLE
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.
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Martins Opmanis, Mar 16 2011
EXTENSIONS
Name corrected by Michel Marcus, Dec 24 2017
STATUS
approved