login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A004022
Primes of the form (10^k - 1)/9. Also called repunit primes or repdigit primes.
(Formerly M4816)
117
11, 1111111111111111111, 11111111111111111111111
OFFSET
1,1
COMMENTS
The next term corresponds to k = 317 and is too large to include: see A004023.
Also called repunit primes or prime repunits.
Also, primes with digital product = 1.
The number of 1's in these repunits must also be prime. Since the number of 1's in (10^k-1)/9 is k, if k = p*m then (10^(p*m)-1) = (10^p)^m-1 => (10^p-1)/9 = q and q divides (10^k-1). This follows from the identity a^k - b^k = (a-b)*(a^(k-1) + a^(k-2)*b + ... + b^(k-1)). - Cino Hilliard, Dec 23 2008
A subset of A020449, ..., A020457, A036953, ..., cf. link to OEIS index. - M. F. Hasler, Jul 27 2015
The terms in this sequence, except 11 which is not Brazilian, are prime repunits in base ten, so they are Brazilian primes belonging to A085104 and A285017. - Bernard Schott, Apr 08 2017
REFERENCES
T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, p. 11. Graham, Knuth and Patashnik, Concrete mathematics, Addison-Wesley, 1994; see p. 146, problem 22.
M. Barsanti, R. Dvornicich, M. Forti, T. Franzoni, M. Gobbino, S. Mortola, L. Pernazza and R. Romito, Il Fibonacci N. 8 (included in Il Fibonacci, Unione Matematica Italiana, 2011), 2004, Problem 8.10.
Clifford A. Pickover, A Passion for Mathematics, Wiley, 2005; see p. 60.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
J. Brillhart et al., Factorizations of b^n +- 1, Contemporary Mathematics, Vol. 22, Amer. Math. Soc., Providence, RI, 3rd edition, 2002.
Ernest G. Hibbs, Component Interactions of the Prime Numbers, Ph. D. Thesis, Capitol Technology Univ. (2022), see p. 33.
Dmytro S. Inosov and Emil Vlasák, Cryptarithmically unique terms in integer sequences, arXiv:2410.21427 [math.NT], 2024. See p. 18.
D. H. Lehmer, On the number (10^23-1)/9, Bull. Amer. Math. Soc. 35 (1929), 349-350.
James Maynard and Brady Haran, Primes without a 7, Numberphile video (2019)
S. S. Wagstaff, Jr., The Cunningham Project
FORMULA
a(n) = A002275(A004023(n)).
MATHEMATICA
lst={}; Do[If[PrimeQ[p = (10^n - 1)/9], AppendTo[lst, p]], {n, 10^2}]; lst (* Vladimir Joseph Stephan Orlovsky, Aug 22 2008 *)
Select[Table[(10^n - 1) / 9, {n, 500}], PrimeQ] (* Vincenzo Librandi, Nov 08 2014 *)
Select[Table[FromDigits[PadRight[{}, n, 1]], {n, 30}], PrimeQ] (* Harvey P. Dale, Apr 07 2018 *)
PROG
(PARI) forprime(x=2, 20000, if(ispseudoprime((10^x-1)/9), print1((10^x-1)/9", "))) \\ Cino Hilliard, Dec 23 2008
(Magma) [a: n in [0..300] | IsPrime(a) where a is (10^n - 1) div 9 ]; // Vincenzo Librandi, Nov 08 2014
(Python)
from sympy import isprime
from itertools import count, islice
def agen(): # generator of terms
yield from (t for t in (int("1"*k) for k in count(1)) if isprime(t))
print(list(islice(agen(), 4))) # Michael S. Branicky, Jun 09 2022
CROSSREFS
A116692 is another version of repunit primes or repdigit primes. - N. J. A. Sloane, Jan 22 2023
See A004023 for the number of 1's.
Cf. A046413.
Sequence in context: A257139 A257166 A257167 * A243534 A257304 A241570
KEYWORD
nonn,nice,bref
EXTENSIONS
Edited by Max Alekseyev, Nov 15 2010
Name expanded by N. J. A. Sloane, Jan 22 2023
STATUS
approved