A337817 Smallest nonnegative number that has exactly n different representations as the product of a number and the sum of its decimal digits.
2, 0, 36, 900, 138600, 25336080, 3732276240, 240277237200
Offset: 0
Examples
2 is the smallest number that is not possible to write as (m * sum of digits of m) for some m, hence a(0) = 2. 0 = 0 * 0, hence a(1) = 0 36 = 6 * 6 = 12 * (1+2) and 36 is the smallest number with 2 such representations, hence a(2) = 36.
Programs
-
Mathematica
f[n_] := n*Plus @@ IntegerDigits[n]; m = 2*10^5; v = Table[0, {m}]; Do[i = f[n] + 1; If[i <= m, v[[i]]++], {n, 0, m}]; s = {}; k = 0; While[(p = Position[v, k]) != {}, AppendTo[s, p[[1, 1]] - 1]; k++]; s (* Amiram Eldar, Sep 23 2020 *)
-
PARI
a(n)={if(n==1, 0, for(k=1, oo, if(sumdiv(k, d, d*sumdigits(d)==k) == n, return(k))))} \\ Andrew Howroyd, Sep 23 2020
Extensions
a(3)-a(5) from Amiram Eldar, Sep 23 2020
a(6)-a(7) from Bert Dobbelaere, Sep 27 2020, matching upper bounds from David A. Corneth
Comments