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.

Previous Showing 31-40 of 41 results. Next

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
    

A036951 Smallest n-digit prime containing only the digits 8 and 9, or 0 if no such prime exists.

Original entry on oeis.org

0, 89, 0, 8999, 89899, 888989, 8888989, 88888999, 888898889, 8888888989, 88888888999, 888888898999, 8888888999899, 88888888888889, 888888888898999, 8888888888989999, 88888888888888889, 888888888888898889
Offset: 1

Views

Author

Patrick De Geest, Jan 04 1999

Keywords

Crossrefs

Programs

  • Mathematica
    Table[SelectFirst[10#+9&/@FromDigits/@Tuples[{8,9},n-1],PrimeQ],{n,20}]/. (Missing["NotFound"]->0) (* Harvey P. Dale, Feb 01 2018 *)

A111488 Primes having only {0, 1, 3, 6} as digits.

Original entry on oeis.org

3, 11, 13, 31, 61, 101, 103, 113, 131, 163, 311, 313, 331, 601, 613, 631, 661, 1013, 1031, 1033, 1061, 1063, 1103, 1163, 1301, 1303, 1361, 1601, 1613, 1663, 3001, 3011, 3061, 3163, 3301, 3313, 3331, 3361, 3613, 3631, 6011, 6101, 6113, 6131, 6133, 6163
Offset: 1

Views

Author

Jonathan Vos Post, Nov 15 2005

Keywords

Comments

Includes all repunit primes (A004022). Conjecture: an infinite sequence. Note twin primes: (11, 13), (101, 103), (311, 313), (1031, 1033), (1061, 1063), (1301, 1303), (6131, 6133), (10301, 10303), (10331, 10333), (13001, 13003).
In other words, primes with digits in the set {0,1,3,6}. - M. F. Hasler, Jul 25 2015
The number of 1's in the representation must be either 1 or 2 (mod 3), because otherwise the number would be divisible by 3 (and therefore composite). The only exception is the 3 itself. This excludes basically members of A038603. - R. J. Mathar, Jul 25 2015

Crossrefs

Programs

  • Maple
    f:= proc(x) local L,p;
      L:= subs([3=6,2=3],convert(x,base,4));
      p:= add(L[i]*10^(i-1),i=1..nops(L));
      if isprime(p) then p fi
    end proc:
    map(f, [$1..4^4]); # Robert Israel, Dec 18 2018
  • Mathematica
    Select[Prime@ Range@ 1000, SubsetQ[{0, 1, 3, 6}, IntegerDigits@ #] &] (* Michael De Vlieger, Jul 25 2015 *)
  • PARI
    A111488={(n, show=0, L=[0,1,3,6])->my(t); for(d=1,1e9,u=vector(d, i, 10^(d-i))~; forvec(v=vector(d,i,[1+(i==1&&!L[1]), #L]), ispseudoprime(t=vector(d, i, L[v[i]])*u)||next; show&print1(t", "); n--||return(t)))} \\ M. F. Hasler, Jul 25 2015

Extensions

Corrected by Ray Chandler, Nov 19 2005
Name changed by Sean A. Irvine, Jul 21 2025

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

A263431 Near-repdigit primes with only digits 9 and a single 8 in decimal expansion.

Original entry on oeis.org

89, 8999, 98999, 99989, 989999, 9899999, 89999999, 99899999, 99998999, 99999989, 998999999, 98999999999, 99989999999, 999998999999, 999999999899, 999999999989, 99899999999999, 99999899999999, 99999999899999, 999999899999999, 999999999989999, 999999999999989
Offset: 1

Views

Author

Felix Fröhlich, Oct 18 2015

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Flatten[Table[FromDigits/@Permutations[PadRight[{8},n,9]],{n,15}]],PrimeQ] (* Harvey P. Dale, Mar 29 2020 *)
  • PARI
    a002283(n) = 10^n-1
    a011557(n) = 10^n
    num(n, k) = a002283(n)-a011557(k)
    terms(n) = i=0; x=1; while(x > 0, y=x-1; while(y >= 0, if(ispseudoprime(num(x, y)), print1(num(x, y), ", "); i++); if(i==n, break({2})); y--); x++)
    terms(30) \\ print initial thirty terms

A154523 Numbers k such that the smallest decimal digit of k equals the smallest decimal digit of prime(k).

Original entry on oeis.org

11, 13, 18, 31, 41, 52, 62, 73, 80, 81, 110, 112, 113, 114, 115, 116, 121, 125, 128, 133, 135, 140, 141, 142, 152, 156, 157, 164, 167, 170, 180, 187, 188, 189, 191, 192, 193, 194, 195, 196, 198, 199, 211, 215, 216, 217, 218, 219, 221, 231, 241, 251, 261, 271
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jan 11 2009

Keywords

Comments

Natural density 1, since almost all numbers and almost all primes (thanks to the prime number theorem) contain the digit 0.
The first terms with smallest digit 1, 2, and 3 are listed in the Data section. The first with smallest digits 4, 5, and 6 are 644, 758, and 6666, respectively. While there are plenty of primes with no decimal digit smaller than 7 (see A106110), including many primes consisting only of the digits 8 and 9 (the 10th of which is prime(77777) = 989999; cf. A020472), it seems to me that finding a term in this sequence whose smallest digit is 7 or 8 should be a very difficult problem. - Jon E. Schoenfield, Feb 11 2019

Examples

			11 is a term because prime(11) =  31 (smallest digits: 1);
13 is a term because prime(13) =  41 (smallest digits: 1);
18 is a term because prime(18) =  61 (smallest digits: 1);
31 is a term because prime(31) = 127 (smallest digits: 1);
41 is a term because prime(41) = 179 (smallest digits: 1);
52 is a term because prime(52) = 239 (smallest digits: 2).
		

Crossrefs

Programs

  • Maple
    A054054 := proc(n) min(op(convert(n,base,10)) ) ; end proc:
    for n from 1 to 500 do if A054054(n) = A054054(ithprime(n)) then printf("%d,",n ) ; end if; end do: (End) # R. J. Mathar, May 05 2010
  • Mathematica
    Transpose[Select[Table[{n,Prime[n]},{n,300}],Min[IntegerDigits[#[[1]]]] == Min[IntegerDigits[#[[2]]]]&]][[1]] (* Harvey P. Dale, Dec 18 2012 *)

Extensions

Corrected (221 inserted) by R. J. Mathar, May 05 2010
Definition clarified by Harvey P. Dale, Dec 18 2012

A174844 Primes that generate three other primes when 2, 6, and 8, respectively, are subtracted from each digit of their decimal representations.

Original entry on oeis.org

9898898899, 889898999999, 889989889889, 898888889989, 989899998889, 999988988989, 988898889999899, 989998888989889, 98888888989989899, 99999998998988999, 888898989989989999, 888998889889898899, 889888889998888999, 889888898999988989, 889988888998998889
Offset: 1

Views

Author

Rick L. Shepherd, Mar 30 2010

Keywords

Comments

Subsequence of A020472. The primes generated from the subtractions are in A020469, A020458, and A020449, respectively. Final digits are necessarily 9 (here), then 7, 3, and 1. Because leading 8's are permitted in the terms here, the primes generated by subtracting 8's may have fewer digits than the others.

Examples

			9898898899 is prime and so are 7676676677, 3232232233, and 1010010011, so it is a term. Although 9349, 9349-2222=7127, 9349-6666=2683, and 9349-8888=461 are four primes, 9349 is not a term as subtracting 6 or 8 from the digits 3 and 4 is not possible (no "borrowing" is permitted).
		

Crossrefs

Programs

  • Maple
    Res:= NULL: count:= 0:
    for d from 2 while count < 100 do
      v:= (10^d-1)/9;
      for m from 1 to d do
        if m mod 3 <> 0 and 2*d+m mod 3 <> 0 then
          for S in combinat:-choose([$1..(d-2)],m-1) do
            q:= 1+add(10^i,i=S);
            if andmap(isprime, [q, 2*v+q, 6*v+q, 8*v+q]) then
               count:= count+1; Res:= Res, 8*v+q;
            fi
          od;
        fi
      od;
    od:
    sort([Res]); # Robert Israel, Nov 14 2022
  • Mathematica
    okQ[n_]:=Module[{idn=IntegerDigits[n]},And@@PrimeQ[FromDigits/@ {idn-2, idn-6, idn-8}]]; Select[Flatten[Table[Select[FromDigits/@ Tuples[ {8,9},n], PrimeQ],{n,18}]],okQ] (* Harvey P. Dale, Jul 27 2011 *)
  • PARI
    {/* Program based on that of M. F. Hasler in A020472. */
    for(nd=1, 20, p=vector(nd, i, 10^(nd-i))~; r=(10^nd-1)/9;
    forvec(v=vector(nd, i, [8+(i==nd), 9]), q=v*p; isprime(q) &&
    isprime(q-2*r ) && isprime(q-6*r ) && isprime(q-8*r ) && print1(q", ")))}
    
  • Python
    from sympy import isprime
    from itertools import count, islice, product
    def agen(): # generator of terms
        for d in count(2):
            subs = list(map(int, ["2"*d, "6"*d, "8"*d]))
            for first in product("89", repeat=d-1):
                t = int("".join(first) + "9")
                if isprime(t) and all(isprime(t-s) for s in subs): yield t
    print(list(islice(agen(), 15))) # Michael S. Branicky, Nov 15 2022

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
    
Previous Showing 31-40 of 41 results. Next