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
3, 13, 20, 22, 23, 30, 31, 32, 34, 43, 45, 54, 100, 102, 103, 113, 120, 122, 123, 130, 131, 132, 134, 143, 145, 154, 200, 201, 202, 204, 210, 212, 213, 220, 221, 222, 224, 231, 233, 235, 239, 240, 242, 244, 248, 253, 255, 259, 277, 284 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
!k is a subfactorial number (A000166).
LINKS
EXAMPLE
389 is in the sequence because !3 + !8 + !9 = 2 + 14833 + 133496 = 148331 is prime.
MAPLE
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
type(s, prime)=true then printf(`%d, `, n):else fi : od:
MATHEMATICA
subf[n_]:=n!Sum[(-1)^k/k!, {k, 0, n}]; Select[Range[300], PrimeQ[Total[ subf/@ IntegerDigits[#]]]&] (* Harvey P. Dale, Oct 03 2011 *)
CROSSREFS
Cf. A000166.
Sequence in context: A353251 A271924 A354427 * A273686 A215567 A214519
KEYWORD
nonn,base
AUTHOR
Michel Lagneau, Dec 26 2010
STATUS
approved

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 25 04:42 EDT 2024. Contains 371964 sequences. (Running on oeis4.)