login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons 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

Harvey P. Dale, Table of n, a(n) for n = 1..1000

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: A294676 A293465 A271924 * A273686 A215567 A214519

Adjacent sequences:  A178709 A178710 A178711 * A178713 A178714 A178715

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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 8 02:26 EDT 2021. Contains 343652 sequences. (Running on oeis4.)