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.

Previous Showing 21-30 of 125 results. Next

A031974 1 repeated prime(n) times.

Original entry on oeis.org

11, 111, 11111, 1111111, 11111111111, 1111111111111, 11111111111111111, 1111111111111111111, 11111111111111111111111, 11111111111111111111111111111, 1111111111111111111111111111111, 1111111111111111111111111111111111111
Offset: 1

Views

Author

J. Castillo (arp(AT)cia-g.com) [Broken email address?]

Keywords

Comments

Salomaa's first example of an infinite language. - N. J. A. Sloane, Dec 05 2012
If p is a prime and gcd(p,b-1)=1, then (b^p-1)/(b-1) == 1 (mod p); by Fermat's little theorem. For example 1111111 == 1 (mod 7). - Thomas Ordowski, Apr 09 2016
Also Mersenne numbers (A001348) written in binary. - Kritsada Moomuang, May 13 2025

References

  • A. Salomaa, Jewels of Formal Language Theory. Computer Science Press, Rockville, MD, 1981, p. 2. - From N. J. A. Sloane, Dec 05 2012

Crossrefs

A004022 is the subsequence of primes. - Jeppe Stig Nielsen, Sep 14 2014
Cf. A001348.

Programs

  • Magma
    [(10^p-1)/9: p in PrimesUpTo(40)]; // Vincenzo Librandi, May 29 2014
  • Maple
    f:=n->(10^ithprime(n)-1)/9; [seq(f(n),n=1..20)]; # N. J. A. Sloane, Dec 05 2012
  • Mathematica
    Table[FromDigits[PadRight[{},Prime[n],1]],{n,15}] (* Harvey P. Dale, Apr 10 2012 *)

Formula

a(n) = A000042(A000040(n)). - Jason Kimberley, Dec 19 2012
a(n) = (10^prime(n) - 1)/9. - Vincenzo Librandi, May 29 2014

Extensions

More terms from Erich Friedman
Corrected and extended by Harvey P. Dale, Apr 10 2012

A065341 Mersenne composites: 2^prime(m) - 1 is not a prime.

Original entry on oeis.org

2047, 8388607, 536870911, 137438953471, 2199023255551, 8796093022207, 140737488355327, 9007199254740991, 576460752303423487, 147573952589676412927, 2361183241434822606847, 9444732965739290427391
Offset: 1

Views

Author

Labos Elemer, Oct 30 2001

Keywords

Comments

For the number of prime factors in a(n) see A135975. For indices of primes n in composite 2^prime(n)-1 see A135980. For smallest prime divisors of Mersenne composites see A136030. For largest prime divisors of Mersenne composites see A136031. For largest divisors see A145097. - Artur Jasinski, Oct 01 2008
All the terms are Fermat pseudoprimes to base 2 (A001567). For a proof see, e.g., Jaroma and Reddy (2007). - Amiram Eldar, Jul 24 2021

Examples

			2^11 - 1 = 2047 = 23*89.
		

Crossrefs

