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.

Showing 1-5 of 5 results.

A245742 Primes p such that p + d is also prime, where d is the largest digit of p.

Original entry on oeis.org

43, 61, 263, 461, 563, 601, 613, 641, 653, 683, 821, 1063, 1283, 1361, 1423, 1481, 1601, 1613, 1621, 1663, 1823, 1871, 2063, 2081, 2111, 2381, 2843, 3061, 3163, 3343, 3461, 3463, 3631, 3881, 4003, 4561, 4583, 4643, 4651, 5563, 5641, 5651, 5653, 5783, 5813
Offset: 1

Views

Author

Colin Barker, Jul 31 2014

Keywords

Comments

The least significant digit of a(n) is either 1 or 3. - Colin Barker, Aug 03 2014
The largest digit of a(n) is 2, 4, 6 or 8. - Colin Barker, Aug 04 2014

Examples

			263 is in the sequence because 263 + 6 = 269, which is prime.
		

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(7000) | IsPrime(p+d) where d is Max(Intseq(p))]; // Bruno Berselli, Jul 31 2014
  • Maple
    select(p -> isprime(p) and isprime(p + max(convert(p,base,10))), [$1..1000]); # Robert Israel, Aug 03 2014
  • PARI
    select(p->isprime(p+vecsort(digits(p),,4)[1]), primes(2000))
    

A245743 Primes p such that p - d is also prime, where d is the largest digit of p.

Original entry on oeis.org

41, 163, 181, 263, 401, 443, 463, 487, 563, 613, 653, 1021, 1381, 1433, 1613, 1663, 1831, 2141, 2243, 2281, 2441, 2663, 2851, 2887, 3041, 3463, 3613, 3623, 3643, 4133, 4363, 4463, 4603, 4643, 4663, 4801, 5281, 5563, 5581, 5653, 5821, 5851, 5857, 6043, 6053
Offset: 1

Views

Author

Colin Barker, Jul 31 2014

Keywords

Comments

The least significant digit of a(n) is either 1, 3 or 7. - Colin Barker, Aug 03 2014
The largest digit of a(n) is 2, 4, 6 or 8. - Robert Israel, Aug 03 2014

Examples

			263 is in the sequence because 263 - 6 = 257, which is prime.
		

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(7000) | IsPrime(p-d) where d is Max(Intseq(p))]; // Bruno Berselli, Jul 31 2014
  • Maple
    filter:= n -> isprime(n) and isprime(n - max(convert(n,base,10))):
    select(filter, [$1..10^5]); # Robert Israel, Aug 03 2014
  • PARI
    select(p->isprime(p-vecsort(digits(p),,4)[1]), primes(2000))
    

A245744 Primes p such that p + d is also prime, where d is the smallest nonzero digit of p.

Original entry on oeis.org

29, 67, 89, 227, 239, 269, 457, 487, 499, 607, 677, 827, 2027, 2087, 2237, 2267, 2309, 2339, 2549, 2657, 2687, 2729, 2789, 2969, 2999, 3257, 3299, 3329, 3527, 3929, 4229, 4259, 4447, 4789, 4969, 4999, 5279, 5479, 5647, 6067, 6269, 6299, 6469, 6547, 6827
Offset: 1

Views

Author

Colin Barker, Jul 31 2014

Keywords

Comments

The least significant digit of a(n) is either 7 or 9. - Colin Barker, Aug 03 2014
The smallest nonzero digit of a(n) is 2, 4, 6 or 8. - Colin Barker, Aug 04 2014

Examples

			607 is in the sequence because 607 + 6 = 613, which is prime.
		

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(7000) | IsPrime(p+d) where d is [i: i in Set(Intseq(p)) | not IsZero(i)][1]]; // Bruno Berselli, Jul 31 2014
  • PARI
    select(p->v=vecsort(digits(p),,8); isprime(p+v[1+!v[1]]), primes(2000))
    

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

Original entry on oeis.org

263, 563, 613, 653, 1613, 1663, 3463, 4643, 5563, 5653, 6263, 6323, 12653, 13463, 14633, 16063, 16223, 21163, 21563, 25463, 26113, 30643, 32063, 33623, 36313, 41263, 41603, 44263, 53623, 54623, 56003, 60133, 61553, 62213, 62633, 64013, 65413, 105613, 106213
Offset: 1

Views

Author

Colin Barker, Aug 05 2014

Keywords

Comments

Intersection of A245742 and A245743.
The largest digit of a(n) is 6, and the least significant digit of a(n) is 3.
Intersection of A006489, A011536, and complements of A011537, A011538, A011539. - Robert Israel, Aug 05 2014

Examples

			The prime 263 is in the sequence because 263 - 6 = 257 and 263 + 6 = 269 are both primes.
		

Crossrefs

Programs

  • Mathematica
    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 *)
  • PARI
    select(p->d=vecsort(digits(p),,4)[1]; isprime(p-d) && isprime(p+d), primes(20000))
    
  • Python
    import sympy
    from sympy import prime
    from sympy import isprime
    for n in range(1,10**5):
      s=prime(n)
      lst = []
      for i in str(s):
        lst.append(int(i))
      if isprime(s+max(lst)) and isprime(s-max(lst)):
        print(s,end=', ')
    # Derek Orr, Aug 13 2014

A245878 Primes p such that p - d and p + d are also primes, where d is the smallest nonzero digit of p.

Original entry on oeis.org

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
Offset: 1

Views

Author

Colin Barker, Aug 05 2014

Keywords

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.

Examples

			The prime 607 is in the sequence because 607 - 6 = 601 and 607 + 6 = 613 are both primes.
		

Crossrefs

Programs

  • Maple
    f:= proc(x) local L,i,y;
       L:= subs(1=6,2=7,3=8,4=9, convert(x,base,5));
       if not member(6,L) then return NULL fi;
       y:= add(L[i]*10^(i-1),i=1..nops(L));
       if isprime(y) and isprime(y-6) and isprime(y+6) then y else NULL fi
    end proc:
    map(f, [seq(2+5*k,k=1..10000)]); # Robert Israel, Nov 25 2024
  • 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 *)
  • 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
    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
Showing 1-5 of 5 results.