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.
%I A004022 M4816 #99 Jul 16 2025 10:04:41 %S A004022 11,1111111111111111111,11111111111111111111111 %N A004022 Primes of the form (10^k - 1)/9. Also called repunit primes or repdigit primes. %C A004022 The next term corresponds to k = 317 and is too large to include: see A004023. %C A004022 Also called repunit primes or prime repunits. %C A004022 Also, primes with digital product = 1. %C A004022 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 %C A004022 A subset of A020449, ..., A020457, A036953, ..., cf. link to OEIS index. - _M. F. Hasler_, Jul 27 2015 %C A004022 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 %D A004022 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. %D A004022 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. %D A004022 Clifford A. Pickover, A Passion for Mathematics, Wiley, 2005; see p. 60. %D A004022 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %D A004022 James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 114. %H A004022 T. D. Noe, <a href="/A004022/b004022.txt">Table of n, a(n) for n = 1..5</a> %H A004022 J. Brillhart et al., <a href="http://dx.doi.org/10.1090/conm/022">Factorizations of b^n +- 1</a>, Contemporary Mathematics, Vol. 22, Amer. Math. Soc., Providence, RI, 3rd edition, 2002. %H A004022 Ernest G. Hibbs, <a href="https://www.proquest.com/openview/4012f0286b785cd732c78eb0fc6fce80">Component Interactions of the Prime Numbers</a>, Ph. D. Thesis, Capitol Technology Univ. (2022), see p. 33. %H A004022 Dmytro S. Inosov and Emil Vlasák, <a href="https://arxiv.org/abs/2410.21427">Cryptarithmically unique terms in integer sequences</a>, arXiv:2410.21427 [math.NT], 2024. See p. 18. %H A004022 Makoto Kamada, <a href="https://stdkmd.net/nrr/repunit">Factorizations of 11...11 (Repunit)</a>. %H A004022 D. H. Lehmer, <a href="http://dx.doi.org/10.1090/S0002-9904-1929-04748-7">On the number (10^23-1)/9</a>, Bull. Amer. Math. Soc. 35 (1929), 349-350. %H A004022 James Maynard and Brady Haran, <a href="https://www.youtube.com/watch?v=eeoBCS7IEqs">Primes without a 7</a>, Numberphile video (2019) %H A004022 Andy Steward, <a href="http://www.users.globalnet.co.uk/~aads/primes.html">Prime Generalized Repunits</a> %H A004022 S. S. Wagstaff, Jr., <a href="http://www.cerias.purdue.edu/homes/ssw/cun/index.html">The Cunningham Project</a> %H A004022 <a href="/index/Pri#PrimesWithDigits">Index to entries for primes with digits in a given set</a>. %F A004022 a(n) = A002275(A004023(n)). %t A004022 lst={}; Do[If[PrimeQ[p = (10^n - 1)/9], AppendTo[lst, p]], {n, 10^2}]; lst (* _Vladimir Joseph Stephan Orlovsky_, Aug 22 2008 *) %t A004022 Select[Table[(10^n - 1) / 9, {n, 500}], PrimeQ] (* _Vincenzo Librandi_, Nov 08 2014 *) %t A004022 Select[Table[FromDigits[PadRight[{},n,1]],{n,30}],PrimeQ] (* _Harvey P. Dale_, Apr 07 2018 *) %o A004022 (PARI) forprime(x=2,20000,if(ispseudoprime((10^x-1)/9),print1((10^x-1)/9","))) \\ _Cino Hilliard_, Dec 23 2008 %o A004022 (Magma) [a: n in [0..300] | IsPrime(a) where a is (10^n - 1) div 9 ]; // _Vincenzo Librandi_, Nov 08 2014 %o A004022 (Python) %o A004022 from sympy import isprime %o A004022 from itertools import count, islice %o A004022 def agen(): # generator of terms %o A004022 yield from (t for t in (int("1"*k) for k in count(1)) if isprime(t)) %o A004022 print(list(islice(agen(), 4))) # _Michael S. Branicky_, Jun 09 2022 %Y A004022 Subsequence of A020449. %Y A004022 A116692 is another version of repunit primes or repdigit primes. - _N. J. A. Sloane_, Jan 22 2023 %Y A004022 See A004023 for the number of 1's. %Y A004022 Cf. A046413. %K A004022 nonn,nice,bref %O A004022 1,1 %A A004022 _N. J. A. Sloane_ %E A004022 Edited by _Max Alekseyev_, Nov 15 2010 %E A004022 Name expanded by _N. J. A. Sloane_, Jan 22 2023