|
|
A337817
|
|
Smallest nonnegative number that has exactly n different representations as the product of a number and the sum of its decimal digits.
|
|
1
|
|
|
|
OFFSET
|
0,1
|
|
COMMENTS
|
With "positive" instead "nonnegative", a(1) would be equal to 1, and other terms would not change.
|
|
LINKS
|
|
|
EXAMPLE
|
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.
|
|
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 *)
|
|
PROG
|
(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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,more
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|