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.

A084405 Primes whose sum of factorials of digits is also prime.

This page as a plain text file.
%I A084405 #15 Feb 11 2023 20:34:30
%S A084405 2,11,13,31,101,163,313,331,431,503,613,631,1021,1201,1223,1433,1439,
%T A084405 1453,1483,1493,1543,1567,1657,1663,1667,1669,1753,1777,1789,1879,
%U A084405 1987,1999,2011,2111,2203,2213,2221,3049,3163,3221,3313,3331,3361,3413,3461,3491
%N A084405 Primes whose sum of factorials of digits is also prime.
%H A084405 Harvey P. Dale, <a href="/A084405/b084405.txt">Table of n, a(n) for n = 1..1000</a>
%e A084405 a(10)=503, a prime, and 5! + 0! + 3! = 127, a prime.
%t A084405 Select[Prime[Range[500]],PrimeQ[Total[IntegerDigits[#]!]]&] (* _Harvey P. Dale_, Mar 20 2016 *)
%o A084405 (PARI) {digitsumfac(n)=local(s, d); s=0; while(n>0,d=divrem(n,10); n=d[1]; s=s+d[2]!); s}
%o A084405 {facp(m)=local(ct,sr); ct=0; sr=0; forprime(p=2,m, if(isprime(digitsumfac(p)),ct++; print1(p," "); sr+=(1.0/p); )); print(); print("Found: "ct" primes < "m); print("Sum of reciprocals = "sr); }
%o A084405 (Python)
%o A084405 from sympy import isprime
%o A084405 from math import factorial
%o A084405 def f(n): return sum(factorial(int(d)) for d in str(n))
%o A084405 def ok(n): return isprime(n) and isprime(f(n))
%o A084405 print([k for k in range(3500) if ok(k)]) # _Michael S. Branicky_, Feb 11 2023
%Y A084405 Cf. A061602.
%K A084405 base,easy,nonn
%O A084405 1,1
%A A084405 _Jason Earls_, Jun 24 2003