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!)
A178712 Numbers n such that the sum of subfactorial of the decimal digits of n is prime. 1

%I #9 Nov 21 2013 12:50:05

%S 3,13,20,22,23,30,31,32,34,43,45,54,100,102,103,113,120,122,123,130,

%T 131,132,134,143,145,154,200,201,202,204,210,212,213,220,221,222,224,

%U 231,233,235,239,240,242,244,248,253,255,259,277,284

%N Numbers n such that the sum of subfactorial of the decimal digits of n is prime.

%C !k is a subfactorial number (A000166).

%H Harvey P. Dale, <a href="/A178712/b178712.txt">Table of n, a(n) for n = 1..1000</a>

%e 389 is in the sequence because !3 + !8 + !9 = 2 + 14833 + 133496 = 148331 is prime.

%p with(numtheory):f:=n->sum(n!*(((-1)^k)*1/k!),k=0..n):for n from 0 to 400 do:l:=length(n):n0:=n:s:=0:for m from 1 to l do:q:=n0:u:=irem(q, 10):v:=iquo(q, 10):n0:=v :s:=s+f(u): od: if

%p type(s,prime)=true then printf(`%d, `,n):else fi : od:

%t subf[n_]:=n!Sum[(-1)^k/k!,{k,0,n}]; Select[Range[300],PrimeQ[Total[ subf/@ IntegerDigits[#]]]&] (* _Harvey P. Dale_, Oct 03 2011 *)

%Y Cf. A000166.

%K nonn,base

%O 1,1

%A _Michel Lagneau_, Dec 26 2010

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 24 00:30 EDT 2024. Contains 371917 sequences. (Running on oeis4.)