|
|
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
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|