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 89 results. Next

A111383 Beginning with 3, least member of A007500 such that concatenation of first n terms and its digit reversal both are primes.

Original entry on oeis.org

3, 7, 3, 3, 79, 701, 157, 1103, 11959, 1901, 10273, 92753, 17047, 11909, 144973, 327251, 99289, 92831, 90373, 309671, 1149619, 745397, 1232083, 94793, 18481, 76607, 186649, 181421, 1657561, 3746111, 7067239, 324143, 3185263, 9457181, 1703413, 3517583, 72481, 12859481
Offset: 1

Views

Author

Hans Havermann, Nov 08 2005

Keywords

Crossrefs

Programs

  • Python
    from gmpy2 import digits, is_prime, mpz
    from itertools import count, islice, product
    def bgen(): # generator of terms of A007500 -{2, 5} as strings
        yield from "37"
        p = 11
        for digits in count(2):
            for first in "1379":
                for mid in product("0123456789", repeat=digits-2):
                    for last in "1379":
                        s = first + "".join(mid) + last
                        if is_prime(mpz(s)) and is_prime(mpz(s[::-1])):
                            yield s
    def agen(): # generator of terms
        s, r, an, san = "", "", 3, "3"
        while True:
            yield int(an)
            s, r = s+san, san[::-1]+r
            for san in bgen():
                if is_prime(mpz(s+san)) and is_prime(mpz(san[::-1]+r)):
                    break
            an = mpz(san)
    print(list(islice(agen(), 34))) # Michael S. Branicky, Jan 02 2025

Extensions

a(35) and beyond from Michael S. Branicky, Jan 02 2025

A167517 Emirps (A007500) which are concatenation of three consecutive primes (A030469).

Original entry on oeis.org

353359367, 193319491951, 334733593361, 344934573461, 346734693491, 732173317333, 902990419043, 104591046310477, 133091331313327, 141591417314177, 146571466914683, 150131501715031, 154431545115461
Offset: 1

Views

Author

Jonathan vos Post and M. F. Hasler, Nov 10 2009

Keywords

Comments

A subsequence of A007500, A030469, A132903.

Programs

  • PARI
    for(i=1,9999, isprime(eval(p=Str(prime(i),prime(i+1),prime(i+2)))) & isprime(eval(concat(vecextract(Vec(p),"-1..1"))))& print1(p,", "))

Formula

A167517 = A007500 n A030469 = A007500 n A132903 (where "n" means intersection).

A122490 Least number k>1 such that k+10^n is a symmetric prime with symmetric digits (i.e. such that k+10^n is in A007500).

Original entry on oeis.org

3, 7, 9, 7, 49, 33, 169, 7, 7, 207, 237, 91, 313, 261, 273, 79, 49, 2901, 51, 441, 193, 9, 531, 289, 1141, 67, 909, 331, 753, 2613, 657, 49, 4459, 603, 1531, 849, 2049, 259, 649, 2119, 1483, 63, 6747, 519, 3133, 937, 1159, 1999, 6921, 2949, 613, 4137, 1977, 31, 483, 883, 8553, 12117, 1009, 4347, 733
Offset: 1

Views

Author

Pierre CAMI, Sep 16 2006

Keywords

Examples

			3+10^1=13, 13 and 31 are symmetric primes with symmetric digits;
7+10^2=107, 107 and 701 are symmetric primes with symmetric digits;
9+10^3=1009, 1009 and 9001 are symmetric primes with symmetric digits.
		

Crossrefs

Programs

  • Maple
    revdigs:= proc(n) local L,i;
      L:= convert(n,base,10);
      add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    f:= proc(n) local k,m;
       for k from 3 by 2 do
         m:= k+10^n;
         if isprime(m) and isprime(revdigs(m)) then return k fi
       od
    end proc:
    map(f, [$1..100]); # Robert Israel, Nov 09 2017

Extensions

Definition clarified, a(28) corrected, and more terms added by Robert Israel, Nov 09 2017

A199302 Palindromic primes in the sense of A007500 with digits '0', '1' and '2' only.

Original entry on oeis.org

2, 11, 101, 1021, 1201, 110221, 111211, 112111, 120121, 121021, 122011, 1000211, 1010201, 1020101, 1022011, 1022201, 1101211, 1102111, 1102201, 1111021, 1112011, 1120001, 1120121, 1120211, 1121011, 1201021, 1201111, 1210211, 1212121, 1221221, 10002121
Offset: 1

Views

Author

M. F. Hasler, Nov 04 2011

Keywords

Comments

