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

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

A331860 Numbers k such that R(k) + 10^floor(k/2-1) is prime, where R(k) = (10^k-1)/9 (repunit: A002275).

Original entry on oeis.org

6, 7, 12, 31, 58, 127, 454, 556, 558, 604, 2944, 8118, 12078, 16942, 26268, 45198
Offset: 1

Views

Author

M. F. Hasler, Jan 30 2020

Keywords

Comments

The corresponding primes are near-repunit primes, cf. A105992.
In base 10, R(k) + 10^floor(k/2-1) has ceiling(k/2) digits 1, one digit 2 and again floor(k/2-1) digits 1: for even as well as odd k, there is a digit 2 just left of the middle of the repunit of length k.
No term can be congruent to 2 (mod 3). - Chai Wah Wu, Feb 07 2020

Examples

			For n = 6,  R(6)  + 10^(3-1) = 111211 is prime.
For n = 7,  R(7)  + 10^(3-1) = 1111211 is prime.
For n = 12, R(12) + 10^(6-1) = 111111211111 is prime.
		

Crossrefs

Cf. A105992 (near-repunit primes), A002275 (repunits), A011557 (powers of 10).
Cf. A331861 (variant with floor(n/2) instead of floor(n/2-1)), A331863 (variant with - (digit 0) instead of + (digit 2)).

Programs

  • PARI
    for(n=2,999,isprime(p=10^n\9+10^(n\2-1))&&print1(n","))

Extensions

a(8)-a(14) from Giovanni Resta, Jan 31 2020
a(15)-a(16) from Michael S. Branicky, Jul 23 2024

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

A331861 Numbers n for which R(n) + 10^floor(n/2) is prime, where R(n) = (10^n-1)/9.

Original entry on oeis.org

1, 6, 10, 18, 24, 4978
Offset: 1

Views

Author

M. F. Hasler, Jan 30 2020

Keywords

Comments

The primes corresponding to the terms of the sequence are a subset of the near-repunit primes A105992.
In base 10, R(n) + 10^floor(n/2) has ceiling(n/2)-1 digits 1, one digit 2, and again floor(n/2) digits 1. For odd n, this is a palindrome, for even n the digit 2 is just left to the middle of the number.
There cannot be an odd term > 1 since the corresponding palindrome factors as R((n+1)/2)*(10^((n-1)/2) + 1).
No term can be congruent to 2 mod 3. - Chai Wah Wu, Feb 07 2020

Examples

			For n = 1, R(n) + 10^floor(n/2) = 2 is prime.
For n = 6, R(n) + 10^floor(n/2) = 112111 is prime.
For n = 10, R(n) + 10^floor(n/2) = 1111211111 is prime.
		

Crossrefs

Cf. A105992 (near-repunit primes), A002275 (repunits), A011557 (powers of 10).
Cf. A331860 (variant with floor(n/2-1) instead of floor(n/2)), A331862 (variant with - (digit 0) instead of + (digit 2)).

Programs

  • PARI
    for(n=0,9999,isprime(p=10^n\9+10^(n\2))&&print1(n","))

Extensions

a(6) from Daniel Suteu, Feb 01 2020

A331862 Numbers n for which R(n) - 10^floor(n/2) is prime, where R(n) = (10^n-1)/9.

Original entry on oeis.org

3, 26, 186, 206, 258, 3486, 12602
Offset: 1

Views

Author

M. F. Hasler, Jan 30 2020

Keywords

Comments

The corresponding primes are a subsequence of A065074: near-repunit primes that contain the digit 0.
In base 10, R(n) - 10^floor(n/2) has ceiling(n/2)-1 digits 1, one digit 0, and again floor(n/2) digits 1. For odd n, this is a palindrome, for even n the digit 0 is just left to the middle of the number.
There can't be an odd term > 3 because the corresponding palindrome factors as R((n-1)/2)*(10^((n+1)/2) + 1).
No term can be congruent to 1 mod 3. - Chai Wah Wu, Feb 07 2020

Examples

			For n = 3, R(n) - 10^floor(n/2) = 101 is prime.
For n = 26, R(n) - 10^floor(n/2) = 11111111111101111111111111 is prime.
		

Crossrefs

Cf. A002275 (repunits), A004023 (indices of prime repunits), A011557 (powers of 10), A065074 (near-repunit primes that contain the digit 0), A105992 (near-repunit primes), A138148 (Cyclops numbers with digits 0 & 1).
Cf. A331860 (variant with digit 2 instead of digit 0), A331863 (variant with floor(n/2-1) instead of floor(n/2)).

