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.

A245877 Primes p such that p - d and p + d are also primes, where d is the largest digit of p.

This page as a plain text file.
%I A245877 #14 May 22 2025 10:21:39
%S A245877 263,563,613,653,1613,1663,3463,4643,5563,5653,6263,6323,12653,13463,
%T A245877 14633,16063,16223,21163,21563,25463,26113,30643,32063,33623,36313,
%U A245877 41263,41603,44263,53623,54623,56003,60133,61553,62213,62633,64013,65413,105613,106213
%N A245877 Primes p such that p - d and p + d are also primes, where d is the largest digit of p.
%C A245877 Intersection of A245742 and A245743.
%C A245877 The largest digit of a(n) is 6, and the least significant digit of a(n) is 3.
%C A245877 Intersection of A006489, A011536, and complements of A011537, A011538, A011539. - _Robert Israel_, Aug 05 2014
%H A245877 Harvey P. Dale, <a href="/A245877/b245877.txt">Table of n, a(n) for n = 1..1000</a>
%e A245877 The prime 263 is in the sequence because 263 - 6 = 257 and 263 + 6 = 269 are both primes.
%t A245877 pdpQ[n_]:=Module[{m=Max[IntegerDigits[n]]},AllTrue[n+{m,-m},PrimeQ]]; Select[ Prime[Range[11000]],pdpQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Jan 13 2017 *)
%o A245877 (PARI) select(p->d=vecsort(digits(p),,4)[1]; isprime(p-d) && isprime(p+d), primes(20000))
%o A245877 (Python)
%o A245877 import sympy
%o A245877 from sympy import prime
%o A245877 from sympy import isprime
%o A245877 for n in range(1,10**5):
%o A245877   s=prime(n)
%o A245877   lst = []
%o A245877   for i in str(s):
%o A245877     lst.append(int(i))
%o A245877   if isprime(s+max(lst)) and isprime(s-max(lst)):
%o A245877     print(s,end=', ')
%o A245877 # _Derek Orr_, Aug 13 2014
%Y A245877 Cf. A006489, A245742, A245743, A245744, A245745, A245878.
%K A245877 nonn,base
%O A245877 1,1
%A A245877 _Colin Barker_, Aug 05 2014