All terms except for the initial 2 start and end in the digit 1.

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(10^8) | Set(Intseq(p)) subset [0..2] and IsPrime(Seqint(Reverse(Intseq(p))))];  // Bruno Berselli, Nov 07 2011
    
  • PARI
    allow=Vec("012");forprime(p=1,default(primelimit),setminus( Set( Vec(Str( p ))),allow)&next;isprime(A004086(p))&print1(p",")) /* better use the much more efficient code below */
    
  • PARI
    a(n=50,list=0,L=[0,1,2],needpal=1)={ for(d=1,1e9, u=vector(d,i,10^(d-i))~; forvec(v=vector(d,i,[1+(i==1&!L[1]),#L]), isprime(t=vector(d,i,L[v[i]])*u) || next; needpal & !isprime(A004086(t)) & next; list & print1(t","); n-- || return(t)))}  \\ M. F. Hasler, Nov 06 2011
    
  • Python
    from itertools import count, islice, product
    from sympy import isprime
    def A199302_gen(): return (n for n in (int(t+''.join(s)) for l in count(0) for t in '12' for s in product('012',repeat=l)) if isprime(n) and isprime(int(str(n)[::-1])))
    A199302_list = list(islice(A199302_gen(),20)) # Chai Wah Wu, Jan 04 2022

A199306 Palindromic primes in the sense of A007500 with digits '0', '1' and '6' only.

Original entry on oeis.org

11, 101, 1061, 1601, 10061, 10601, 11161, 16001, 16061, 16111, 16661, 101611, 106661, 116101, 166601, 1011601, 1016011, 1016611, 1061101, 1066111, 1106101, 1110611, 1111661, 1116601, 1160111, 1160611, 1166101, 1600061, 1611161, 1616161, 1660661, 1661111, 10011101, 10100161, 10106111
Offset: 1

Views

Author

M. F. Hasler, Nov 06 2011

Keywords

Comments

All terms start and end with the digit '1'. This fact is used in the given PARI program.

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(10^8) | Set(Intseq(p)) subset [0,1,6] and IsPrime(Seqint(Reverse(Intseq(p))))]; // Bruno Berselli, Nov 07 2011
  • PARI
    a(n=50,list=0,L=[0,1,6])={ for(d=1,1e9, my(t,u=vector(d-1,i,10^(d-i))~,o=10^d+1);forvec(v=vector(#u,i,[1,#L]),isprime(t=o+vector(#u,i,L[v[i]])*u) || next; isprime(A004086(t)) || next; list & print1(t", "); n-- || return(t)))}  \\ M. F. Hasler, Nov 07 2011
    

A199303 Palindromic primes in the sense of A007500 with digits '0', '1' and '3' only.

Original entry on oeis.org

3, 11, 13, 31, 101, 113, 131, 311, 313, 1031, 1033, 1103, 1301, 3011, 3301, 10301, 10333, 11003, 11311, 13331, 30011, 30103, 31013, 31033, 33013, 33301, 101333, 110311, 113011, 113131, 131311, 133033, 133103, 301331, 301333, 330331, 333101, 333103, 1000033, 1001003, 1001303, 1003001
Offset: 1

Views

Author

M. F. Hasler, Nov 04 2011

Keywords

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(10^8) | Set(Intseq(p)) subset [0, 1, 3] and IsPrime(Seqint(Reverse(Intseq(p))))]; // Bruno Berselli, Nov 07 2011
    
  • Mathematica
    Flatten[{#,IntegerReverse[#]}&/@Select[FromDigits/@Tuples[{0,1,3},7],AllTrue[ {#,IntegerReverse[ #]},PrimeQ]&]]//Union (* Harvey P. Dale, Sep 12 2023 *)
  • PARI
    allow=Vec("013"); forprime(p=1, default(primelimit), setminus( Set( Vec( Str( p ))), allow)&next; isprime(A004086(p))&print1(p", ")) /* for illustrative purpose only: better use the code below */
    
  • PARI
    a(n=50,list=0,L=[0,1,3],needpal=1)={ for(d=1,1e9, u=vector(d,i,10^(d-i))~; forvec(v=vector(d,i,[1+(i==1&!L[1]),#L]), isprime(t=vector(d,i,L[v[i]])*u) || next; needpal & !isprime(A004086(t)) & next; list & print1(t","); n-- || return(t)))}  \\ M. F. Hasler, Nov 06 2011
    
  • Python
    from itertools import product
    from sympy import isprime
    A199303_list = [n for n in (int(''.join(s)) for s in product('013',repeat=12)) if isprime(n) and isprime(int(str(n)[::-1]))] # Chai Wah Wu, Dec 17 2015

A199328 Palindromic primes in the sense of A007500 with digits '0', '1' and '8' only.

Original entry on oeis.org

11, 101, 181, 1181, 1811, 18181, 108881, 110881, 118081, 180181, 180811, 181081, 188011, 188801, 1008001, 1088081, 1110881, 1180811, 1181881, 1808801, 1880111, 1880881, 1881811, 1881881, 10001081, 10001801, 10011101, 10080011, 10101181, 10111001, 10111081, 10180801, 10188811, 10808101, 10810001
Offset: 1

Views

Author

M. F. Hasler, Nov 05 2011

Keywords

Crossrefs

Intersection of A007500 and A061247.

Programs

  • Mathematica
    Select[10#+1&/@FromDigits/@Tuples[{0,1,8},7],AllTrue[{#,IntegerReverse[#]},PrimeQ]&] (* Harvey P. Dale, Mar 28 2025 *)
  • PARI
    a(n=50,L=[0,1,8],show=0)={my(t);for(d=1,1e9,u=vector(d,i,10^(d-i))~;forvec(v=vector(d,i,[1+(i==1&!L[1]),#L]),isprime(t=vector(d,i,L[v[i]])*u)||next;isprime(A004086(t))||next;show&print1(t",");n--||return(t)))}
    
  • Python
    from itertools import product
    from sympy import isprime
    A199328_list = [n for n in (int(''.join(s)) for s in product('018',repeat=10)) if isprime(n) and isprime(int(str(n)[::-1]))] # Chai Wah Wu, Dec 17 2015

A167518 Least reversible prime (A007500) which is a concatenation of n consecutive primes.

Original entry on oeis.org

2, 151157, 353359367, 139149151157, 101103107109113, 704517045770459704817048770489, 97101103107109113127, 1519315199152171522715233152411525915263, 382138233833384738513853386338773881, 9319932393379341934393499371937793919397
Offset: 1

Views

Author

M. F. Hasler, Nov 10 2009

Keywords

Comments

Here the weaker definition of A007500 is used, but all terms > 2 known so far are also Emirps in the sense of A006567 (i.e. different from their reversal), so it is sufficient to change the first term to 13 in order to have a sequence of "true" emirps.
Is it possible to prove that all terms > 2 are in A006567?

Crossrefs

Programs

  • PARI
    for(k=1,19,for(i=0,1e9, isprime( eval( p=concat( vector( k,j,Str( prime( i+j )))))) & isprime(eval(concat(vecextract(Vec(p),"-1..1")))) & break); print1(p,", "))

Extensions

Edited by Charles R Greathouse IV, Apr 28 2010
a(9)-a(10) from Donovan Johnson, Sep 25 2011

A199304 Palindromic primes in the sense of A007500 with digits '0', '1' and '4' only.

Original entry on oeis.org

11, 101, 11411, 100411, 101141, 114001, 114041, 140411, 141101, 1004141, 1010411, 1040141, 1041041, 1100441, 1114111, 1140101, 1144441, 1401401, 1410401, 1411141, 1414001, 1440011, 1444411, 1444441, 10010411, 10011101, 10041011, 10044011
Offset: 1

Views

Author

M. F. Hasler, Nov 04 2011

Keywords

Comments

All terms start and end with the digit 1.

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(10^8) | Set(Intseq(p)) subset [0,1,4] and IsPrime(Seqint(Reverse(Intseq(p))))];  // Bruno Berselli, Nov 07 2011
  • Maple
    F:= proc(d) local A0, A4, Res, q, r;
       Res:= NULL;
       q:= (10^(d+1)-1)/9;
       for A0 in combinat:-powerset({$1..d-1}) do
         for A4 in combinat:-powerset({$1..d-1} minus A0) do
           r:= q - add(10^i,i=A0) + 3*add(10^i,i=A4);
           if isprime(r) and isprime(q - add(10^(d-i),i=A0) + 3*add(10^(d-i),i=A4)) then
              Res:= Res, r
           fi
       od od;
       Res
    end proc:
    sort([seq(F(d),d=1..7)]); # Robert Israel, May 03 2018
  • PARI
    allow=Vec("014");forprime(p=1,default(primelimit),setminus( Set( Vec(Str( p ))),allow)&next;isprime(A004086(p))&print1(p",")) /* better use the more efficient code below */
    
  • PARI
    a(n=50,list=0,L=[0,1,4],needpal=1)={ for(d=1,1e9, u=vector(d,i,10^(d-i))~; forvec(v=vector(d,i,[1+(i==1&!L[1]),#L]), isprime(t=vector(d,i,L[v[i]])*u) || next; needpal & !isprime(A004086(t)) & next; list & print1(t","); n-- || return(t)))}  \\ M. F. Hasler, Nov 06 2011
    

A135436 a(n) is the least prime for which the n-th term of the sequence S(a(n)) belongs to A007500, where each term of S(p) is the least prime >= the reversal of the previous term.

Original entry on oeis.org

2, 19, 83, 223, 277, 499, 1327, 1747, 2857, 11351, 10831, 11801, 12239, 12211, 18127, 21787, 36709, 30763, 16703
Offset: 1

Views

Author

Philippe LALLOUET (philip.lallouet(AT)orange.fr), Feb 18 2008

Keywords

Comments

After a term of A007500 has appeared in S(p), either this number, if it's truly palindromic, or the pair constituted by it and its reversal, is repeated indefinitely.
For all primes <= 189989, a term of A007500 appears always in S(p) but I could not go further as in the sequence S(p) of the next prime appears a term > 10^6 which is beyond my capacities of calculation. Anyway it's not a surprise and very probably all sequences S(p) reach a stability in a finite limit. What is more surprising is that on the one hand the same term of A007500 appears in sequence S(n) for a(13) and a(14) and on the other hand another same term of A007500 appears in these sequences for a(16), a(17), a(18) and a(19).

Examples

			The sequence S(223) is 223, 331, 137, 733 = A007500(38) and that is wrong for any prime lower than 223. Hence a(4)= 223.
		

Crossrefs

Cf. A007500.
Showing 1-10 of 89 results. Next