[go: up one dir, main page]

login
Search: a249666 -id:a249666
     Sort: relevance | references | number | modified | created      Format: long | short | data
Numbers n such that the sum of n and the largest prime<n is prime, and the sum of n and the least prime>n is also prime.
+10
4
6, 24, 30, 36, 50, 54, 78, 84, 114, 132, 144, 156, 174, 210, 220, 252, 294, 300, 306, 330, 360, 378, 474, 492, 510, 512, 528, 546, 560, 594, 610, 650, 660, 690, 714, 720, 762, 780, 800, 804, 810, 816, 870, 912, 996, 1002, 1068, 1074, 1104, 1120, 1170, 1176, 1190, 1210, 1236, 1262
OFFSET
1,1
COMMENTS
This sequence is the intersection of A249624 and A249666.
EXAMPLE
114 is in the sequence because the least prime>114 is 127 and 114+127=241 is prime; the largest prime<114 is 113 and 114+113=227 is prime. Also, 114 is in A249624 and A249666.
MATHEMATICA
Select[Range[1500], AllTrue[#+{NextPrime[#], NextPrime[#, -1]}, PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Mar 09 2016 *)
PROG
(PARI) {for(i=3, 2*10^3, k=i+nextprime(i+1); q=i+precprime(i-1); if(isprime(k)&&isprime(q), print1(i, ", ")))}
(Python)
from gmpy2 import is_prime, next_prime
A249667_list, p = [], 2
for _ in range(10**4):
....q = next_prime(p)
....n1 = 2*p+1
....n2 = p+q+1
....while n1 < p+q:
........if is_prime(n1) and is_prime(n2):
............A249667_list.append(n1-p)
........n1 += 2
........n2 += 2
....p = q # Chai Wah Wu, Dec 06 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Antonio Roldán, Dec 03 2014
STATUS
approved
Numbers n such that the sum of n and the least prime>n (A151800(n)) is prime.
+10
3
0, 1, 2, 6, 8, 14, 18, 20, 24, 30, 34, 36, 38, 48, 50, 54, 64, 68, 78, 80, 84, 94, 96, 98, 104, 110, 114, 124, 132, 134, 138, 144, 154, 156, 164, 174, 182, 188, 198, 208, 210, 216, 220, 228, 230, 248, 252, 258, 260, 270, 284, 294, 300, 306, 308, 314, 322, 328, 330, 336, 344, 360
OFFSET
1,3
EXAMPLE
50 is in the sequence because A151800(50)=53, and 50+53=103 is prime.
PROG
(PARI){for(i=0, 10^3, k=i+nextprime(i+1); if(isprime(k), print1(i, ", ")))}
CROSSREFS
KEYWORD
nonn
AUTHOR
Antonio Roldán, Dec 03 2014
STATUS
approved
Terms k of A249667 such that k-A151799(k) = A151800(k)-k.
+10
3
6, 30, 50, 144, 300, 560, 610, 650, 660, 714, 780, 810, 816, 870, 1120, 1176, 1190, 1806, 2130, 2470, 2490, 2550, 2922, 3030, 3240, 3330, 3390, 3480, 3600, 3620, 3840, 4266, 4368, 5796, 5850, 6270, 6786, 6954, 7074, 7710, 8280, 9400, 9990, 10146, 10350, 10380, 10530, 10660, 11064
OFFSET
1,1
EXAMPLE
610 is in A249667: the least prime>610 is 613, and 610+613=1223 is prime; the largest prime<610 is 607, and 610+607=1217 is prime. Also, 613-610=610-607=3, then 610 is in the current sequence.
PROG
(PARI) {for(i=3, 2*10^4, m=nextprime(i+1); k=i+m; n=precprime(i-1); q=i+n; if(isprime(k)&&isprime(q)&&m-i==i-n, print1(i, ", ")))}
CROSSREFS
KEYWORD
nonn
AUTHOR
Antonio Roldán, Dec 03 2014
STATUS
approved

Search completed in 0.012 seconds