OFFSET
1,2
COMMENTS
If 9*A007489(d) < n < (d+1)! then a(n)=0. The least d for which 9*A007489(d)+1<(d+1)! is 10, so a(n)=0 for 36341217 < n < 39916800. - Robert Israel, Aug 16 2020
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(59) = 129 because 1*1! + 2*2! + 9*3! = 1+4+54 = 59.
MAPLE
for n from 1 to 70 do :i:=0:for nn from 1 to 1000 while(i=0) do:l:=length(nn):n0:=nn:s:=0:for m from l by -1 to 1 do:q:=n0:u:=irem(q, 10):v:=iquo(q, 10):n0:=v :s:=s+u*m!:od: if s=n then i:=1:printf(`%d, `, nn):else fi:od:od:
MATHEMATICA
Table[k = 1; While[d = IntegerDigits[k]; s = Sum[d[[i]] i!, {i, Length[d]}]; s != n, k++]; k, {n, 100}] (* T. D. Noe, Oct 20 2011 *)
snk[n_]:=Module[{k=1}, While[Total[IntegerDigits[k]*Range[IntegerLength[k]]!]!=n, k++]; k]; Array[ snk, 60] (* Harvey P. Dale, May 26 2024 *)
CROSSREFS
KEYWORD
AUTHOR
Michel Lagneau, Oct 20 2011
EXTENSIONS
Definition edited by Robert Israel, Aug 16 2020
STATUS
approved