OFFSET
1,1
EXAMPLE
800 is a term as 800 = 2^5 * 5^2, 2+5 = 5+2 = 7, and 7,5,2 are primes.
MATHEMATICA
terms = 24; fromFactors[s_List] := (Times @@ (s^#)&) /@ Permutations[s]; Clear[f]; f[n_] := f[n] = (ssp = Select[Subsets[Prime[Range[n]]] // Rest, PrimeQ[Total[#]]&]; fromFactors /@ ssp // Flatten // Union // PadRight[#, terms]& ); f[2]; f[n = 4]; While[Print["n = ", n]; f[n] != f[n-2], n = n+2]; f[n] (* Jean-François Alcover, Jul 20 2015 *)
PROG
(PARI) isok(n) = {f = factor(n); for (i=1, #f~, if (! isprime(f[i, 2]), return (0)); ); isprime(se = sum(i=1, #f~, f[i, 2])) && (se == sum(i=1, #f~, f[i, 1])); } \\ Michel Marcus, Aug 21 2014
(Python)
from sympy import factorint, isprime
A071837 = []
for n in range(1, 10**5):
f = factorint(n)
fp, fe = list(f.keys()), list(f.values())
if sum(fp) == sum(fe) and isprime(sum(fe)) and all([isprime(e) for e in fe]):
A071837.append(n)
# Chai Wah Wu, Aug 27 2014
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
Reinhard Zumkeller, Jun 08 2002
EXTENSIONS
Missing terms inserted by Sean A. Irvine, Aug 17 2024
STATUS
approved