OFFSET
1,2
EXAMPLE
a(7) = 2212 = 7*316 because 2! + 2! + 1! + 2! = 7.
MAPLE
with(numtheory): for n from 1 to 42 do: found:=false: for k from n by n while not found do q:=k: s:=0:
for m from 1 to length(k) do s:=s+irem(q, 10)! : q:=iquo(q, 10): od:
if s=n then found:=true: printf(`%d, `, k) fi od od:
MATHEMATICA
smn[n_]:=Module[{m=1}, While[Total[IntegerDigits[m*n]!]!=n, m++]; m*n]; Array[ smn, 50] (* Harvey P. Dale, Nov 17 2018 *)
PROG
(PARI) a(n)={ my(t, d=49); while((d-47)!<=n, d++); forstep(k=n, 9e99, n, t=Vecsmall(Str(k)); if( t[1]>d, k=(10^#t-1)\n*n, sum(j=1, #t, (t[j]-48)!)==n&return(k)))} \\ M. F. Hasler, Jun 20 2011
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michel Lagneau, Jun 18 2011
STATUS
approved