OFFSET
1,1
EXAMPLE
24 can be expressed as the sum of 2 prime numbers in 3 different ways (5+19, 7+17, and 11+13), and 3 is prime.
MATHEMATICA
Select[Range[2, 224, 2], PrimeQ@ Length@ IntegerPartitions[#, {2}, Prime@ Range@ PrimePi@ #] &] (* Giovanni Resta, Dec 06 2019 *)
PROG
(Python)
import math
from sympy import isprime
def main(n):
x = {}
a = 1
b = 1
for i in range(2, n):
x[i] = []
while a < i:
if a + b == i:
x[i].append(str(a) + "+" + str(b))
b += 1
if b == i:
a += 1
b = 1
a = 1
b = 1
for i in x:
x[i] = x[i][0:math.ceil(len(x[i])/2)]
x[2] = ["1+1"]
newdict = {}
for i in x:
newdict[i] = []
for j in x[i]:
if isprime(int(j.split("+")[0])) and isprime(int(j.split("+")[1])):
newdict[i].append(j)
finaloutput = []
for i in newdict:
if isprime(len(newdict[i])):
finaloutput.append(i)
return finaloutput
def a(n):
x = 0
while len(main(x)) != n:
x += 1
return main(x)[-1]
CROSSREFS
KEYWORD
nonn
AUTHOR
Pietro Saia, Dec 05 2019
STATUS
approved