login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A330210 Numbers that can be expressed as the sum of 2 prime numbers in a prime number of different ways. 0
10, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 38, 40, 44, 48, 52, 54, 56, 62, 64, 68, 70, 74, 76, 78, 82, 86, 94, 96, 98, 104, 112, 124, 128, 130, 136, 140, 144, 148, 156, 158, 164, 168, 174, 176, 178, 186, 188, 192, 194, 198, 206, 208, 210, 216, 218, 222, 224 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Table of n, a(n) for n=1..58.

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 3)

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

Cf. A000040, A014091, A061358.

Sequence in context: A088711 A154774 A162708 * A067188 A092632 A213310

Adjacent sequences:  A330207 A330208 A330209 * A330211 A330212 A330213

KEYWORD

nonn

AUTHOR

Pietro Saia, Dec 05 2019

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 27 02:39 EDT 2021. Contains 346302 sequences. (Running on oeis4.)