cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A358998 Nonprimes whose sum of factorials of digits is a prime.

This page as a plain text file.
%I A358998 #26 Feb 23 2023 14:48:40
%S A358998 10,12,20,21,30,100,110,111,122,133,134,135,136,143,153,155,178,187,
%T A358998 202,212,220,221,303,304,305,306,314,315,316,330,340,341,350,351,360,
%U A358998 361,403,413,430,505,513,515,530,531,550,551,603,630,708,718,780,781,807
%N A358998 Nonprimes whose sum of factorials of digits is a prime.
%H A358998 Michael S. Branicky, <a href="/A358998/b358998.txt">Table of n, a(n) for n = 1..10000</a>
%F A358998 A165451 INTERSECT A002808. - _R. J. Mathar_, Feb 23 2023
%e A358998 134 is in the sequence because it is not prime and 1! + 3! + 4! = 1 + 6 + 24 = 31 which is a prime number.
%e A358998 202 is also in the sequence because it is not prime and 2! + 0! + 2! = 5 prime.
%t A358998 Select[Range[1000], ! PrimeQ[#] && PrimeQ[Total[IntegerDigits[#]!]] &] (* _Amiram Eldar_, Feb 11 2023 *)
%o A358998 (Python)
%o A358998 from sympy import isprime
%o A358998 from math import factorial
%o A358998 S=[]
%o A358998 nomb=200
%o A358998 i=0
%o A358998 while len(S) < nomb:
%o A358998     i+=1
%o A358998     if isprime(i):
%o A358998         continue
%o A358998     som=0
%o A358998     for j in range(len(str(i))):
%o A358998         som+=factorial(int(ix[j]))
%o A358998     if  not isprime(som):
%o A358998         continue
%o A358998     S.append(i)
%o A358998 (Python)
%o A358998 from sympy import isprime
%o A358998 from math import factorial
%o A358998 def f(n): return sum(factorial(int(d)) for d in str(n))
%o A358998 def ok(n): return not isprime(n) and isprime(f(n))
%o A358998 print([k for k in range(900) if ok(k)]) # _Michael S. Branicky_, Feb 11 2023
%Y A358998 Cf. A061602, A084405 (Primes such that the sum of the factorials of the digits is also prime).
%K A358998 base,easy,nonn
%O A358998 1,1
%A A358998 _Carole Dubois_, Feb 11 2023