login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A254687 Number of decompositions of 2n into sums of two primes p1 < p2 such that p2-p1-1 is also a prime. 2
0, 0, 0, 0, 1, 0, 1, 1, 2, 2, 1, 1, 2, 2, 2, 1, 2, 0, 1, 2, 3, 3, 1, 2, 3, 3, 3, 2, 2, 1, 1, 4, 2, 2, 3, 2, 4, 3, 3, 3, 2, 3, 4, 3, 4, 2, 4, 2, 2, 3, 2, 5, 3, 2, 4, 5, 5, 5, 4, 4, 1, 4, 5, 2, 4, 2, 4, 3, 3, 4, 4, 2, 5, 3, 5, 1, 5, 3, 0, 6, 4, 5, 4, 2, 6, 4, 5 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,9
COMMENTS
a(n)=0 for n = 1, 2, 3, 4, 6, 18, 79. It is conjectured that there is not any other n for which a(n)=0.
LINKS
Lei Zhou, Plot of a(n) for n<=20000.
EXAMPLE
n=5, 2n=10=3+7. 7-3-1=3 is prime, so a(5)=1;
n=6, 2n=12=5+7. 7-5-1=1 is not prime, so a(6)=0;
...
n=21, 2n=42=5+37=11+31=13+29=19+23. 37-5-1=31 is prime, 31-11-1=19 is prime, 29-13-1=15 is composite, 23-19-1=3 is prime: three primes in the form of p2-p1-1 found, so a(21)=3.
MATHEMATICA
Table[e = 2 n; ct = 0; p1 = 1; While[p1 = NextPrime[p1]; p1 < n, p2 = e - p1; If[PrimeQ[p2], If[PrimeQ[Abs[p2 - p1 - 1]], ct++]]]; ct, {n, 1, 100}]
PROG
(Python)
from sympy import isprime, nextprime
def A254687(n):
....y, x, n2 = 0, 2, 2*n
....while x < n:
........if isprime(n2-x) and isprime(n2-2*x-1):
............y += 1
........x = nextprime(x)
....return y # Chai Wah Wu, Feb 18 2015
CROSSREFS
Sequence in context: A207379 A220163 A102715 * A182590 A047846 A345699
KEYWORD
nonn,easy
AUTHOR
Lei Zhou, Feb 05 2015
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 05:39 EDT 2024. Contains 371235 sequences. (Running on oeis4.)