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!)
A245878 Primes p such that p - d and p + d are also primes, where d is the smallest nonzero digit of p. 1
67, 607, 6977, 68897, 69067, 69997, 79867, 80677, 88867, 97967, 609607, 660067, 669667, 676987, 678767, 697687, 707677, 766867, 777677, 786697, 866087, 879667, 880667, 886987, 899687, 906707, 909767, 966997, 990967, 6069977, 6096907, 6097997, 6678877 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Intersection of A245744 and A245745.
The smallest nonzero digit of a(n) is 6, and the least significant digit of a(n) is 7.
LINKS
EXAMPLE
The prime 607 is in the sequence because 607 - 6 = 601 and 607 + 6 = 613 are both primes.
MATHEMATICA
pdQ[p_]:=Module[{c=Min[DeleteCases[IntegerDigits[p], 0]]}, AllTrue[p+{c, -c}, PrimeQ]]; Select[Prime[Range[460000]], pdQ] (* Harvey P. Dale, Feb 26 2023 *)
PROG
(PARI) s=[]; forprime(p=2, 7000000, v=vecsort(digits(p), , 8); d=v[1+!v[1]]; if(isprime(p-d) && isprime(p+d), s=concat(s, p))); s
(Python)
import sympy
from sympy import isprime
from sympy import prime
for n in range(1, 10**6):
..s=prime(n)
..lst = []
..for i in str(s):
....if i != '0':
......lst.append(int(i))
..if isprime(s+min(lst)) and isprime(s-min(lst)):
....print(s, end=', ')
# Derek Orr, Aug 13 2014
CROSSREFS
Sequence in context: A163150 A120717 A200963 * A289867 A142139 A178004
KEYWORD
nonn,base
AUTHOR
Colin Barker, Aug 05 2014
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 April 25 13:42 EDT 2024. Contains 371971 sequences. (Running on oeis4.)