A108257 Numbers k such that concatenating k and the sum of factorials of the digits of k produces a prime.
1, 13, 15, 30, 31, 91, 101, 110, 128, 133, 136, 138, 144, 152, 156, 166, 175, 193, 199, 203, 215, 230, 250, 260, 280, 281, 303, 304, 306, 307, 309, 315, 320, 330, 331, 340, 361, 391, 412, 508, 520, 550, 606, 651, 661, 681, 708, 712, 717, 730, 750, 751, 780
Offset: 1
Examples
193 is in the sequence because 1!+9!+3! = 362887 and 193362887 is prime.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
Select[Range[780],PrimeQ[FromDigits[Join[IntegerDigits[#],IntegerDigits[Total[IntegerDigits[#]!]]]]]&] (* James C. McMahon, Feb 22 2024 *)
-
Python
from math import factorial from sympy import isprime def ok(n): return isprime(int((s:=str(n))+str(sum(factorial(int(d)) for d in s)))) print([k for k in range(999) if ok(k)]) # Michael S. Branicky, Feb 22 2024
Comments