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.

A330210 Numbers that can be expressed as the sum of 2 prime numbers in a prime number of different ways.

This page as a plain text file.
%I A330210 #16 Oct 07 2024 14:06:05
%S A330210 10,14,16,18,20,22,24,26,28,30,32,38,40,44,48,52,54,56,62,64,68,70,74,
%T A330210 76,78,82,86,94,96,98,104,112,124,128,130,136,140,144,148,156,158,164,
%U A330210 168,174,176,178,186,188,192,194,198,206,208,210,216,218,222,224
%N A330210 Numbers that can be expressed as the sum of 2 prime numbers in a prime number of different ways.
%e A330210 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.
%t A330210 Select[Range[2, 224, 2], PrimeQ@ Length@ IntegerPartitions[#, {2}, Prime@ Range@ PrimePi@ #] &] (* _Giovanni Resta_, Dec 06 2019 *)
%o A330210 (Python)
%o A330210 import math
%o A330210 from sympy import isprime
%o A330210 def main(n):
%o A330210     x = {}
%o A330210     a = 1
%o A330210     b = 1
%o A330210     for i in range(2, n):
%o A330210         x[i] = []
%o A330210         while a < i:
%o A330210             if a + b == i:
%o A330210                 x[i].append(str(a) + "+" + str(b))
%o A330210             b += 1
%o A330210             if b == i:
%o A330210                 a += 1
%o A330210                 b = 1
%o A330210         a = 1
%o A330210         b = 1
%o A330210     for i in x:
%o A330210         x[i] = x[i][0:math.ceil(len(x[i])/2)]
%o A330210     x[2] = ["1+1"]
%o A330210     newdict = {}
%o A330210     for i in x:
%o A330210         newdict[i] = []
%o A330210         for j in x[i]:
%o A330210             if isprime(int(j.split("+")[0])) and isprime(int(j.split("+")[1])):
%o A330210                 newdict[i].append(j)
%o A330210     finaloutput = []
%o A330210     for i in newdict:
%o A330210         if isprime(len(newdict[i])):
%o A330210             finaloutput.append(i)
%o A330210     return finaloutput
%o A330210 def a(n):
%o A330210     x = 0
%o A330210     while len(main(x)) != n:
%o A330210         x += 1
%o A330210     return main(x)[-1]
%Y A330210 Cf. A000040, A014091, A061358.
%K A330210 nonn
%O A330210 1,1
%A A330210 _Pietro Saia_, Dec 05 2019