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

A258915 The number of n-digit near-repdigit primes (A164937).

Original entry on oeis.org

0, 0, 46, 43, 40, 53, 35, 49, 40, 38, 44, 52, 35, 45, 49, 42, 38, 57, 27, 45, 38, 47, 37, 52, 33, 45, 56, 38, 36, 65, 29, 56, 48, 40, 38, 58, 37, 33, 57, 40, 37, 61, 41, 39, 37, 44, 36, 55, 47, 43, 47, 43, 35, 62, 43, 46, 29, 35, 37, 56, 39, 41, 46, 48, 39, 74, 45, 34, 34, 35, 34, 67
Offset: 1

Views

Author

Robert G. Wilson v, Jun 14 2015

Keywords

Comments

The average is 44.25 with a standard deviation of about 9.48 for the first 1000 terms.
First occurrence of 20 < k < 80: 1132, ??22??, 1304, 433, 141, 181, 19, 118, 31, 253, 357, 137, 25, 68, 7, 29, 23, 10, 44, 5, 43, 16, 4, 11, 14, 3, 22, 33, 8, 139, 82, 12, 6, 102, 48, 27, 18, 36, 270, 198, 42, 54, 498, 90, 30, 738, 72, 222, 192, 852, 84, 342, ??73??, 66, ??75??, 816, 264, ??78??, 298; where ??xx?? denotes an unknown value for the index xx.
Roughly speaking, the probability that a random n-digit number is prime is about 1/(n*log(10)). The number of near-repdigit n-digit numbers is 81*n. Therefore it would be reasonable to expect around 81/log(10) (about 35) primes for each n. - Giovanni Resta, Jun 19 2015

Examples

			a(1) & a(2) = 0 by definition.
a(3) = 46 since there are 46 terms of 3 digits, see A164937(1) - A164937(46).
		

Crossrefs

Cf. A164937.
Essentially the same as A385280 but excluding near-repunit primes of A004022.