Programs

  • Maple
    A065341 := proc(n) local i;
    i := 2^(ithprime(n))-1:
    if (not isprime(i)) then
       RETURN (i)
    fi: end: seq(A065341(n), n=1..21); # Jani Melik, Feb 09 2011
  • Mathematica
    Select[Table[2^Prime[n]-1,{n,30}],!PrimeQ[#]&] (* Harvey P. Dale, May 06 2018 *)

Formula

a(n) = 2^A054723(n) - 1.

A016047 Smallest prime factor of Mersenne numbers 2^p-1, where p is prime.

Original entry on oeis.org

3, 7, 31, 127, 23, 8191, 131071, 524287, 47, 233, 2147483647, 223, 13367, 431, 2351, 6361, 179951, 2305843009213693951, 193707721, 228479, 439, 2687, 167, 618970019642690137449562111, 11447, 7432339208719, 2550183799, 162259276829213363391578010288127
Offset: 1

Views

Author

Keywords

Comments

"Mersenne numbers", here, means A001348. Compare to sequence A049479, where "Mersenne numbers" is used in the sense of A000225. - Lekraj Beedassy, Jun 11 2009
Submitted new b-file withdrawing last three terms previously submitted. I had, before submitting that b-file, checked that the smallest known factors of incompletely factored Mersenne numbers was less than the known trial factoring limits recorded by Will Edgington in his LowM.txt file which can be found on his Mersenne page, (see link above.) I have now discovered that I inadvertently omitted the purported a(203) from that check. - Daran Gill, Apr 05 2013
The would-be a(203) corresponds to 2^1237-1 which is currently P70*C303. Trial factoring has only been done to 60 bits, and since its difficulty doubles whenever the bit length is incremented by one, it cannot exhaustively search the space smaller than the sole known 70-digit (231-bit) factor. Probabilistic ECM testing indicates only that it is extremely unlikely that there is any undiscovered factor with digit-size smaller than the high fifties. See GIMPS links. - Gord Palameta, Aug 16 2018

Crossrefs

Cf. A000668 (a subsequence), A003260, A001348, A020639, A046800.

Programs

  • Maple
    a:= n-> min(numtheory[factorset](2^ithprime(n)-1)):
    seq(a(n), n=1..28);  # Alois P. Heinz, Oct 01 2024
  • Mathematica
    a = {}; Do[If[PrimeQ[n], w = 2^n - 1; c = FactorInteger[w]; b = c[[1]][[1]]; AppendTo[a, b]], {n, 2, 100}]; a (* Artur Jasinski, Dec 11 2007 *)
  • PARI
    forprime(p=2,150,print1(factor(2^p-1)[1,1],", "))

Formula

a(n) = A020639(A001348(n)). - Alois P. Heinz, Oct 01 2024

A122094 Prime divisors of Mersenne numbers. Primes p such that the multiplicative order of 2 modulo p is prime.

Original entry on oeis.org

3, 7, 23, 31, 47, 89, 127, 167, 223, 233, 263, 359, 383, 431, 439, 479, 503, 719, 839, 863, 887, 983, 1103, 1319, 1367, 1399, 1433, 1439, 1487, 1823, 1913, 2039, 2063, 2089, 2207, 2351, 2383, 2447, 2687, 2767, 2879, 2903, 2999, 3023, 3119, 3167, 3343
Offset: 1

Views

Author

Max Alekseyev, Oct 25 2006

Keywords

Comments

Except for the first term (3), all terms are 1 or 7 (mod 8). - William Hu, May 03 2024

Crossrefs

Cf. A089162 (this list sorted by q).

Programs

  • Magma
    [p: p in PrimesInInterval(2, 4000) | IsPrime(Modorder(2, p))]; // Vincenzo Librandi, Oct 28 2016
  • Mathematica
    Reap[For[p=2, p<10^5, p=NextPrime[p], If[PrimeQ[MultiplicativeOrder[2, p]], Sow[p]]]][[2, 1]] (* Jean-François Alcover, Dec 10 2015 *)
    Select[Prime@ Range@ 500, PrimeQ@ MultiplicativeOrder[2, #] &] (* Michael De Vlieger, Oct 28 2016 *)
  • PARI
    forprime(p=3,10^5,if(isprime(znorder(Mod(2,p))),print1(p,",")))
    

Formula

p is a prime divisor of a Mersenne number 2^q - 1 iff prime q is the multiplicative order of 2 modulo p.

A236966 Number of primes p < prime(n)/2 such that 2^p - 1 is a primitive root modulo prime(n).

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 3, 2, 1, 3, 2, 1, 2, 2, 5, 6, 3, 4, 3, 5, 4, 5, 7, 9, 3, 5, 2, 10, 7, 7, 7, 7, 9, 5, 10, 4, 5, 7, 12, 11, 14, 6, 7, 5, 10, 9, 8, 5, 12, 15, 14, 8, 12, 11, 16, 12, 16, 9, 12, 10, 10, 14, 15, 10, 12, 14, 9, 10, 21, 9, 22, 21, 11, 9, 18, 24, 20, 17, 17, 16
Offset: 1

Views

Author

Zhi-Wei Sun, Apr 22 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 2. In other words, for any prime p > 3, there is a prime q < p/2 with the Mersenne number 2^q - 1 a primitive root modulo p.
We have verified this for all n = 3, ..., 530000.
See also the comment in A234972.

Examples

			a(12) = 1 since 17 is a prime smaller than prime(12)/2 = 37/2 with 2^(17) - 1 = 131071 a primitive root modulo prime(12) = 37.
		

Crossrefs

Programs

  • Mathematica
    f[k_]:=2^(Prime[k])-1
    dv[n_]:=Divisors[n]
    Do[m=0;Do[If[Mod[f[k],Prime[n]]==0,Goto[aa],Do[If[Mod[f[k]^(Part[dv[Prime[n]-1],i]),Prime[n]]==1,Goto[aa]],{i,1,Length[dv[Prime[n]-1]]-1}]];m=m+1;Label[aa];Continue,{k,1,PrimePi[(Prime[n]-1)/2]}];Print[n," ",m];Continue,{n,1,80}]

A006022 Sprague-Grundy (or Nim) values for the game of Maundy cake on an n X 1 sheet.

Original entry on oeis.org

0, 1, 1, 3, 1, 4, 1, 7, 4, 6, 1, 10, 1, 8, 6, 15, 1, 13, 1, 16, 8, 12, 1, 22, 6, 14, 13, 22, 1, 21, 1, 31, 12, 18, 8, 31, 1, 20, 14, 36, 1, 29, 1, 34, 21, 24, 1, 46, 8, 31, 18, 40, 1, 40, 12, 50, 20, 30, 1, 51, 1, 32, 29, 63, 14, 45, 1, 52, 24, 43, 1, 67, 1, 38, 31, 58, 12, 53, 1
Offset: 1

Views

Author

Keywords

Comments

There are three equivalent formulas for a(n). Suppose n >= 2, and let p1 <= p2 <= ... <= pk be the prime factors of n, with repetition.
Theorem 1: a(1) = 0. For n >= 2, a(n) = n*s(n), where
s(n) = 1/p1 + 1/(p1*p2) + 1/(p1*p2*p3) + ... + 1/(p1*p2*...*pk).
This is implicit in Berlekamp, Conway and Guy, Winning Ways, 2 vols., 1982, pp. 28, 53.
Note that s(n) = A322034(n) / A322035(n).
David James Sycamore observed on Nov 24 2018 that Theorem 1 implies a(n) < n for all n (see comments in A322034), and also leads to a simple recurrence for a(n):
Theorem 2: a(1) = 0. For n >= 2, a(n) = p*a(n/p) + 1, where p is the largest prime factor of n.
Proof. (Th. 1 implies Th. 2) If n is a prime, Theorem 1 gives a(n) = 1 = n*a(1)+1. For a nonprime n, let n = m*p where p is the largest prime factor of n and m >= 2. From Theorem 1, a(m) = m*s(m), a(n) = q*m*(s(m) + 1/n) = q*a(m) + 1.
(Th. 2 implies Th. 1) The reverse implication is equally easy.
Theorem 2 is equivalent to the following more complicated recurrence:
Theorem 3: a(1) = 0. For n >= 2, a(n) = max_{p|n, p prime} (p*a(n/p)+1).

Examples

			For n=24, s(24) = 1/2 + 1/4 + 1/8 + 1/24 = 11/12, so a(24) = 24*11/12 = 22.
		

References

  • E. R. Berlekamp, J. H. Conway and R. K. Guy, Winning Ways, Academic Press, NY, 2 vols., 1982, see p. 28, 53.
  • E. R. Berlekamp, J. H. Conway and R. K. Guy, Winning Ways, Second Edition, Vol. 1, A K Peters, 2001, pp. 27, 51.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a006022 1 = 0
    a006022 n = (+ 1) $ sum $ takeWhile (> 1) $
              iterate (\x -> x `div` a020639 x) (a032742 n)
    -- Reinhard Zumkeller, Jun 03 2012
    
  • Maple
    P:=proc(n) local FM: FM:=ifactors(n)[2]: seq(seq(FM[j][1], k=1..FM[j][2]), j=1..nops(FM)) end: # A027746
    s:=proc(n) local i,t,b; global P;t:=0; b:=1; for i in [P(n)] do b:=b*i; t:=t+1/b; od; t; end; # A322034/A322035
    A006022 := n -> if n = 1 then 0 else n*s(n); fi;
    # N. J. A. Sloane, Nov 28 2018
  • Mathematica
    Nest[Function[{a, n}, Append[a, Max@ Map[# a[[n/#]] + 1 &, Rest@ Divisors@ n]]] @@ {#, Length@ # + 1} &, {0, 1}, 77] (* Michael De Vlieger, Nov 23 2018 *)
  • PARI
    lista(nn) = {my(v = vector(nn)); for (n=1, nn, if (n>1, my(m = 0); fordiv (n, d, if (d>1, m = max(m, d*v[n/d]+1))); v[n] = m;); print1(v[n], ", "););} \\ Michel Marcus, Nov 25 2018

Formula

a(n) = n * Sum_{k=1..N} (1/(p1^m1*p2^m2*...*pk^mk)) * (pk^mk-1)/(pk-1) for n>=2, where pk is the k-th distinct prime factor of n, N is the number of distinct prime factors of n, and mk is the multiplicity of pk occurring in n. To prove this, expand the factors in Theorem 1 and use the geometrical series identity. - Jonathan Blanchette, Nov 01 2019
From Antti Karttunen, Apr 12 2020: (Start)
a(n) = A322382(n) + A333791(n).
a(n) = A332993(n) - n = A001065(n) - A333783(n). (End)
a(n) = Sum_{k=1..bigomega(n)} F^k(n), where F^k(n) is the k-th iterate of F(n) = A032742(n). - Ridouane Oudra, Jan 26 2024

Extensions

Edited and extended by Christian G. Bower, Oct 18 2002
Entry revised by N. J. A. Sloane, Nov 28 2018

A173898 Decimal expansion of sum of the reciprocals of the Mersenne primes.

Original entry on oeis.org

5, 1, 6, 4, 5, 4, 1, 7, 8, 9, 4, 0, 7, 8, 8, 5, 6, 5, 3, 3, 0, 4, 8, 7, 3, 4, 2, 9, 7, 1, 5, 2, 2, 8, 5, 8, 8, 1, 5, 9, 6, 8, 5, 5, 3, 4, 1, 5, 4, 1, 9, 7, 0, 1, 4, 4, 1, 9, 3, 1, 0, 6, 5, 2, 7, 3, 5, 6, 8, 7, 0, 1, 4, 4, 0, 2, 1, 2, 7, 2, 3, 4, 9, 9, 1, 5, 4, 8, 8, 3, 2, 9, 3, 6, 6, 6, 2, 1, 5, 3, 7, 4, 0, 3, 2, 4
Offset: 0

Views

Author

Jonathan Vos Post, Mar 01 2010

Keywords

Comments

We know this a priori to be strictly less than the Erdős-Borwein constant (A065442), which Erdős (1948) showed to be irrational. This new constant would also seem to be irrational.

Examples

			Decimal expansion of (1/3) + (1/7) + (1/31) + (1/127) + (1/8191) + (1/131071) + (1/524287) + ... = .5164541789407885653304873429715228588159685534154197.
This has continued fraction expansion 0 + 1/(1 + 1/(1 + 1/(14 + 1/(1 + ...)))) (see A209601).
		

Crossrefs

Cf. A209601, A000668, A065442 (decimal expansion of Erdos-Borwein constant), A000043, A001348, A046051, A057951-A057958, A034876, A124477, A135659, A019279, A061652, A000225.

Programs

  • Maple
    Digits := 120 ; L := [ 2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1279, 2203, 2281, 3217, 4253, 4423, 9689, 9941, 11213, 19937, 21701, 23209, 44497, 86243, 110503, 132049, 216091, 756839, 859433, 1257787, 1398269, 2976221, 3021377, 6972593, 13466917 ] ;
    x := 0 ; for i from 1 to 30 do x := x+1.0/(2^op(i,L)-1 ); end do ;
  • Mathematica
    RealDigits[Sum[1/(2^p - 1), {p, MersennePrimeExponent[Range[14]]}], 10, 100][[1]] (* Amiram Eldar, May 24 2020 *)
  • PARI
    isM(p)=my(m=Mod(4,2^p-1));for(i=1,p-2,m=m^2-2);!m
    s=1/3;forprime(p=3,default(realprecision)*log(10)\log(2), if(isM(p), s+=1./(2^p-1)));s \\ Charles R Greathouse IV, Mar 22 2012

Formula

Sum_{i>=1} 1/A000668(i).

Extensions

Entry revised by N. J. A. Sloane, Mar 10 2012

A106191 Expansion of sqrt(1-4x)/(1-x).

Original entry on oeis.org

1, -1, -3, -7, -17, -45, -129, -393, -1251, -4111, -13835, -47427, -164999, -581023, -2066823, -7415703, -26805393, -97520733, -356810313, -1312087713, -4846614093, -17974854933, -66907388973, -249872516253, -935991743553, -3515800038201, -13239692841105
Offset: 0

Views

Author

Paul Barry, Apr 24 2005

Keywords

Comments

Row sums of number triangle A106190. Partial sums of A002420.
For n >= 1, the absolute values also give the iterates of A122237, starting from 0. (A122237(0), A122237(A122237(0)), A122237(A122237(A122237(0))), ...), this stems from the fact that the sequence gives the positions of terms with binary expansion 1(10){n-1}0 in A014486 (see A080675).

Crossrefs

|a(n)| = A080300(A080675(n)) = A075161(A001348(n)) (for n >= 1) = A075163(A000244(A008578(n-2))) = A014137(n-1)+A014138(n-2) = 2*A014137(n-1)-1, for n >= 2 (because binomial(2n+2, n+1)/(2n+1) = 2*A000108(n)).

Formula

a(n) = Sum_{k=0..n} binomial(2k, k)/(1-2k).
G.f.: (2/(1-x))/G(0), where G(k) = 1 + 1/(1 - 2*x*(2*k+1)/(2*x*(2*k+1) + (k+1)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 24 2013
D-finite with recurrence: a(0)=1, a(1)=-1; for n>1, a(n) = (1/n)*((5*n-6)*a(n-1) - (4*n-6)*a(n-2)). - Tani Akinari, Aug 25 2013

Extensions

Barry's formula made more succinct, as well as comments regarding interpretation as absolute values added by Antti Karttunen, Sep 14 2006

A139104 Numbers whose binary representation shows the distribution of prime numbers up to the n-th prime, using "0" for primes and "1" for nonprime numbers.

Original entry on oeis.org

2, 4, 18, 74, 1198, 4794, 76718, 306874, 4909998, 314239934, 1256959738, 80445423294, 1287126772718, 5148507090874, 82376113453998, 5272071261055934, 337412560707579838, 1349650242830319354, 86377615541140438718, 1382041848658247019502, 5528167394632988078010
Offset: 1

Views

Author

Omar E. Pol, Apr 08 2008

Keywords

Comments

a(n) is the decimal representation of A139103(n) interpreted as binary number.

Examples

			a(4)=74 because 74 written in base 2 is 1001010 and the string "1001010" shows the distribution of prime numbers up to the 4th prime, using "0" for primes and "1" for nonprime numbers.
		

Crossrefs

Programs

  • Mathematica
    Table[ sum = 0; For[i = 1, i <= Prime[n] , i++, sum = sum*2;
    If[! PrimeQ[i], sum++]]; sum, {n, 1, 21}] (* Robert Price, Apr 03 2019 *)
    Module[{nn=30,t},t=Table[If[PrimeQ[n],0,1],{n,Prime[nn]}];Table[ FromDigits[ Take[t,p],2],{p,Prime[Range[nn]]}]] (* Harvey P. Dale, Jul 15 2019 *)
  • PARI
    a(n) = fromdigits(vector(prime(n), k, !isprime(k)), 2); \\ Michel Marcus, Apr 04 2019

Formula

a(n) = 2 * A139102(n).
From Ridouane Oudra, Aug 27 2019: (Start)
a(n) = 2^prime(n) - 1 - (1/2)*(n + Sum_{i=1..prime(n)} 2^(prime(n)-i)*pi(i)), where prime(n) = A000040(n) and pi(n) = A000720(n)
a(n) = A001348(n) - A121240(n)
a(n) = A118255(A000040(n)). (End)

Extensions

More terms from R. J. Mathar, May 22 2008
a(19)-a(21) from Robert Price, Apr 03 2019

A065403 Primes of the form sigma(m^2) where m is a composite number ordered by values m.

Original entry on oeis.org

31, 127, 1093, 2801, 8191, 19531, 30941, 131071, 88741, 524287, 292561, 797161, 732541, 3500201, 5229043, 12207031, 25646167, 28792661, 39449441, 48037081, 305175781, 262209281, 917087137, 2147483647, 1394714501, 2666986681
Offset: 1

Views

Author

Labos Elemer, Nov 06 2001

Keywords

Comments

There are 46 cases below 10^12.
All Mersenne primes are here: sigma((2^((p-1)/2))^2) = sigma(2^(p-1)) = -1 + 2^p, for suitable p.
m is of the form p^(2*e) for some prime p and e > 1 as sigma is multiplicative and m is composite. Terms are sorted by values of m. The sequence isn't monotonic. - David A. Corneth, Jul 18 2020

Examples

			19531 is in the sequence as for the composite m = 125 we have sigma(m^2) = 19531. - _David A. Corneth_, Jul 18 2020
		

Crossrefs

Programs

  • Mathematica
    Do[s=DivisorSigma[1, n]; If[PrimeQ[s]&&!PrimeQ[Sqrt[n]], Print[{n, Sqrt[n], s}]], {n, 1, 20000000}]
  • PARI
    { n=0; for (m=1, 10^9, if (isprime(m), next); x=sigma(m^2); if (isprime(x), write("b065403.txt", n++, " ", x); if (n==100, return)) ) } \\ Harry J. Smith, Oct 18 2009
    
  • PARI
    upto(n) = {res = List(); forstep(e = 4, logint(n, 2), 2, forprime(p = 2, sqrtnint(n, e), c = (p^(e + 1) - 1)/(p - 1); if(isprime(c), listput(res, [p^e, c]) ) ) ); listsort(res); vector(#res, i, res[i][2]) } \\ David A. Corneth, Jul 18 2020

Extensions

Name corrected by David A. Corneth, Jul 18 2020
Previous Showing 21-30 of 125 results. Next