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

A105992 Near-repunit primes.

Original entry on oeis.org

101, 113, 131, 151, 181, 191, 211, 311, 811, 911, 1117, 1151, 1171, 1181, 1511, 1811, 2111, 4111, 8111, 10111, 11113, 11117, 11119, 11131, 11161, 11171, 11311, 11411, 16111, 101111, 111119, 111121, 111191, 111211, 111611, 112111, 113111, 131111, 311111, 511111
Offset: 1

Views

Author

Shyam Sunder Gupta, Apr 29 2005

Keywords

Comments

According to the prime glossary "a near-repunit prime is a prime all but one of whose digits are 1." This would also include {2, 3, 5, 7, 13, 17, 19, 31, 41, 61 and 71}, but this sequence only lists terms with more than two digits. - M. F. Hasler, Feb 10 2020

Examples

			a(2)=113 is a term because 113 is a prime and all digits are 1 except one.
		

References

  • C. Caldwell and H. Dubner, "The near repunit primes 1(n-k-1)01(1k)," J. Recreational Math., 27 (1995) 35-41.
  • Heleen, J. P., "More near-repunit primes 1(n-k-1)D(1)1(k), D=2,3, ..., 9," J. Recreational Math., 29:3 (1998) 190-195.

Crossrefs

Programs

  • Mathematica
    lst = {}; Do[r = (10^n - 1)/9; Do[AppendTo[lst, DeleteCases[Select[FromDigits[Permutations[Append[IntegerDigits[r], d]]], PrimeQ], r]], {d, 0, 9}], {n, 2, 14}]; Sort[Flatten[lst]] (* Arkadiusz Wesolowski, Sep 20 2011 *)

A065074 Near-repunit primes that contain the digit 0.

Original entry on oeis.org

101, 10111, 101111, 11110111, 11111101, 101111111, 101111111111, 111011111111, 111111011111, 111111110111, 111111111101, 11111111101111111, 11111111111111101, 101111111111111111, 111110111111111111, 111111101111111111, 111111111111011111, 111111111111111011
Offset: 1

Views

Author

Robert G. Wilson v, Nov 19 2001

Keywords

Crossrefs

Programs

  • Maple
    N:= 20: # to get all terms of up to N digits
    A:= select(isprime,[seq(seq((10^n-1)/9 - 10^j,j=n-2..1,-1),n=3..N)]); # Robert Israel, Jun 23 2015
  • Mathematica
    f[n_] := Block[{lst = {}, r = (10^(n - 1) - 1)/9}, AppendTo[ lst, Select[ FromDigits[ Permutations[ Append[ IntegerDigits@ r, 0]]], PrimeQ@# && # > 100 &]]; Union@ Flatten@ lst]; Array[f, 18] // Flatten (* Robert G. Wilson v, Jun 22 2015 *)

Extensions

Name changed by Arkadiusz Wesolowski, Sep 23 2011

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

A034093 Number of near-repunit primes that can be formed from (10^k - 1)/9 by changing just one digit from 1 to 0.

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 0, 2, 1, 0, 0, 5, 0, 0, 0, 0, 2, 5, 0, 4, 0, 0, 0, 3, 0, 1, 0, 0, 1, 2, 0, 4, 1, 0, 1, 2, 0, 2, 1, 0, 0, 7, 0, 4, 0, 0, 0, 2, 0, 2, 1, 0, 1, 3, 0, 1, 0, 0, 0, 0, 0, 3, 0, 0, 0, 4, 0, 2, 0, 0, 0, 3, 0, 1, 0, 0, 1, 3, 0, 1, 0, 0, 1, 3, 0, 3, 0, 0, 1, 1, 0, 1, 0, 0, 0, 2, 0, 3, 0, 0
Offset: 1

Views

Author

Keywords

Examples

			a(12) = 5 because from (10^12 - 1)/9 = 111111111111, by changing just one digit from 1 to 0, out of the eleven candidates, 111111111101, 111111110111, 111111011111, 111011111111 and 101111111111 are primes.
		

References

  • C. K. Caldwell and H. Dubner, The near repunits primes, J. Rec. Math., Vol. 27(1), 1995, pp. 35-41.

Crossrefs

Programs

  • Mathematica
    a = {}; Do[ p = IntegerDigits[ (10^n - 1)/9 ]; c = 0; Do[ If[ q = FromDigits[ ReplacePart[p, 0, i]]; PrimeQ[q], c++ ], {i, 2, n} ]; a = Append[a, c], {n, 1, 100} ]; a (* Robert G. Wilson v, Nov 19 2001 *)
  • PARI
    a(n)=sum(i=1,n-2,ispseudoprime(10^n\9-10^i)) \\ Charles R Greathouse IV, May 01 2012
    
  • Python
    from sympy import isprime
    def a(n):
        Rn = (10**n-1)//9
        return sum(1 for i in range(n-1) if isprime(Rn-10**i))
    print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Nov 04 2023

Extensions

More terms from Robert G. Wilson v, Nov 19 2001
Edited by N. J. A. Sloane, Oct 02 2008 at the suggestion of R. J. Mathar

A367081 The least k such that exactly n binary near-repunit primes can be formed from 2^k-1 by changing one digit from 1 to 0.

Original entry on oeis.org

1, 3, 4, 6, 8, 12, 38, 24, 18, 36, 48, 20, 248, 588, 144, 252, 5520, 168, 7200, 2400, 2850
Offset: 0

Views

Author

Robert Price, Nov 06 2023

Keywords

Comments

Similar to A065083 but using binary repdigits instead of base 10.
Note that as in A065083, the most significant digit/bit is not replaced with a zero in determining a prime.
a(21) > 7800.
a(25) = 11520 and a(n) > 12000 for n in 21..24 and n > 25 using A272143. - Michael S. Branicky, Nov 09 2023

Examples

			a(3)=6 because 2^6 - 1 = 111111_2 and
                      1) 111101_2 = 61,
                      2) 111011_2 = 59,
                      3) 101111_2 = 47,
and no other k < 6 yields exactly three primes.
		

Crossrefs

Programs

  • PARI
    a(n) = my(k=1); while(sum(i=1, k-2, ispseudoprime(2^k-1-2^i)) != n, k++); k \\ Thomas Scheuerle, Nov 07 2023
    
  • Python
    from itertools import count
    from sympy import isprime
    def A367081(n):
        for k in count(1):
            a, c = (1<= n+1:
                    break
            if c == n:
                return k # Chai Wah Wu, Nov 11 2023
Showing 1-5 of 5 results.