|
|
A358998
|
|
Nonprimes whose sum of factorials of digits is a prime.
|
|
1
|
|
|
10, 12, 20, 21, 30, 100, 110, 111, 122, 133, 134, 135, 136, 143, 153, 155, 178, 187, 202, 212, 220, 221, 303, 304, 305, 306, 314, 315, 316, 330, 340, 341, 350, 351, 360, 361, 403, 413, 430, 505, 513, 515, 530, 531, 550, 551, 603, 630, 708, 718, 780, 781, 807
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
134 is in the sequence because it is not prime and 1! + 3! + 4! = 1 + 6 + 24 = 31 which is a prime number.
202 is also in the sequence because it is not prime and 2! + 0! + 2! = 5 prime.
|
|
MATHEMATICA
|
Select[Range[1000], ! PrimeQ[#] && PrimeQ[Total[IntegerDigits[#]!]] &] (* Amiram Eldar, Feb 11 2023 *)
|
|
PROG
|
(Python)
from sympy import isprime
from math import factorial
S=[]
nomb=200
i=0
while len(S) < nomb:
i+=1
if isprime(i):
continue
som=0
for j in range(len(str(i))):
som+=factorial(int(ix[j]))
if not isprime(som):
continue
S.append(i)
(Python)
from sympy import isprime
from math import factorial
def f(n): return sum(factorial(int(d)) for d in str(n))
def ok(n): return not isprime(n) and isprime(f(n))
|
|
CROSSREFS
|
Cf. A061602, A084405 (Primes such that the sum of the factorials of the digits is also prime).
|
|
KEYWORD
|
base,easy,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|