Programs

  • Mathematica
    f[n_] := Block[{lst = {}, r = (10^(n - 1) - 1)/9}, Do[ AppendTo[ lst, DeleteCases[ Select[ FromDigits[ Permutations[ Append[ IntegerDigits[ a*r], d]]], PrimeQ@# && # > 100 &], r]], {a, 9}, {d, 0, 9}]; Length@ Union@ Flatten@ lst](* adapted after Arkadiusz Wesolowski of A164937 *) Array[f, 70]
    (* to view the terms assign the terms in the b-file to "lst" and then *) ListPlot@ Sort@ lst (* and/or *) g[n_] := Count[lst, n]; DiscretePlot[ g[n], {n, 23, 80}]
  • Python
    from gmpy2 import is_prime, digits
    def a(n):
        if n < 3: return 0
        Rn = (10**n-1)//9
        return len(set(t for d in range(1, 10) for i in range(n if d in {1, 3, 7, 9} else 1) for c in set(range(-d, 10-d))-{0} if len(digits(t:=d*Rn+c*10**i))==n and is_prime(t)))
    print([a(n) for n in range(1, 73)]) # Michael S. Branicky, Jun 28 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

A210666 Numbers with at least three digits in which all digits but one are the same.

Original entry on oeis.org

100, 101, 110, 112, 113, 114, 115, 116, 117, 118, 119, 121, 122, 131, 133, 141, 144, 151, 155, 161, 166, 171, 177, 181, 188, 191, 199, 200, 202, 211, 212, 220, 221, 223, 224, 225, 226, 227, 228, 229, 232, 233, 242, 244, 252, 255, 262, 266, 272, 277, 282, 288
Offset: 1

Views

Author

Arkadiusz Wesolowski, May 08 2012

Keywords

Comments

Each k-digit term has k-1 appearances of a digit, d1, and 1 appearance of a different digit, d2, and k-1 >= 2 so that d1 is repeated. Specifically, the 2-digit terms of A010784 are not terms here. - Michael S. Branicky, May 22 2022
a(n) = A031955(n+81) for n <= 244.
For n <= 243, i.e., the 3-digit terms, a(n) = A218556(n+10). - M. F. Hasler, Nov 02 2012

Crossrefs

Subsequence of A031955. Supersequence of A164937.

Programs

  • Mathematica
    lst = {}; Do[If[SortBy[Tally[IntegerDigits[n]], Last][[-1, -1]] == IntegerLength[n] - 1, AppendTo[lst, n]], {n, 100, 288}]; lst
    lst = {}; Do[r = Table[a, {n}]; Do[c = FromDigits@Permutations[Join[{d}, r]]; If[d == 0, c = Rest[c]]; AppendTo[lst, c], {d, 0, 9}], {a, 0, 9}, {n, 2, 2}]; Drop[Union@Flatten[lst], 19]
    nrepQ[n_] := Module[{dg = Select[DigitCount[n], # > 0 &]}, Length[dg] == 2 && Min[dg] == 1 && Max[dg] > 1]; Select[Range[300], nrepQ] (* Harvey P. Dale, Nov 20 2012 *)
  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        for d in count(3):
            dterms = set()
            for most in "123456789":
                dterms.add(int(most + "0"*(d-1)))
                for diff in "0123456789":
                    if most == diff: continue
                    cands = (most*i + diff + most*(d-1-i) for i in range(d))
                    dterms.update(int(t) for t in cands if t[0] != "0")
            yield from sorted(dterms)
    print(list(islice(agen(), 52))) # Michael S. Branicky, May 17 2022

A182051 Primes with a majority of one digit.

Original entry on oeis.org

2, 3, 5, 7, 11, 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
Offset: 1

Views

Author

Arkadiusz Wesolowski, Apr 08 2012

Keywords

Comments

a(n+5) = A164937(n) for n <= 89.

Examples

			1151 is prime and the number of ones is greater than the number of all other digits, so this number is in the sequence.
		

Crossrefs

Supersequence of A164937 and of A164968.

Programs

  • Mathematica
    lst = {}; Do[i = IntegerDigits[n]; If[PrimeQ[n] && Count[i, First[Commonest@i]] > IntegerLength[n]/2, AppendTo[lst, n]], {n, 10^4}]; lst

A173594 Near-repdigit emirps.

Original entry on oeis.org

113, 199, 311, 337, 733, 991, 1151, 1181, 1511, 1811, 3343, 3373, 3433, 3733, 7177, 7577, 7717, 7757, 11161, 16111, 77797, 79777, 98999, 99989, 111119, 111211, 112111, 323333, 333323, 333337, 333433, 334333, 733333, 777787, 777877, 778777, 787777, 911111
Offset: 1

Views

Author

Lekraj Beedassy, Feb 22 2010

Keywords

Comments

Entries of A164937 that are emirps (A006567), i.e., A164937 INTERSECTION A006567.

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[26,75000]],!PalindromeQ[#]&&PrimeQ[IntegerReverse[ #]] && Count[ DigitCount[#],0]==8&&MemberQ[DigitCount[#],1]&] (* Harvey P. Dale, Sep 17 2021 *)

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

A187867 Near-repdigit primes that are also deletable primes.

Original entry on oeis.org

113, 131, 223, 229, 233, 311, 313, 331, 337, 353, 373, 383, 433, 443, 599, 677, 733, 773, 797, 883, 929, 977, 997, 2333, 3331, 3313, 3373, 3433, 3533, 3733, 3833, 7333, 9929, 23333, 33331, 33533, 38333, 99929, 323333, 333331, 333533, 3233333, 3333313, 3333331, 32333333, 33333133, 33333331, 333331333, 333333313
Offset: 1

Views

Author

Arkadiusz Wesolowski, Mar 14 2011

Keywords

Comments

Intersection of A080608 and A164937.

Crossrefs

Showing 1-7 of 7 results.