Programs

  • PARI
    for(n=0,9999,isprime(p=10^n\9-10^(n\2))&&print1(n","))

Extensions

a(6)-a(7) from Giovanni Resta, Jan 31 2020

A331864 Numbers k such that R(k) + 2*10^floor(k/2-1) is prime, where R(k) = (10^k-1)/9 (repunit: A002275).

Original entry on oeis.org

2, 3, 5, 8, 9, 39, 78, 81, 155, 249, 387, 395, 510, 711, 1173, 1751, 10245
Offset: 1

Views

Author

M. F. Hasler, Jan 30 2020

Keywords

Comments

The corresponding primes are near-repunit primes, cf. A105992.
In base 10, R(k) + 2*10^floor(k/2-1) has ceiling(k/2) digits 1, one digit 3 and again floor(k/2-1) digits 1: for even as well as odd k, there is a digit 3 just left of the middle of the repunit of length k.
No term can be equivalent to 1 (mod 3). - Chai Wah Wu, Feb 07 2020

Examples

			For k = 2, R(2) + 2*10^(1-1) = 13 is prime.
For k = 3, R(3) + 2*10^(1-1) = 113 is prime.
For k = 5, R(5) + 2*10^(2-1) = 11131 is prime.
For k = 8, R(8) + 2*10^(4-1) = 11113111 is prime.
		

Crossrefs

Cf. A105992 (near-repunit primes), A002275 (repunits), A011557 (powers of 10).
Cf. A331865 (variant with floor(n/2) instead of floor(n/2-1)), A331860, A331863 (variants with digit 2 resp. 0 instead of digit 3).

Programs

  • PARI
    for(n=2,999,isprime(p=10^n\9+2*10^(n\2-1))&&print1(n","))

Extensions

a(13)-a(16) from Daniel Suteu, Feb 01 2020
a(17) from Michael S. Branicky, Feb 03 2023

A331865 Numbers n for which R(n) + 2*10^floor(n/2) is prime, where R(n) = (10^n-1)/9.

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 8, 12, 20, 39, 74, 78, 80, 84, 104, 195, 654, 980, 2076, 5940, 19637
Offset: 1

Views

Author

M. F. Hasler, Jan 30 2020

Keywords

Comments

The corresponding primes are a subsequence of A105992: near-repunit primes.
In base 10, R(n) + 2*10^floor(n/2) has ceiling(n/2)-1 digits 1, one digit 3, and again floor(n/2) digits 1 (except for n=0). For odd n, this is a palindrome (a.k.a. wing prime, cf. A077779), for even n the digit 3 is just left to the middle of the number.
a(22) > 50000. - Michael S. Branicky, Feb 19 2025

Examples

			For n = 0, R(0) + 2*10^floor(0/2) = 2 is prime.
For n = 1, R(1) + 2*10^floor(1/2) = 3 is prime.
For n = 2, R(2) + 2*10^floor(2/2) = 31 is prime.
For n = 3, R(3) + 2*10^floor(3/2) = 131 is prime.
For n = 5, R(5) + 2*10^floor(5/2) = 11311 is prime.
For n = 6, R(6) + 2*10^floor(6/2) = 113111 is prime.
		

Crossrefs

Cf. A105992 (near-repunit primes), A002275 (repunits), A004023 (indices of prime repunits), A011557 (powers of 10).
Cf. A331860 & A331863 (variants with digit 2 resp. 0 instead of 3), A331864 (variant with floor(n/2-1) instead of floor(n/2)).
Cf. A077779 (odd terms).

