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

A365598 Near-repdigit primes with at least two 9's as the repeated digit, and ending in a distinct digit.

Original entry on oeis.org

991, 997, 99991, 9999991, 99999999999999997, 999999999999999999999999999999991, 999999999999999999999999999999999999999999991
Offset: 1

Views

Author

Robert Price, Sep 10 2023

Keywords

Comments

The usual definition of near-repdigit prime allows the distinct digit to be in any position, see A105975 for that (super) sequence.

Examples

			99991 is a term because all digits are equal to 9 except the last one.
		

Crossrefs

Programs

  • Maple
    R:= NULL: count:= 0:
    for n from 3 to 999 do
      for d in [9,3] do
        if isprime(10^n - d) then
          R:= R, 10^n-d; count:= count+1;
        fi
    od od:
    R;

Extensions

Definition corrected by M. F. Hasler, Jun 20 2025

A088281 a(1) = 11; for n > 1, palindromic primes in which a single digit is sandwiched between strings of '1's.

Original entry on oeis.org

11, 101, 131, 151, 181, 191, 11311, 11411, 1114111, 1117111, 111181111, 111191111, 1111118111111, 111111151111111, 111111181111111, 111111111161111111111, 11111111111111611111111111111, 111111111111111111131111111111111111111, 11111111111111111111111111911111111111111111111111111
Offset: 0

Views

Author

Amarnath Murthy, Sep 29 2003

Keywords

Comments

For n > 1, near-repunit palindromic primes (or, palindromic terms of A105992). - Lekraj Beedassy, Jun 05 2009

Crossrefs

Cf. A088282, A088283, A088284 (analog with string of '3's, '7's resp. '9's).
Cf. A105992 (near-repunit primes), A065074 (which contain the digit 0), A034093 (number of primes by changing one 1 to 0), A065083 (least k for which that = n).
Cf. A164937 (near-repdigit primes); with 2, ..., 9 as repeated digit: A105982, A105981, A105980, A105979, A105978, A105977, A105976, A105975.

Programs

  • Mathematica
    Join[{11},Select[Flatten[Table[FromDigits[Join[PadRight[{},n,1],{d},PadRight[{},n,1]]],{n,26},{d,Cases[Range[0,9],Except[1]]}]],PrimeQ]] (* Harvey P. Dale, Nov 04 2024 *)
  • PARI
    print1(11); for(L=1,19,for(d=0,9,d!=1 && ispseudoprime(p=10^(2*L+1)\9+(d-1)*10^L) && print1(","p))) \\ M. F. Hasler, Feb 07 2020

Extensions

More terms from David Wasserman, Aug 03 2005
Offset changed from 0 to 1 by Lekraj Beedassy, Jun 05 2009
Edited by M. F. Hasler, Feb 07 2020

A164937 Near-repdigit primes.

Original entry on oeis.org

101, 113, 131, 151, 181, 191, 199, 211, 223, 227, 229, 233, 277, 311, 313, 331, 337, 353, 373, 383, 433, 443, 449, 499, 557, 577, 599, 661, 677, 727, 733, 757, 773, 787, 797, 811, 877, 881, 883, 887, 911, 919, 929, 977, 991, 997, 1117, 1151, 1171, 1181, 1511
Offset: 1

Views

Author

G. L. Honaker, Jr., Aug 31 2009

Keywords

Crossrefs

