A215059 Numbers n such that (sum of factorial of decimal digits of n) + (product of factorial of decimal digits of n) is prime.
1, 10, 11, 12, 13, 15, 20, 21, 30, 31, 50, 51, 1000, 1001, 1002, 1010, 1011, 1012, 1020, 1021, 1100, 1101, 1102, 1110, 1111, 1112, 1120, 1121, 1200, 1201, 1210, 1211, 1339, 1344, 1345, 1354, 1356, 1359, 1365, 1366, 1368, 1386, 1393, 1395, 1434, 1435, 1443
Offset: 1
Examples
1345 is in the sequence because (1! + 3! + 4! + 5! ) + (1! * 3! * 4! * 5!) = 151 + 17280 = 17431 is prime.
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
Crossrefs
Cf. A185300.
Programs
-
Maple
A:= proc(n) add(d!, d=convert(n, base, 10)) ; end proc: B:= proc(n) mul(d!, d=convert(n, base, 10)) ; end proc: isA:= proc(n) isprime(A(n)+B(n)) ; end proc: for n from 1 to 1500 do if isA(n) then printf("%a, ", n) ; end if; end do:
-
Mathematica
fdpQ[n_]:=Module[{f=IntegerDigits[n]!},PrimeQ[Total[f]+Times@@f]]; Select[ Range[1500],fdpQ] (* Harvey P. Dale, Nov 26 2013 *)