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

A004022 Primes of the form (10^k - 1)/9. Also called repunit primes or repdigit primes.

Original entry on oeis.org

11, 1111111111111111111, 11111111111111111111111
Offset: 1

Views

Author

Keywords

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).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 114.

Crossrefs

Subsequence of A020449.
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.

Programs

  • Magma
    [a: n in [0..300] | IsPrime(a) where a is (10^n - 1) div 9 ]; // Vincenzo Librandi, Nov 08 2014
    
  • 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 *)
  • PARI
    forprime(x=2,20000,if(ispseudoprime((10^x-1)/9),print1((10^x-1)/9","))) \\ Cino Hilliard, Dec 23 2008
    
  • 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

Formula

a(n) = A002275(A004023(n)).

Extensions

Edited by Max Alekseyev, Nov 15 2010
Name expanded by N. J. A. Sloane, Jan 22 2023

A064911 If n is semiprime (or 2-almost prime) then 1 else 0.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Patrick De Geest, Oct 13 2001

Keywords

Crossrefs

Programs

  • Haskell
    a064911 = a010051 . a032742 -- Reinhard Zumkeller, Mar 13 2011
    
  • Maple
    with(numtheory):
    a:= n-> `if`(bigomega(n)=2, 1, 0):
    seq(a(n), n=1..120);  # Alois P. Heinz, Mar 16 2011
  • Mathematica
    Table[If[PrimeOmega[n] == 2, 1, 0], {n, 105}] (* Jayanta Basu, May 25 2013 *)
  • PARI
    a(n)=bigomega(n)==2 \\ Charles R Greathouse IV, Mar 13 2011

Formula

a(n) = 1 iff n is in A001358 (semiprimes), a(n) = 0 iff n is in A100959 (non-semiprimes). - Reinhard Zumkeller, Nov 24 2004
Dirichlet g.f.: (primezeta(2s) + primezeta(s)^2)/2. - Franklin T. Adams-Watters, Jun 09 2006
a(n) = A057427(A174956(n)); a(n)*A072000(n) = A174956(n). - Reinhard Zumkeller, Apr 03 2010
a(n) = A010051(A032742(n)) (i.e., largest proper divisor is prime). - Reinhard Zumkeller, Mar 13 2011
From Antti Karttunen, Apr 24 2018 & Apr 22 2022: (Start)
a(n) = A280710(n) + A302048(n) = A101040(n) - A010051(n).
a(n) = A353478(n) + A353480(n) = A353477(n) + A353478(n) + A353479(n).
a(n) = A353475(n) + A353476(n).
(End)
a(n) = [Omega(n) = 2], where [ ] is the Iverson bracket. - Wesley Ivan Hurt, Jul 22 2025

Extensions

Edited by M. F. Hasler, Oct 18 2017

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 *)

A070529 Number of divisors of repunit 111...111 (with n digits).

Original entry on oeis.org

1, 2, 4, 4, 4, 32, 4, 16, 12, 16, 4, 128, 8, 16, 64, 64, 4, 384, 2, 128, 128, 96, 2, 1024, 32, 64, 64, 256, 32, 8192, 8, 2048, 64, 64, 128, 3072, 8, 8, 64, 2048, 16, 24576, 16, 1536, 768, 64, 4, 8192, 16, 1024, 256, 512, 16, 8192, 256, 4096
Offset: 1

Views

Author

Henry Bottomley, May 02 2002

Keywords

Examples

			a(9) = 12 since the divisors of 111111111 are 1, 3, 9, 37, 111, 333, 333667, 1001001, 3003003, 12345679, 37037037, 111111111.
		

Crossrefs

Programs

Formula

a(n) = A000005(A002275(n)).
a(n) = A070528(n)*A051064(n)/(A051064(n)+2).
a(A004023(n)) = 2. - Michel Marcus, Sep 09 2015
a(A046413(n)) = 4. - Bruno Berselli, Sep 09 2015

Extensions

Terms to a(280) in b-file from Hans Havermann, Aug 20 2011
a(281)-a(322) in b-file from Ray Chandler, Apr 22 2017
a(323)-a(352) ib b-file from Max Alekseyev, May 04 2022

A102782 Repunit semiprimes.

Original entry on oeis.org

111, 1111, 11111, 1111111, 11111111111, 11111111111111111, 11111111111111111111111111111111111111111111111, 11111111111111111111111111111111111111111111111111111111111
Offset: 1

Views

Author

Shyam Sunder Gupta, Feb 11 2005

Keywords