Programs

  • Mathematica
    lst = {}; Do[If[PrimeQ[n] && SortBy[Tally[IntegerDigits[n]], Last][[-1, -1]] == IntegerLength[n] - 1, AppendTo[lst, n]], {n, 101, 10^3}]; lst (* Arkadiusz Wesolowski, Sep 18 2011 *)
    lst = {}; Do[r = (10^n - 1)/9; Do[AppendTo[lst, DeleteCases[Select[FromDigits[Permutations[Append[IntegerDigits[a*r], d]]], PrimeQ], r | 2 | 3 | 5 | 7]], {a, 9}, {d, 0, 9}], {n, 2, 6}]; Sort[Flatten[lst]] (* Arkadiusz Wesolowski, Sep 22 2011 *)
  • Python
    from sympy import isprime
    from itertools import count, islice
    def agen(): # generator of terms
        for d in count(3):
            ds = set()
            for end in "1379":
                ds.update(int(c*(d-1) + end) for c in "123456789" if c != end)
                for diff in "0123456789":
                    if end == diff: continue
                    cands = (end*i + diff + end*(d-1-i) for i in range(d-1))
                    ds.update(int(t) for t in cands if t[0] != "0")
            yield from sorted(t for t in ds if isprime(t))
    print(list(islice(agen(), 52))) # Michael S. Branicky, May 17 2022

Extensions

Three more terms from Lekraj Beedassy, Dec 06 2009

A178007 Largest n-digit prime with the most digits equal to 9.

Original entry on oeis.org

7, 97, 997, 9949, 99991, 999979, 9999991, 99999989, 999999929, 9999999929, 99999999599, 999999999989, 9999999999799, 99999999999959, 999999999999989, 9999999999999199, 99999999999999997, 999999999999999989, 9999999999999999919, 99999999999999999989, 999999999999999999899, 9999999999999999999929
Offset: 1

Views

Author

Lekraj Beedassy, May 17 2010

Keywords

Comments

First maximum the number of 9's, then choose the largest.
From Robert Israel, Dec 18 2024: (Start)
This is believed to be different from A241206, as there should be infinitely many n for which there is no n-digit prime with n-1 digits equal to 9. No examples are known; the least such n is greater than 3400. (End)

Crossrefs

Programs

  • Maple
    f:= proc(n) local i,j,a,b,x,y;
         x:= 10^n-1;
         for i from 0 to n-1 do
           for a from 1 to 9 do
             y:= x - a*10^i;
             if isprime(y) then return y fi;
         od od;
         for i from 1 to n-1 do
           for a from 1 to 9 do
             for j from 0 to i-1 do
               for b from 1 to 9 do
                 y:= x - a*10^i - b*10^j;
                 if isprime(y) then return y fi
        od od od od;
        FAIL
    end proc:
    map(f, [$1..30]); # Robert Israel, Dec 16 2024

Extensions

Corrected and more terms by Robert Israel, Dec 16 2024

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

A320256 k-digit primes with the same even digit repeated k-1 times and a single odd digit.

Original entry on oeis.org

3, 5, 7, 23, 29, 41, 43, 47, 61, 67, 83, 89, 223, 227, 229, 443, 449, 661, 881, 883, 887, 2221, 4441, 4447, 6661, 8887, 22229, 44449, 88883, 444443, 444449, 666667, 888887, 22222223, 66666667, 88888883, 222222227, 444444443, 666666667, 888888883, 888888887
Offset: 1

Views

Author

Enrique Navarrete, Oct 08 2018

Keywords

Comments

For the resulting number to be prime, the rightmost digit must be the odd one. - Michel Marcus, Oct 11 2018

Examples

			3, 5, 7 are in the sequence for k = 1.
229 is in the sequence because it is a 3-digit prime with the first 3-1 digits repeating even (2) and the last digit odd (9). - _David A. Corneth_, Oct 10 2018
		

Crossrefs

Programs

  • Mathematica
    Join[{3, 5, 7}, Select[Flatten@ Table[{1, 3, 7, 9} + 10 FromDigits@ ConstantArray[k, n], {n, 9}, {k, Range[2, 8, 2]}], PrimeQ]] (* Michael De Vlieger, Oct 31 2018 *)
  • PARI
    first(n) = {n = max(n, 3); my(t = 3, res = List([3, 5, 7])); print1("3, 5, 7, "); for(i=1, oo, k=(10^i - 1) / 9; forstep(f = 2, 8, 2, forstep(d=1, 9, 2, c = 10 * f * k + d; if(isprime(c), print1(c", "); listput(res, c); t++; if(t>=n, return(res))))))} \\ David A. Corneth, Oct 10 2018

