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-10 of 10 results.

A069688 Primes that yield another prime on placing a 3 on both sides (as leading and trailing digits).

Original entry on oeis.org

5, 7, 31, 37, 41, 43, 53, 59, 61, 67, 73, 79, 83, 101, 103, 139, 151, 157, 179, 197, 223, 241, 257, 263, 269, 271, 283, 293, 307, 311, 349, 353, 389, 421, 431, 461, 467, 491, 557, 593, 599, 601, 607, 631, 643, 647, 683, 691, 701, 727, 757, 769, 811, 827, 839
Offset: 1

Views

Author

Amarnath Murthy, Apr 06 2002

Keywords

Examples

			139 is a member as 31393 is also a prime.
		

Crossrefs

Programs

  • Mathematica
    Select[ Range[1000], PrimeQ[ # ] && PrimeQ[ FromDigits[ Insert[ IntegerDigits[ # ], 3, {{1}, {-1}}]]] &]
    Select[Prime[Range[200]],PrimeQ[FromDigits[Join[{3},IntegerDigits[#],{3}]]]&] (* Harvey P. Dale, Oct 24 2011 *)

Extensions

Edited and extended by Robert G. Wilson v, May 03 2002

A069689 Primes that yield another prime on placing a 7 on both sides (as leading and trailing digits).

Original entry on oeis.org

2, 5, 17, 23, 29, 41, 47, 53, 71, 131, 191, 227, 233, 257, 281, 293, 347, 359, 389, 401, 419, 431, 479, 503, 521, 557, 593, 599, 653, 659, 677, 683, 701, 761, 797, 827, 857, 887, 953, 977, 1091, 1097, 1109, 1151, 1181, 1187, 1193, 1223, 1283, 1307, 1373
Offset: 1

Views

Author

Amarnath Murthy, Apr 06 2002

Keywords

Examples

			233 is a member as 72337 is also a prime.
		

Crossrefs

Programs

  • Mathematica
    Select[ Range[2000], PrimeQ[ # ] && PrimeQ[ FromDigits[ Insert[ IntegerDigits[ # ], 7, {{1}, {-1}}]]] &]
    Select[Prime[Range[250]],PrimeQ[FromDigits[Join[{7}, IntegerDigits[ #],{7}]]]&]  (* Harvey P. Dale, Nov 01 2011 *)

Extensions

Edited and extended by Robert G. Wilson v, May 03 2002

A069690 Primes that yield another prime on placing a 9 on both sides (as leading and trailing digits).

Original entry on oeis.org

2, 19, 23, 31, 41, 43, 47, 53, 61, 67, 71, 73, 83, 101, 107, 109, 113, 149, 163, 193, 211, 239, 241, 263, 269, 277, 313, 317, 331, 347, 373, 397, 409, 421, 439, 443, 499, 521, 523, 541, 547, 607, 617, 619, 641, 647, 673, 677, 757, 787, 829, 863, 877, 907, 911
Offset: 1

Views

Author

Amarnath Murthy, Apr 06 2002

Keywords

Examples

			241 belongs to this sequence as 92419 is also a prime.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) isprime(9+10*n+9*10^(2+ilog10(n))) end proc:
    select(filter, [seq(ithprime(i),i=1..1000)]); # Robert Israel, Feb 02 2021
  • Mathematica
    Select[ Range[2000], PrimeQ[ # ] && PrimeQ[ FromDigits[ Insert[ IntegerDigits[ # ], 9, {{1}, {-1}}]]] &]
    Select[Prime[Range[200]],PrimeQ[FromDigits[Join[{9},IntegerDigits[#],{9}]]]&] (* Harvey P. Dale, Nov 07 2022 *)
  • Python
    from sympy import isprime, primerange
    def ok(p): return isprime(int('9'+str(p)+'9'))
    def aupto(lim): return [p for p in primerange(2, lim+1) if ok(p)]
    print(aupto(911)) # Michael S. Branicky, Feb 19 2021

Extensions

Edited and extended by Robert G. Wilson v, May 03 2002

A059694 Primes p such that 1p1, 3p3, 7p7 and 9p9 are all primes.

Original entry on oeis.org

53, 2477, 4547, 5009, 7499, 8831, 9839, 11027, 24821, 26393, 29921, 36833, 46073, 46769, 47711, 49307, 53069, 59621, 64283, 66041, 79901, 84017, 93263, 115679, 133103, 151121, 169523, 197651, 207017, 236807, 239231, 255191, 259949, 265271, 270071, 300431, 330047
Offset: 1

Views

Author

Patrick De Geest, Feb 07 2001

Keywords

Comments

All terms == 1 (mod 6). The sequence is apparently infinite. There are 16486 terms up to 10^9. - Zak Seidov, Jan 17 2014
Intersection of A069687, A069688, A069689, and A069690. - Zak Seidov, Jan 17 2014

Examples

			53 is a term because 1531, 3533, 7537 and 9539 are primes.
		

Crossrefs

Programs

  • Python
    from sympy import isprime, nextprime
    from itertools import islice
    def agen(): # generator of terms
        p = 2
        while True:
            sp = str(p)
            if all(isprime(int(d+sp+d)) for d in "1379"):
                yield p
            p = nextprime(p)
    print(list(islice(agen(), 40))) # Michael S. Branicky, Feb 23 2023

A306861 The concatenation kpk is the number obtained by placing k leading and trailing 1's around the prime p; a(n) is the smallest k such that kpk is prime, where p = prime(n), or -1 if no such k exists.

Original entry on oeis.org

-1, 1, 1, 3, -1, 3, 1, 21, 1, 1, 2, -1, 3, 2, 1, 1, 42, 14, 3, 73, 3, 2, 1, 4, 3, -1, 2, 1, 3, 1, 3, 1, 3, 3, 1, 6, 2, 3, 192, 1, 4, 3, 3, 8, 1, 9, 36, 5, 12, 5, 18, 1, 26, 1, 16, 10, 15, 2, 72, 22, 3, 4, 2, 4, 5, 1, 12, 5, 13, 3, 9, 1, 6, 60, 2, 1, 58
Offset: 1

Views

Author

David James Sycamore, Mar 14 2019

Keywords

Comments

For p = 2,11,37,101 kpk is composite for all k, hence a(n) = -1.
For p = 397 (n=78), 563, 739, 1249, ... no k (<= 12000) has yet been found such that kpk is prime, but also there is no proof yet that k does not exist.
If p = prime(n) is an odd repunit prime, a(n) is half the difference in repunit length between p and the next repunit prime.
Conjecture: There are infinitely many -1 terms in this sequence.
This is a subsequence of A272232. - Hans Havermann, May 17 2022

Examples

			a(1) = -1 because k2k is divisible by the (k+1)-th repunit for all k. The same argument applies to a(26) (p=101). a(2)=1 since 131 is prime, a(3)=1 since 151 is prime, a(4)=3 since 1117111 is prime. a(5)=-1 because k11k is always divisible by 11.
a(12) = -1 because the factor cycle for k37k comprises a covering congruence as follows: k==1 (mod 3)-->3|k37k; k==2 (mod 3)--> 13|k37k; k==3 (mod 3)--> 37|p37p.
For a(78) (p=397) no k (up to 30000) has been found such that kpk is prime.
		

Crossrefs

Programs

  • Maple
    Wrapped_prime := proc (p::prime, N::posint := 5000) local n, k, m0, m; n := length(p); for k to N do m0 := add(10^i, i = 0 .. k-1); m := m0+10^k*p+10^(k+n)*m0; if isprime(m) then return k end if end do end proc
    Wrapped_prime(p). #Enter a value for p in this line and the code will calculate the first k for which kpk is prime (up to a max value of N, which can be chosen arbitrarily).

A270237 Primes which are the decimal concatenation of 1, a prime, and 1.

Original entry on oeis.org

131, 151, 1171, 1231, 1291, 1471, 1531, 1831, 11071, 11131, 11311, 11491, 11731, 11971, 12391, 12511, 13171, 13591, 13831, 14011, 14431, 15031, 15091, 15991, 16411, 16831, 17011, 17191, 17431, 17971, 18211, 19471, 19531, 110311, 110491, 111031, 111091, 111871
Offset: 1

Views

Author

Emre APARI, Mar 13 2016

Keywords

Comments

No padding 0's are allowed: 1021 is not a member even though 02 is prime.
These are the primes that result from A069687.
Subsequence of A208259.

Examples

			1171 is a prime which is the concatenation of 1, 17 and 1.
		

Crossrefs

Programs

  • Mathematica
    Select[Map[FromDigits@ Flatten@ {1, IntegerDigits@ Prime@ #, 1} &, Range@ 200], PrimeQ] (* Michael De Vlieger, Mar 15 2016 *)
    Select[FromDigits[Flatten[IntegerDigits/@Join[{1},#,{1}]]]&/@Prime[ Range[ 200]], PrimeQ] (* Harvey P. Dale, Jul 26 2016 *)
  • PARI
    lista(nn) = forprime(p=2, nn, if(isprime(P=eval(Str(1, p, 1))), print1(P, ", "))); \\ Altug Alkan, Mar 13 2016
    
  • PARI
    is(n)=my(d=digits(n)); isprime(n) && d[1]==1 && #d>2 && d[2] && d[#d]==1 && isprime(fromdigits(d[2..#d-1])) \\ Charles R Greathouse IV, Mar 15 2016

A341017 Primes p such that placing digit i at both ends of p produces another prime for at least two of i = [1,3,7, 9].

Original entry on oeis.org

2, 5, 17, 23, 29, 31, 41, 43, 47, 53, 61, 67, 71, 73, 83, 101, 107, 113, 131, 149, 197, 239, 241, 257, 263, 269, 293, 317, 347, 359, 389, 401, 421, 431, 443, 503, 521, 557, 593, 599, 607, 641, 647, 677, 683, 701, 757, 797, 827, 887, 911, 953, 1031, 1103, 1109, 1117, 1171, 1181, 1187, 1223, 1277
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Feb 02 2021

Keywords

Comments

Numbers that are in at least two of A069687, A069688, A069689 and A069690.

Examples

			a(3) = 17 is a term because 17 is in A069687 and A069689, i.e. 1171 and 7177 are prime.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local i; isprime(n) and numboccur(true,[seq(isprime(i+10*n+i*10^(2+ilog10(n))),i=[1,3,7,9])]) >= 2 end proc:
    select(filter, [2,seq(i,i=3..1000)]);
  • Python
    from sympy import isprime, nextprime
    def ok(p): return sum(isprime(int(c+str(p)+c)) for c in "1379") >= 2
    def aupto(limit): # only test primes
      alst, p = [], 2
      while p <= limit:
        if ok(p): alst.append(p)
        p = nextprime(p)
      return alst
    print(aupto(1277)) #Michael S. Branicky, Feb 02 2021

A360781 Primes p such that at least one number remains prime when p is bracketed by a single digit d; that is, at least one instance of d//p//d is prime where // means concatenation.

Original entry on oeis.org

2, 3, 5, 7, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 101, 103, 107, 109, 113, 131, 139, 149, 151, 157, 163, 173, 179, 191, 193, 197, 211, 223, 227, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331
Offset: 1

Views

Author

Harvey P. Dale, Feb 20 2023

Keywords

Comments

The bracketing digit d must be 1, 3, 7, or 9.

Examples

			263 is included because 263 is a prime and 32633 (and also 92639) is a prime.
		

Crossrefs

Programs

  • Maple
    q:= p-> ormap(isprime, map(d-> parse(cat(d, p, d)), [1, 3, 7, 9])):
    select(q, [ithprime(i)$i=1..67])[];  # Alois P. Heinz, Feb 22 2023
  • Mathematica
    brkQ[p_]:=AnyTrue[Table[FromDigits[Join[{d},IntegerDigits[p],{d}]],{d,{1,3,7,9}}],PrimeQ]; Select[Prime[Range[100]],brkQ]
  • PARI
    is(p) = my(d=digits(p)); forstep(k=1, 9, 2, if (isprime(fromdigits(concat(k, concat(d,k)))), return(1)));
    isok(p) = if (isprime(p), is(p)); \\ Michel Marcus, Feb 20 2023
  • Python
    from sympy import isprime, nextprime
    from itertools import islice
    def agen(): # generator of terms
        p = 2
        while True:
            sp = str(p)
            if any(isprime(int(d+sp+d)) for d in "1379"):
                yield p
            p = nextprime(p)
    print(list(islice(agen(), 57))) # Michael S. Branicky, Feb 20 2023
    

Formula

Union of A069687, A069688, A069689, A069690. - Alois P. Heinz, Feb 22 2023

A105226 Smallest prime p such that the number represented by the decimal string 1p1 is a product of n distinct primes.

Original entry on oeis.org

2, 3, 11, 13, 157, 8209, 31231, 1608697, 112328569, 10247900863, 21926946241, 1256492087941, 101017938127207, 10019534732186179, 103820246231814111793, 6892441533761699205127, 125403143123000002762783, 1008021783580817338005763
Offset: 0

Views

Author

Lekraj Beedassy, Apr 14 2005

Keywords

Examples

			a(1) = 3 because 131 is prime.
a(2) = 11 since 1111 = 11*101.
a(3) = 13 because 1131 = 3*13*29.
a(4) = 157 since 11571 = 3*7*19*29.
a(5) = 8209 since 182091 = 3*7*13*23*29.
a(6) = 31231 since 1312311 = 3*7*11*13*19*23.
		

Crossrefs

Cf. A069687.

Programs

  • Mathematica
    pf[n_] := Flatten[ Table[ #[[1]], {#[[2]]}] & /@ FactorInteger[n]]; t = Table[0, {9}]; Do[ a = pf[ FromDigits[ Join[{1}, IntegerDigits[ Prime[n]], {1}]]]; If[a == Union[a], l = Length[a]; If[ t[[l]] == 0, t[[l]] = Prime[n]]], {n, 10^7}] (* also for n>2 I used *) (* Robert G. Wilson v, Apr 16 2005 *)
    (* first do *) Needs["DiscreteMath`Combinatorica`"] (* then *) Table[ FromDigits[ Take[ IntegerDigits[ Select[ Sort[ Times @@@ KSubsets[ Drop[ Prime[ Range[25]], {1, 3, 2}], n]], Take[ RotateRight[ IntegerDigits[ # ]], 2] == {1, 1} && IntegerDigits[ # ][[2]] != 0 && PrimeQ[ FromDigits[ Drop[ RotateRight[ IntegerDigits[ # ]], 2]]] &][[1]]], {2, -2}]], {n, 3, 20}]

Extensions

Extended by Robert G. Wilson v, Apr 16 2005

A307873 The concatenation pkp is the number obtained by placing prime p either side of R_k, the k-th repunit (1, k times); a(n) is the smallest k such that pkp is prime, where p=prime(n), or -1 if no such k exists.

Original entry on oeis.org

-1, 1, -1, 10905, 15, 2, 1, 2, 3, 1, 3, 173, 1, 14, 1, 43, 1, 5, 11, 1, 2, 3, 3, 1, 2, -1, 5, 421, 3, 1, -1, 1, 1, 3, -1, 15, -1, 3, 3, 163, -1, 3, 13, -1, 679, -1, 5, 5, -1, 107, 93, 1, -1, 3, -1, 1, -1, 9, 5, -1, -1, 9, 1089, -1, 3, 7, 3, 15, -1, 27, -1, 1, -1, 27, 17, 25, 1, 15, 3
Offset: 1

Views

Author

David James Sycamore, May 02 2019

Keywords

Comments

Primes (from above data) for which pkp is composite for all k are 2, 5, 101, 127, 149, 157, 179, 193, 199, 227, 241, 257, 269, 281, 283, 311, 347, 353, 367. In every case the factorization of pkp contains at least one characteristic prime divisor (very different from A306861).
Conjecture: There are an infinite number of -1 terms in this sequence.

Examples

			2/2k2, 5/5k5, 7/101k101, 11,13/127k127, 11/149k149, for all k, so a(1)=a(3)=a(26)= a(31)=a(35)=-1. For prime(n)=A004023(2)=R_19, a(n)=R_(317-2*19)=R_279.
		

Crossrefs

Programs

  • Maple
    P(p) := proc (p::prime, N::posint := 5000) local n, k, m0, m; n := length(p); for k from 1 to N do m0 := add(10^i, i = 0 .. k-1); m := p*10^(k+n)+m0*10^n+p; if isprime(m) then return k end if; if `mod`(k, 1000) = 0 then print(k) end if end do end proc; P(p) # substitute a prime p here to run the code, it produces an answer (k) if one exists <=N and terms must be computed one at a time.

Formula

If prime(n) is a repunit prime R_k, for some k in A004023 and R_t is the smallest repunit prime such that t > 2*k, then a(n)=R_(t-2*k).
Showing 1-10 of 10 results.