Examples

			a(2)=1111 because 1111=11*101, so 1111 is semiprime as well as a repunit number.
		

Crossrefs

Cf. A046413 the repunit of length n has exactly 2 prime factors.

Programs

  • Mathematica
    Select[Table[FromDigits[PadRight[{},n,1]],{n,60}],PrimeOmega[#]==2&] (* Harvey P. Dale, Aug 28 2013 *)

Formula

a(n) = A000042(A046413(n-1)). - Ray Chandler, Sep 06 2005

A064910 Smallest semiprime p*q such that q >= p and q mod p = n.

Original entry on oeis.org

4, 6, 15, 65, 77, 133, 91, 319, 209, 341, 299, 481, 493, 799, 527, 1007, 1139, 2449, 703, 3611, 989, 1541, 1643, 3589, 1537, 2407, 2747, 2759, 1829, 3811, 1891, 4633, 2993, 3959, 2627, 4033, 2701, 6157, 3239, 9073, 3569, 5461, 4183, 6439, 5141, 6533
Offset: 0

Views

Author

Patrick De Geest, Oct 13 2001

Keywords

Crossrefs

Cf. A001358 (p2 mod p1 = 0), A064899-A064909, A064911, A053409, A046413.

Programs

  • Mathematica
    nsp[n_Integer] := nsp[n] = Block[{sp = n + 1}, While[PrimeOmega[sp] != 2, sp++]; sp]; a[n_Integer] := Block[{sp = 4}, While[ fi = FactorInteger@ sp; Mod[fi[[-1, 1]], fi[[1, 1]]] != n, sp = nsp[sp]]; sp]; Array[a, 46, 0] (* Robert G. Wilson v, Aug 20 2025 *)

Extensions

Name amended by John Cerkan, Apr 12 2018

A196104 Repdigit semiprimes (semiprimes composed of identical digits).

Original entry on oeis.org

4, 6, 9, 22, 33, 55, 77, 111, 1111, 11111, 1111111, 11111111111, 11111111111111111, 2222222222222222222, 3333333333333333333, 5555555555555555555, 7777777777777777777, 22222222222222222222222, 33333333333333333333333, 55555555555555555555555
Offset: 1

Views

Author

Michel Lagneau, Oct 27 2011

Keywords

Comments

A semiprime can be repdigit (base 10) in only three ways. It can be a single-digit semiprime, a repunit semiprime (A102782), or a repunit prime times a prime digit {2, 3, 5, 7}. Occurs in proof that the sequence is infinite in which a(n) is the least semiprime > a(n-1) such that a(n) has no digit in common with a(n-1). - Jonathan Vos Post; corrected by Max Alekseyev, Sep 14 2022

Examples

			a(12) = 11111111111 = 21649 * 513239 is semiprime.
		

Crossrefs

Subsequence of A046328.
Except for initial terms, subsequence of A116063.

Programs

  • Maple
    with(numtheory):for n from 1 to 23 do:for b from 1 to 9 do:x:=(((10^n)- 1)/9)*b:if bigomega(x)=2 then printf(`%d, `,x):else fi:od:od:
  • Mathematica
    Select[FromDigits/@Flatten[Table[PadRight[{},i,n],{i,25},{n,9}],1], PrimeOmega[ #] ==2&] (* Harvey P. Dale, Mar 11 2019 *)
  • PARI
    print1("4, 6, 9");for(n=1,20,t=10^n\9;if(bigomega(t)==2,print1(", "t)); if(isprime(t),forprime(p=2,7,print1(", "p*t)))) \\ Charles R Greathouse IV, Oct 27 2011

Formula

Union of {4, 6, 9}, A102782, 2*A004022, 3*A004022, 5*A004022, and 7*A004022. - Jonathan Vos Post and R. J. Mathar, Oct 27 2011

Extensions

Edited by Max Alekseyev, Sep 14 2022

A095415 Length of repunits of which the prime factor-digit-excess computed by A095414 equals 0.

Original entry on oeis.org

2, 3, 5, 7, 9, 11, 13, 17, 19, 23, 27, 31, 47, 59, 67, 71, 83, 113, 127, 139, 163, 197, 211, 229, 251, 263, 311, 317, 347, 421, 457, 461
Offset: 1

Views

Author

Labos Elemer, Jun 22 2004

Keywords

Comments

541, 701, 857 are also terms. Conjecture: Except for the number 4, A046413 is a subsequence. Conjecture: except for the prime powers 9 and 27, all terms are prime. - Chai Wah Wu, Nov 03 2019
Sequence continues as 467?, 479?, 509?, 541, 557?, 571?, 577?, 593?, 599?, 617?, 643?, 647?, 661?, 673?, 683?, 691?, 701, 727?, 743?, 751?, 757?, 769?, 773?, 821?, 857, 863?, 887?, 911?, 967?, 971?, 977?, 991?, where ? marks uncertain/candidate terms. - Max Alekseyev, Apr 29 2022

Crossrefs

A004023 is a subsequence.

Programs

  • Mathematica
    d[1] = -1; d[n_] := Total[ IntegerLength /@ First /@ FactorInteger[(10^n - 1)/9]] - n; Select[ Range[67], d[#] == 0 &] (* Giovanni Resta, Jul 16 2018 *)

Formula

Solutions to A095414(x) = 0.

Extensions

Data corrected and extended by Giovanni Resta, Jul 16 2018
a(29)-a(32) confirmed by Max Alekseyev, Apr 29 2022

A250288 Numbers n such that the duodecimal repunit (12^n - 1)/11 is a semiprime.

Original entry on oeis.org

7, 13, 17, 37, 47, 73, 101, 131, 151, 167, 197, 241, 263
Offset: 1

Views

Author

Eric Chen, Dec 18 2014

Keywords

Comments

First unknown term is 311.
If (12^n - 1)/11 is a semiprime, n must be prime or the square of a prime (A001248), but no n = prime squared is known which yields a semiprime value of (12^n - 1)/11. (Specifically, n must be the square of a prime in A004064, and must be at least 491401 = 701^2.)
No other known terms below 1000; the only other possible terms below 1000 are 449, 521, 571, 577, 613, 709, 751, 757, 769, 787, 853, 859, 887, 929, and 991.

Examples

			a(1) = 7 so 1111111 = 46E * 2X3E (written in base 12).
		

Crossrefs

Programs

  • Mathematica
    Select[Range[120], PrimeOmega[(12^# - 1)/11] == 2 &] (* Alonso del Arte, Dec 18 2014 *)

A118694 Semiprimes which are divisible by the product of their digits.

Original entry on oeis.org

4, 6, 9, 15, 111, 115, 1111, 1115, 11111, 1111111, 1111117, 111111115, 1111113111, 1111711111, 11111111111, 111111111115, 1111111111113, 1111117111111, 11171111111111, 1111111111711111, 1111711111111111, 11111111111111111
Offset: 1

Views

Author

Luc Stevens (lms022(AT)yahoo.com), May 20 2006

Keywords

Comments

The Mathematica coding is only good for multidigital, nonrepunits numbers. Obviously 4, 6 and 9 are members and so are A102782: Repunit semiprimes. - Robert G. Wilson v, Jun 10 2006

Examples

			115 is in the sequence because (1) it is a semiprime, (2) the product of its digits is 1*1*5=5 and (3) 115 is divisible by 5.
		

Crossrefs

Programs

  • Maple
    sp:= proc(n) evalb(2=add (i[2], i=ifactors(n) [2])) end: dp:= proc(n) local m; m:=n; 1; while m<>0 do %*irem(m, 10, 'm') od; % end: select(x-> irem(x, dp(x))=0 and sp(x), sort([{4, 6, 9, seq(seq(seq(parse(cat(1$(k-j), t, 1$j)), j=0..k), t=[1, 3, 5, 7]), k=1..20)} []]))[]; # Alois P. Heinz, Nov 17 2009
  • Mathematica
    lst = {}; Do[ p = Times @@ IntegerDigits@n; If[ PrimeQ@p && PrimeQ[n/p], AppendTo[lst, n]; Print[n]], {n, 275*10^6}]; lst (* Robert G. Wilson v, Jun 10 2006 *)
  • PARI
    A007954(n)= { local(resul,ncpy); if(n<10, return(n) ); ncpy=n; resul = ncpy % 10; ncpy = (ncpy - ncpy%10)/10; while( ncpy > 0, resul *= ncpy %10; ncpy = (ncpy - ncpy%10)/10; ); return(resul); } { for(n=4,50000000, if( bigomega(n)==2, dr=A007954(n); if(dr !=0 && n % dr == 0, print1(n,","); ); ); ); } \\ R. J. Mathar, May 23 2006

Formula

a(n) = A001358(k): A007954(a(n)) | a(n). - R. J. Mathar, May 23 2006

Extensions

More terms from R. J. Mathar, May 23 2006
a(12) from Robert G. Wilson v, Jun 10 2006
Further terms from Alois P. Heinz, Nov 17 2009
Showing 1-10 of 13 results. Next