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

A004023 Indices of prime repunits: numbers k such that 11...111 (with k 1's) = (10^k - 1)/9 is prime.

Original entry on oeis.org

2, 19, 23, 317, 1031, 49081, 86453, 109297, 270343, 5794777, 8177207
Offset: 1

Views

Author

Keywords

Comments

People who search for repunit primes or repdigit primes may be looking for this entry.
The indices of primes with digital product (i.e., product of digits) equal to 1.
As of August 2014, only the first five repunits, through (10^1031-1)/9, have been proved prime. The next four repunits are known only to be probable primes and have not been proved to be prime. - Robert Baillie, Aug 17 2014
These indices p must also be prime. If p is not prime, say p = m*n, then 10^(m*n) - 1 = ((10^m)^n) - 1 => 10^m - 1 divides 10^(m*n) - 1. Since 9 divides 10^m - 1 or (10^m - 1)/9 = q, it follows q divides (10^p - 1)/9. This is a result of the identity, a^n - b^n = (a - b)(a^(n-1) + a^(n-2)*b + ... + b^(n-1)). - Cino Hilliard, Dec 23 2008
The numbers R_n = 11...111 = (10^n - 1)/9 with n in this sequence A004023, except for n = 2, are prime repunits in base ten, so they are prime Brazilian numbers belonging to A085104. [See Links: Les nombres brésiliens.] - Bernard Schott, Dec 24 2012
Search limit is 10800000, currently. - Serge Batalov, Jul 01 2021
On March 22 2022 the probable prime R49081 was proved to be a prime, and on May 15 2023 the probable prime R86453 was proved to be a prime. - Bassam Abdul-Baki, Dec 17 2024

Examples

			2 appears because the 2-digit repunit 11 is prime.
3 does not appear because 111 = 3 * 37 is not prime.
19 appears because the 19-digit repunit 1111111111111111111 is prime.
		

References

  • J. Brillhart et al., Factorizations of b^n +- 1. Contemporary Mathematics, Vol. 22, Amer. Math. Soc., Providence, RI, 2nd edition, 1985; and later supplements.
  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 19, pp 6, Ellipses, Paris 2008.
  • R. K. Guy, Unsolved Problems in Number Theory, Section A3.
  • Graham, Knuth and Patashnik, Concrete Mathematics, Addison-Wesley, 1994; see p 146 problem 22.
  • Clifford A. Pickover, A Passion for Mathematics, Wiley, 2005; see p. 60.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 235.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See entry 142857 at pp. 197-198.

Crossrefs

See A004022 for the actual primes.

Programs

  • Magma
    [p: p in PrimesUpTo(500) | IsPrime((10^p - 1) div 9)]; // Vincenzo Librandi, Nov 06 2014
    
  • Mathematica
    Select[Range[271000], PrimeQ[FromDigits[PadRight[{}, #, 1]]] &] (* Harvey P. Dale, Nov 05 2011 *)
    repUnsUpTo[k_] := ParallelMap[If[PrimeQ[#] && PrimeQ[(10^# - 1)/9], #, Nothing] &, Range[k]]; repUnsUpTo[5000] (* Mikk Heidemaa, Apr 24 2017 *)
  • PARI
    forprime(x=2,20000,if(ispseudoprime((10^x-1)/9),print1(x","))) \\ Cino Hilliard, Dec 23 2008
    
  • Python
    from sympy import isprime; {print(n, end = ', ') for n in range(1, 10**7) if isprime(n) and isprime(10**n//9)} # (Note that sympy.isprime is only a pseudo-primality test.) - Ya-Ping Lu, Dec 20 2021, edited by M. F. Hasler, Mar 28 2022

Extensions

a(6) = 49081 PRP found by Harvey Dubner - posting to Number Theory List (NMBRTHRY(AT)LISTSERV.NODAK.EDU) Sep 09, 1999; proved prime by Paul Underwood, Mar 21 2022.
a(7) = 86453 found using pfgw (a faster version of PrimeForm) on Oct 26 2000 by Lew Baxter (posting to Number Theory List), Oct 26, 2000; proved prime by Andreas Enge, May 16 2023.
a(8) = 109297 was apparently discovered independently by (in alphabetical order) Paul Bourdelais and Harvey Dubner around Mar 26-28 2007.
a(9) = 270343, was found Jul 11 2007 by Maksym Voznyy and Anton Budnyy, subsequently confirmed as a(9) (see Repunit Primes Project link) by Robert Price, Dec 14 2010
a(10) = 5794777 was found Apr 20 2021 by Ryan Propper and Serge Batalov
a(11) = 8177207 was found May 08 2021 by Ryan Propper and Serge Batalov

A266142 Number of n-digit primes in which n-1 of the digits are 3's.

Original entry on oeis.org

4, 8, 9, 12, 7, 14, 13, 11, 8, 7, 9, 8, 3, 10, 11, 14, 9, 12, 6, 11, 11, 11, 9, 10, 9, 10, 22, 10, 10, 12, 7, 14, 14, 15, 7, 16, 11, 7, 14, 10, 13, 13, 8, 10, 11, 12, 6, 12, 10, 10, 10, 11, 5, 14, 8, 8, 5, 14, 6, 18, 13, 9, 13, 10, 4, 14, 12, 6, 11, 13, 12, 20, 11, 9, 13, 6, 12, 22, 13, 10, 10, 12, 5, 20, 11, 10, 11, 10, 11, 12, 11, 13, 12, 18, 7, 20, 15, 6, 8, 8, 8, 15, 12, 10, 14
Offset: 1

Views

Author

Keywords

Examples

			a(2) = 8 since 13, 23, 31, 37, 43, 53, 73 and 83 are all primes.
a(3) = 9 since 233, 313, 331, 337, 353, 373, 383, 433 and 733 are all primes.
		

Crossrefs

Programs

  • Mathematica
    f3[n_] := Block[{cnt = k = 0, r = 3 (10^n - 1)/9, s = Range[0, 9] - 3}, While[k < n, cnt += Length@ Select[r + 10^k*s, PrimeQ@ # && IntegerLength@ # > k &]; k++]; cnt]; Array[f3, 105]
  • PARI
    a(n)={sum(i=0 ,n-1, sum(d=i==n-1, 9, isprime((10^n-1)/3 + (d-3)*10^i)))} \\ Andrew Howroyd, Feb 28 2018
    
  • Python
    from _future_ import division
    from sympy import isprime
    def A266142(n):
        return 4*n if (n==1 or n==2) else sum(1 for d in range(-3,7) for i in range(n) if isprime((10**n-1)//3+d*10**i)) # Chai Wah Wu, Dec 27 2015

Extensions

a(2) corrected by Chai Wah Wu, Dec 27 2015
a(2) in b-file corrected as above by Andrew Howroyd, Feb 28 2018

A055520 Numbers k such that 30*R_k + 1 is prime, where R_k = 11...1 is the repunit (A002275) of length k.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 17, 39, 49, 59, 77, 100, 150, 318, 381, 783, 1731, 1917, 8854, 11244, 11959, 12129, 18532, 22717, 23364, 24252, 24548, 25323, 30177, 53717, 380975, 424860
Offset: 1

Views

Author

Keywords

Comments

Also numbers k such that (10^(k+1)-7)/3 is prime.

References

  • Martin Gardner, Strong Laws of Small Primes, in The Last Recreations, p. 194 (1997).

Crossrefs

Cf. A055557.
Indices of A033175 that are primes. Cf. A051200, A055557.

Programs

  • Mathematica
    Do[ If[ PrimeQ[30*(10^n - 1)/9 + 1], Print[n]], {n, 0, 50410}]

Formula

a(n) = A055557(n) - 1. - Robert Price, Jan 30 2015

Extensions

a(32)-a(33) from Leonid Durman, Jan 09-10 2012

A089017 n for which the number consisting of a string of n 3's and a terminal 1 is not prime.

Original entry on oeis.org

8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 78, 79, 80, 81, 82
Offset: 1

Views

Author

Lekraj Beedassy, Nov 04 2003

Keywords

Comments

Complement of A055520(n)=A055557(n) - 1. The first n for which {10^(n+1) - 7}/3 is composite is thus n=8,corresponding to 333333331=17*19607843.

Crossrefs

Programs

  • Mathematica
    Select[Range[2,90],!PrimeQ[FromDigits[PadLeft[{1},#,3]]]&]-1 (* Harvey P. Dale, Jun 19 2012 *)
  • PARI
    is(n)=ispseudoprime((10^(n+1)-7)/3) \\ Charles R Greathouse IV, Oct 23 2013

A123568 Prime numbers of the form (10^n - 7)/3.

Original entry on oeis.org

31, 331, 3331, 33331, 333331, 3333331, 33333331, 333333333333333331, 3333333333333333333333333333333333333331, 33333333333333333333333333333333333333333333333331
Offset: 1

Views

Author

Artur Jasinski, Nov 12 2006

Keywords

Comments

The number of initial 3s is n - 1.
Note that each n from 2 to 8 gives primes, but after that the n that correspond to primes are progressively further apart. Singh (1997) gives this as an example of why mathematicians don't trust a preponderance of evidence as proof: in the 17th century, when factoring numbers with as few as eight digits wasn't as easy as it is today, the pattern suggested that all numbers of this form are prime. - Alonso del Arte, Nov 11 2012

Examples

			a(7) = 33333331 because that is the seventh number of the specified form to be prime.
333333331 is not in the sequence because it is composite, being the product of 17 and 19607843.
		

References

  • Simon Singh, Fermat's Enigma. New York: Walker & Company (1997) p. 159.

Crossrefs

Programs

  • Mathematica
    Do[If[PrimeQ[(10^n - 7)/3], Print[(10^n - 7)/3]], {n, 1, 100}] (* Jasinski *)
    Select[(10^Range[50] - 7)/3, PrimeQ[#] &] (* Alonso del Arte, Nov 11 2012 *)
    Select[Table[FromDigits[PadLeft[{1},n,3]],{n,50}],PrimeQ] (* Harvey P. Dale, Dec 05 2018 *)
  • PARI
    select(ispseudoprime, vector(20, n, (10^n-7)/3)) \\ Charles R Greathouse IV, Nov 12 2012

A098207 a(n) is the square of near-repdigit number A033175(n).

Original entry on oeis.org

1, 961, 109561, 11095561, 1110955561, 111109555561, 11111095555561, 1111110955555561, 111111109555555561, 11111111095555555561, 1111111110955555555561, 111111111109555555555561
Offset: 0

Views

Author

Labos Elemer, Oct 20 2004

Keywords

Comments

While repunit-squares are palindromic, squares of near repdigits provide other curious digit-patterns.

Crossrefs

Formula

a(n) = A033175(n)^2.
From Chai Wah Wu, Nov 09 2018: (Start)
a(n) = 111*a(n-1) - 1110*a(n-2) + 1000*a(n-3) for n > 2.
G.f.: (-4000*x^2 - 850*x - 1)/((x - 1)*(10*x - 1)*(100*x - 1)). (End)

A235710 Composite numbers k such that sum of the proper divisors of k is a power of 10.

Original entry on oeis.org

14, 124, 194, 1324, 1994, 13324, 133324, 1130324, 1333324, 13333324, 62496048, 133333324, 92782317392, 7453083061400, 657119364560000, 671701040192960, 199999999999999994, 1333333333333333324
Offset: 1

Views

Author

Farideh Firoozbakht, Mar 17 2014

Keywords

Comments

Composite numbers k such that reversal(sigma(k)-k) = 1.
If k is prime, then sum of the proper divisors of k is 10^0.
Terms include 2*(10^A089675(k)-3) and 4*(10^A055557(k)-7)/3 for all k >= 1.

Examples

			sigma(14)-14 = 1+2+7 = 10, sigma(124)-124 = 1+2+4+31+62 = 100.
		

Crossrefs

Programs

  • Mathematica
    r[n_]:=FromDigits[Reverse[IntegerDigits[n]]]; Do[If[!PrimeQ[n]&& r[DivisorSigma[1,n]-n]==1, Print[n]],{n, 200000000}]

Extensions

a(13) from Giovanni Resta, Mar 21 2014
Edited and a(14)-a(18) added by Max Alekseyev, May 24 2025

A098208 4th powers of A033175(n) near repdigit numbers.

Original entry on oeis.org

1, 923521, 12003612721, 123111473904721, 1234222258516824721, 12345333336962946024721, 123456444444807407238024721, 1234567555555591851850158024721, 12345678666666670296296279358024721
Offset: 0

Views

Author

Labos Elemer, Oct 20 2004

Keywords

Comments

Display peculiar digit patterns.

Crossrefs

Programs

  • Mathematica
    (FromDigits/@Table[Join[PadLeft[{},n,3],{1}],{n,0,20}])^4 (* Harvey P. Dale, Oct 20 2011 *)

Formula

From Chai Wah Wu, Nov 09 2018: (Start)
a(n) = 11111*a(n-1) - 11222110*a(n-2) + 1122211000*a(n-3) - 11111000000*a(n-4) + 10000000000*a(n-5) for n > 4.
G.f.: (-160000000000*x^4 - 102065000000*x^3 - 1753593000*x^2 - 912410*x - 1)/((x - 1)*(10*x - 1)*(100*x - 1)*(1000*x - 1)*(10000*x - 1)). (End)
Showing 1-8 of 8 results.