Extensions

More terms from Michel Marcus, Oct 10 2018

A160342 Smallest near-repdigit prime with digit n occurring n times, or 0 if no such prime exists.

Original entry on oeis.org

199, 223, 2333, 44449, 555557, 0, 77767777, 888888883, 9199999999
Offset: 1

Views

Author

Lekraj Beedassy, May 10 2009

Keywords

Comments

"Near-repdigit" in the definition means that all but one of the digits of the base-10 representation are the same.

Crossrefs

Cf. A105975-A105982, A069569, A164937 (near-repdigit primes).

Extensions

Corrected by Arkadiusz Wesolowski, Sep 23 2011

A160369 Largest base 10 near-repdigit (all but one digit alike) prime with digit n repeated n times (or 0, if no such prime exists).

Original entry on oeis.org

71, 229, 7333, 44449, 555557, 0, 77777747, 888888887, 9999999929
Offset: 1

Views

Author

Lekraj Beedassy, May 11 2009

Keywords

Comments

Each a(n) must be n + 1 digits long in base 10.
The different digit must not be 0, or else the near repdigit is divisible by n.
Our search is simplified by the fact that for even n, the different digit must be at the end. Furthermore, the different digit must be 1, 3, 7 or 9 (that is, not 5). In the case of n = 6, the choice of final digit is reduced further still to 1 or 7. 6666661 is divisible by 113, while 6666667 is divisible by 7. Therefore there is no term for a(6) and a 0 is entered instead. (The equivalent sequence for smallest prime near-repdigit would have a similar void for a(6)).
For odd n, the different digit may be placed at any position, but at least in verifying n = 7 and n = 9 it helped expedite the search to focus on near-repdigits with the different digit greater than n and placed as the most significant digit or near the most significant digit. For example, with n = 7, it was not necessary to look at a number like 76777777 since it's smaller than the term to be verified, 77777747.
The equivalent sequence in binary has only one term: 2!

Examples

			Near-repdigits with three 3s are 9333, 8333, 7333, 6333, ... 3933, 3833, etc. The largest of these, 9333, is obviously divisible by 3. Not as obviously, 8333 is divisible by 13 and 641. Then we see that 7333 is prime, therefore a(3) = 7333.
		

Crossrefs

Extensions

Terms verified by Alonso del Arte, Nov 19 2009

A321363 Single-digit odd primes and primes whose decimal expansion has the form iii...ij, where i and j are distinct odd digits.

Original entry on oeis.org

3, 5, 7, 13, 17, 19, 31, 37, 53, 59, 71, 73, 79, 97, 113, 331, 337, 557, 773, 991, 997, 1117, 3331, 5557, 11113, 11117, 11119, 33331, 77773, 99991, 111119, 333331, 333337, 555557, 3333331, 9999991, 11111117, 11111119, 33333331, 55555553, 55555559, 111111113
Offset: 1

Views

Author

Enrique Navarrete, Nov 07 2018

Keywords

Crossrefs

Programs

  • Mathematica
    s={3, 5, 7}; Do[Do[Do[k=m*(10^n-1)/9*10+j; If[j!=m && PrimeQ[k], AppendTo[s, k]], {j,1,9,2}], {m,1,9,2}], {n,1,8}]; s (* Amiram Eldar, Nov 08 2018 *)
  • PARI
    lista(nn) = {print1("3, 5, 7, "); for (n=1, nn, r = (10^n-1)/9; forstep (i=1, 9, 2, forstep(j=1, 9, 2, if (i != j, if (isprime(p=fromdigits(concat(digits(r*i), j))), print1(p, ", "));););););} \\ Michel Marcus, Nov 28 2018

Extensions

a(35)-a(42) from Amiram Eldar, Nov 08 2018
Showing 1-9 of 9 results.