Programs

  • Mathematica
    Select[Range[0, 2500], PrimeQ[(10^# - 1)/9 + 2*10^Floor[#/2]] &] (* Michael De Vlieger, Jan 31 2020 *)
  • PARI
    for(n=0,9999,isprime(p=10^n\9+2*10^(n\2))&&print1(n","))

Extensions

a(18)-a(20) from Giovanni Resta, Jan 30 2020
a(21) from Michael S. Branicky, Feb 19 2025

A331866 Numbers k for which R(k) + 3*10^floor(k/2) is prime, where R(k) = (10^k-1)/9 (repunit: A002275).

Original entry on oeis.org

0, 2, 5, 7, 8, 10, 65, 91, 208, 376, 586, 2744, 3089, 19378, 20246
Offset: 1

Views

Author

M. F. Hasler, Jan 30 2020

Keywords

Comments

The corresponding primes are a subset of the near-repunit primes A105992 (at least when they have k > 2 digits).
In base 10, R(k) + 3*10^floor(k/2) has k digits all of which are 1 except for one digit 4 (for k > 0) located in the center (for odd k) or just to the left of it (for even k): i.e., there are ceiling(k/2)-1 digits 1 to the left and floor(k/2) digits 1 to the right of the digit 4. For odd k, this is a palindrome a.k.a. wing prime, cf. A077780, the subsequence of odd terms.
a(14) = 19378 was found by Amiram Eldar, verified to be the 14th term in collaboration with the author of the sequence and factordb.com. The term a(13) = 3089 corresponds to a certified prime (Ivan Panchenko, 2011, cf. factordb.com); a(12) and a(14) are only PRP as far as we know.

Examples

			For n = 0, R(0) + 3*10^floor(0/2) = 3 is prime.
For n = 2, R(2) + 3*10^floor(2/2) = 41 is prime.
For n = 5, R(5) + 3*10^floor(5/2) = 11411 is prime.
For n = 7, R(7) + 3*10^floor(7/2) = 1114111 is prime.
For n = 8, R(8) + 3*10^floor(8/2) = 11141111 is prime.
		

Crossrefs

Cf. A105992 (near-repunit primes), A002275 (repunits), A004023 (indices of prime repunits), A011557 (powers of 10).
Cf. A331862, A331861, A331865, A331869 (variants with digit 0, 2, 3 or 5 instead of 4), A331867 (variant with floor(n/2-1) instead of floor(n/2)).
Cf. A077780 (odd terms).

Programs

  • Mathematica
    Select[Range[0, 2500], PrimeQ[(10^# - 1)/9 + 3*10^Floor[#/2]] &]
  • PARI
    for(n=0,9999,ispseudoprime(p=10^n\9+3*10^(n\2))&&print1(n","))

Extensions

a(15) from Michael S. Branicky, Sep 24 2024

A331867 Numbers n for which R(n) + 3*10^floor(n/2-1) is prime, where R(n) = (10^n-1)/9 (repunit: A002275).

Original entry on oeis.org

68, 5252, 5494, 7102
Offset: 1

Views

Author

M. F. Hasler, Jan 30 2020

Keywords

Comments

The corresponding primes are a subsequence of A105992: near-repunit primes.
In base 10, R(n) + 3*10^floor(n/2-1) has ceiling(n/2) digits 1, one digit 4, and again floor(n/2-1) digits 1. For odd and even n, the digit 4 is just to the right of the middle of the number.
For odd n = 2m + 1, f(n) = R(n) + 3*10^floor(n/2-1) is divisible by 3, 7 or 13 when m is congruent 1 or 4, 3 or 5, resp. 0 or 2 (mod 6): there can't be an odd term.
For even n = 2m, f(n) is divisible by 3 or 7 when m is congruent to 0 or 3, resp. 1 or 2 (mod 6). When m = 6k + 4, then f(n) is prime for k = 5 and 437 (and no further k <= 600), and divisible by 23 or 53 when k is congruent to 10 (mod 11) resp. 3 (mod 13). When m = 6k + 5, f(n) is prime for k = 457 and 591 and no other value up to 600, and divisible by 23, 47, 53, 97, 163, 181, 859, ... for k congruent to 5 (mod 11), 11 (mod 23), 5 (mod 13), 0 (mod 32), 13 (mod 27), 26 (mod 30), 3 (mod 13), ..., respectively.
a(5) > 7272.

Examples

			For n = 2, R(2) + 3*10^floor(2/2-1) = 14 = 2*7 is not prime.
For n = 3, R(3) + 3*10^floor(3/2-1) = 114 = 2*3*19 is not prime.
For n = 4, R(4) + 3*10^floor(4/2) = 1141 = 7*163 is not prime.
For n = 5, R(5) + 3*10^floor(5/2) = 11141 = 13*857 is not prime.
For n = 68, R(68) + 3*10^floor(68/2) = 1...1141...1 is prime, with 34 digits '1' to the left of a digit '4' and 33 digits '1' to its right.
		

Crossrefs

Cf. A105992 (near-repunit primes), A002275 (repunits), A004023 (indices of prime repunits), A011557 (powers of 10).
Cf. A331860, A331863, A331864 (variants with digit 2, 0 resp. 3 instead of 4), A331866 (variant with floor(n/2) instead of floor(n/2-1)).

Programs

  • Mathematica
    Select[Range[2, 2500], PrimeQ[(10^# - 1)/9 + 3*10^Floor[#/2 - 1]] &]  (* corrected by Amiram Eldar, Feb 10 2020 *)
  • PARI
    for(n=2,9999,isprime(p=10^n\9+3*10^(n\2-1))&&print1(n","))
Showing 1-10 of 15 results. Next