login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A191895 Smallest multiple of n whose factorial digit sum equals n. 0

%I #12 Jan 22 2021 13:57:40

%S 1,2,12,112,220,222,2212,32,12222,1230,1232,2232,22230,1330,30030,

%T 3232,20332,1000332,223231,33300,23331,132330,213233,233232,12233300,

%U 104,12222333,224,2204,12240,341,3040,202224,10234,23240,2000304,3034,4332,30342,133240,220334,1032234

%N Smallest multiple of n whose factorial digit sum equals n.

%e a(7) = 2212 = 7*316 because 2! + 2! + 1! + 2! = 7.

%p 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:

%p for m from 1 to length(k) do s:=s+irem(q, 10)! : q:=iquo(q, 10): od:

%p if s=n then found:=true: printf(`%d, `, k) fi od od:

%t smn[n_]:=Module[{m=1},While[Total[IntegerDigits[m*n]!]!=n,m++];m*n]; Array[ smn,50] (* _Harvey P. Dale_, Nov 17 2018 *)

%o (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

%K nonn,base

%O 1,2

%A _Michel Lagneau_, Jun 18 2011

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 15:20 EDT 2024. Contains 371916 sequences. (Running on oeis4.)