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

A324200 a(n) = 2^(A000043(n)-1) * ((2^A059305(n)) - 1), where A059305 gives the prime index of the n-th Mersenne prime, while A000043 gives its exponent.

Original entry on oeis.org

6, 60, 32752, 137438953408
Offset: 1

Views

Author

Antti Karttunen, Feb 18 2019

Keywords

Comments

If there are no odd perfect numbers then these are the positions of zeros in A324185.
The next term has 314 digits:
11781361728633673532894774498354952494238773929196300355071513798753168641589311119865182769801300280680127783231251635087526446289021607771691249214388576215221396663491984443067742263787264024212477244347842938066577043117995647400274369612403653814737339068225047641453182709824206687753689912418253153056583680.

Crossrefs

Programs

Formula

a(n) = ((2^A000720(A000668(n)))-1) * 2^(A000043(n)-1) = ((2^A059305(n)) - 1) * 2^(A000043(n)-1).
If no odd perfect numbers exist, then a(n) = A243071(A000396(n)), and thus A007814(a(n)) = A007814(A000396(n)).

A000668 Mersenne primes (primes of the form 2^n - 1).

Original entry on oeis.org

3, 7, 31, 127, 8191, 131071, 524287, 2147483647, 2305843009213693951, 618970019642690137449562111, 162259276829213363391578010288127, 170141183460469231731687303715884105727
Offset: 1

Views

Author

Keywords

Comments

For a Mersenne number 2^n - 1 to be prime, the exponent n must itself be prime.
See A000043 for the values of n.
Primes that are repunits in base 2.
Define f(k) = 2k+1; begin with k = 2, a(n+1) = least prime of the form f(f(f(...(a(n))))). - Amarnath Murthy, Dec 26 2003
Mersenne primes other than the first are of the form 6n+1. - Lekraj Beedassy, Aug 27 2004. Mersenne primes other than the first are of the form 24n+7; see also A124477. - Artur Jasinski, Nov 25 2007
A034876(a(n)) = 0 and A034876(a(n)+1) = 1. - Jonathan Sondow, Dec 19 2004
Mersenne primes are solutions to sigma(n+1)-sigma(n) = n as perfect numbers (A000396(n)) are solutions to sigma(n) = 2n. In fact, appears to give all n such that sigma(n+1)-sigma(n) = n. - Benoit Cloitre, Aug 27 2002
If n is in the sequence then sigma(sigma(n)) = 2n+1. Is it true that this sequence gives all numbers n such that sigma(sigma(n)) = 2n+1? - Farideh Firoozbakht, Aug 19 2005
It is easily proved that if n is a Mersenne prime then sigma(sigma(n)) - sigma(n) = n. Is it true that Mersenne primes are all the solutions of the equation sigma(sigma(x)) - sigma(x) = x? - Farideh Firoozbakht, Feb 12 2008
Sum of divisors of n-th even superperfect number A061652(n). Sum of divisors of n-th superperfect number A019279(n), if there are no odd superperfect numbers. - Omar E. Pol, Mar 11 2008
Indices of both triangular numbers and generalized hexagonal numbers (A000217) that are also even perfect numbers. - Omar E. Pol, May 10 2008, Sep 22 2013
Number of positive integers (1, 2, 3, ...) whose sum is the n-th perfect number A000396(n). - Omar E. Pol, May 10 2008
Vertex number where the n-th perfect number A000396(n) is located in the square spiral whose vertices are the positive triangular numbers A000217. - Omar E. Pol, May 10 2008
Mersenne numbers A000225 whose indices are the prime numbers A000043. - Omar E. Pol, Aug 31 2008
The digital roots are 1 if p == 1 (mod 6) and 4 if p == 5 (mod 6). [T. Koshy, Math Gaz. 89 (2005) p. 465]
Primes p such that for all primes q < p, p XOR q = p - q. - Brad Clardy, Oct 26 2011
All these primes, except 3, are Brazilian primes, so they are also in A085104 and A023195. - Bernard Schott, Dec 26 2012
All prime numbers p can be classified by k = (p mod 12) into four classes: k=1, 5, 7, 11. The Mersennne prime numbers 2^p-1, p > 2 are in the class k=7 with p=12*(n-1)+7, n=1,2,.... As all 2^p (p odd) are in class k=8 it follows that all 2^p-1, p > 2 are in class k=7. - Freimut Marschner, Jul 27 2013
From "The Guinness Book of Primes": "During the reign of Queen Elizabeth I, the largest known prime number was the number of grains of rice on the chessboard up to and including the nineteenth square: 524,287 [= 2^19 - 1]. By the time Lord Nelson was fighting the Battle of Trafalgar, the record for the largest prime had gone up to the thirty-first square of the chessboard: 2,147,483,647 [= 2^31 - 1]. This ten-digits number was proved to be prime in 1772 by the Swiss mathematician Leonard Euler, and it held the record until 1867." [du Sautoy] - Robert G. Wilson v, Nov 26 2013
If n is in the sequence then A024816(n) = antisigma(n) = antisigma(n+1) - 1. Is it true that this sequence gives all numbers n such that antisigma(n) = antisigma(n+1) - 1? Are there composite numbers with this property? - Jaroslav Krizek, Jan 24 2014
If n is in the sequence then phi(n) + sigma(sigma(n)) = 3n. Is it true that Mersenne primes are all the solutions of the equation phi(x) + sigma(sigma(x)) = 3x? - Farideh Firoozbakht, Sep 03 2014
a(5) = A229381(2) = 8191 is the "Simpsons' Mersenne prime". - Jonathan Sondow, Jan 02 2015
Equivalently, prime powers of the form 2^n - 1, see Theorem 2 in Lemos & Cambraia Junior. - Charles R Greathouse IV, Jul 07 2016
Primes whose sum of divisors is a power of 2. Primes p such that p + 1 is a power of 2. Primes in A046528. - Omar E. Pol, Jul 09 2016
From Jaroslav Krizek, Jan 19 2017: (Start)
Primes p such that sigma(p+1) = 2p+1.
Primes p such that A051027(p) = sigma(sigma(p)) = 2^k-1 for some k > 1.
Primes p of the form sigma(2^prime(n)-1)-1 for some n. Corresponding values of numbers n are in A016027.
Primes p of the form sigma(2^(n-1)) for some n > 1. Corresponding values of numbers n are in A000043 (Mersenne exponents).
Primes of the form sigma(2^(n+1)) for some n > 1. Corresponding values of numbers n are in A153798 (Mersenne exponents-2).
Primes p of the form sigma(n) where n is even; subsequence of A023195. Primes p of the form sigma(n) for some n. Conjecture: 31 is the only prime p such that p = sigma(x) = sigma(y) for distinct numbers x and y; 31 = sigma(16) = sigma(25).
Conjecture: numbers n such that n = sigma(sigma(n+1)-n-1)-1, i.e., A072868(n)-1.
Conjecture: primes of the form sigma(4*(n-1)) for some n. Corresponding values of numbers n are in A281312. (End)
[Conjecture] For n > 2, the Mersenne number M(n) = 2^n - 1 is a prime if and only if 3^M(n-1) == -1 (mod M(n)). - Thomas Ordowski, Aug 12 2018 [This needs proof! - Joerg Arndt, Mar 31 2019]
Named "Mersenne's numbers" by W. W. Rouse Ball (1892, 1912) after Marin Mersenne (1588-1648). - Amiram Eldar, Feb 20 2021
Theorem. Let b = 2^p - 1 (where p is a prime). Then b is a Mersenne prime iff (c = 2^p - 2 is totient or a term of A002202). Otherwise, if c is (nontotient or a term of A005277) then b is composite. Proof. Trivial, since, while b = v^g - 1 where v is even, v > 2, g is an integer, g > 1, b is always composite, and c = v^g - 2 is nontotient (or a term of A005277), and so is for any composite b = 2^g - 1 (in the last case, c = v^g - 2 is also nontotient, or a term of A005277). - Sergey Pavlov, Aug 30 2021 [Disclaimer: This proof has not been checked. - N. J. A. Sloane, Oct 01 2021]

References

  • Tom M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 4.
  • John Brillhart, D. H. Lehmer, J. L. Selfridge, Bryant Tuckerman and S. S. Wagstaff, Jr., Factorizations of b^n +- 1. Contemporary Mathematics, Vol. 22, Amer. Math. Soc., Providence, RI, 2nd edition, 1985; and later supplements.
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See pp. 135-136.
  • Graham Everest, Alf van der Poorten, Igor Shparlinski and Thomas Ward, Recurrence Sequences, Amer. Math. Soc., 2003; see esp. p. 255.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 76.
  • Marcus P. F. du Sautoy, The Number Mysteries, A Mathematical Odyssey Through Everyday Life, Palgrave Macmillan, First published in 2010 by the Fourth Estate, an imprint of Harper Collins UK, 2011, p. 46. - Robert G. Wilson v, Nov 26 2013
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • Bryant Tuckerman, The 24th Mersenne prime, Notices Amer. Math. Soc., 18 (Jun, 1971), Abstract 684-A15, p. 608.

Crossrefs

Cf. A000225 (Mersenne numbers).
Cf. A000043 (Mersenne exponents).
Cf. A001348 (Mersenne numbers with n prime).

Programs

  • GAP
    A000668:=Filtered(List(Filtered([1..600], IsPrime),i->2^i-1),IsPrime); # Muniru A Asiru, Oct 01 2017
    
  • Maple
    A000668 := proc(n) local i;
    i := 2^(ithprime(n))-1:
    if (isprime(i)) then
       return i
    fi: end:
    seq(A000668(n), n=1..31); # Jani Melik, Feb 09 2011
    # Alternate:
    seq(numtheory:-mersenne([i]),i=1..26); # Robert Israel, Jul 13 2014
  • Mathematica
    2^Array[MersennePrimeExponent, 18] - 1 (* Jean-François Alcover, Feb 17 2018, Mersenne primes with less than 1000 digits *)
    2^MersennePrimeExponent[Range[18]] - 1 (* Eric W. Weisstein, Sep 04 2021 *)
  • PARI
    forprime(p=2,1e5,if(ispseudoprime(2^p-1),print1(2^p-1", "))) \\ Charles R Greathouse IV, Jul 15 2011
    
  • PARI
    LL(e) = my(n, h); n = 2^e-1; h = Mod(2, n); for (k=1, e-2, h=2*h*h-1); return(0==h) \\ after Joerg Arndt in A000043
    forprime(p=1, , if(LL(p), print1(p, ", "))) \\ Felix Fröhlich, Feb 17 2018
    
  • Python
    from sympy import isprime, primerange
    print([2**n-1 for n in primerange(1, 1001) if isprime(2**n-1)]) # Karl V. Keller, Jr., Jul 16 2020

Formula

a(n) = sigma(A061652(n)) = A000203(A061652(n)). - Omar E. Pol, Apr 15 2008
a(n) = sigma(A019279(n)) = A000203(A019279(n)), provided that there are no odd superperfect numbers. - Omar E. Pol, May 10 2008
a(n) = A000225(A000043(n)). - Omar E. Pol, Aug 31 2008
a(n) = 2^A000043(n) - 1 = 2^(A000005(A061652(n))) - 1. - Omar E. Pol, Oct 27 2011
a(n) = A000040(A059305(n)) = A001348(A016027(n)). - Omar E. Pol, Jun 29 2012
a(n) = A007947(A000396(n))/2, provided that there are no odd perfect numbers. - Omar E. Pol, Feb 01 2013
a(n) = 4*A134709(n) + 3. - Ivan N. Ianakiev, Sep 07 2013
a(n) = A003056(A000396(n)), provided that there are no odd perfect numbers. - Omar E. Pol, Dec 19 2016
Sum_{n>=1} 1/a(n) = A173898. - Amiram Eldar, Feb 20 2021

A046051 Number of prime factors of Mersenne number M(n) = 2^n - 1 (counted with multiplicity).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Length of row n of A001265.

Examples

			a(4) = 2 because 2^4 - 1 = 15 = 3*5.
From _Gus Wiseman_, Jul 04 2019: (Start)
The sequence of Mersenne numbers together with their prime indices begins:
        1: {}
        3: {2}
        7: {4}
       15: {2,3}
       31: {11}
       63: {2,2,4}
      127: {31}
      255: {2,3,7}
      511: {4,21}
     1023: {2,5,11}
     2047: {9,24}
     4095: {2,2,3,4,6}
     8191: {1028}
    16383: {2,14,31}
    32767: {4,11,36}
    65535: {2,3,7,55}
   131071: {12251}
   262143: {2,2,2,4,8,21}
   524287: {43390}
  1048575: {2,3,3,5,11,13}
(End)
		

Crossrefs

bigomega(b^n-1): A057951 (b=10), A057952 (b=9), A057953 (b=8), A057954 (b=7), A057955 (b=6), A057956 (b=5), A057957 (b=4), A057958 (b=3), this sequence (b=2).

Programs

  • Mathematica
    a[q_] := Module[{x, n}, x=FactorInteger[2^n-1]; n=Length[x]; Sum[Table[x[i][2], {i, n}][j], {j, n}]]
    a[n_Integer] := PrimeOmega[2^n - 1]; Table[a[n], {n,200}] (* Vladimir Joseph Stephan Orlovsky, Jul 22 2011 *)
  • PARI
    a(n)=bigomega(2^n-1) \\ Charles R Greathouse IV, Apr 01 2013

Formula

Mobius transform of A085021. - T. D. Noe, Jun 19 2003
a(n) = A001222(A000225(n)). - Michel Marcus, Jun 06 2019

A377289 Difference between prime(n) and the previous prime-power (exclusive).

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 1, 2, 4, 2, 2, 5, 4, 2, 4, 4, 6, 2, 3, 4, 2, 6, 2, 6, 8, 4, 2, 4, 2, 4, 2, 3, 6, 2, 10, 2, 6, 6, 4, 4, 6, 2, 10, 2, 4, 2, 12, 12, 4, 2, 4, 6, 2, 8, 1, 6, 6, 2, 6, 4, 2, 4, 14, 4, 2, 4, 14, 6, 4, 2, 4, 6, 6, 6, 6, 4, 6, 8, 4, 8, 10, 2, 10, 2
Offset: 1

Views

Author

Gus Wiseman, Oct 23 2024

Keywords

Examples

			The twelfth prime is 37, with previous prime-power 32, so a(12) = 5.
		

Crossrefs

For powers of two see A013597, A014210, A014234, A244508, A304521.
For prime instead of prime-power we have A075526.
This is the restriction of A276781 (shifted right) to the primes.
For next instead of previous prime-power we have A377281, restriction of A377282.
A000015 gives the least prime-power >= n.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820, complement A361102.
A031218 gives the greatest prime-power <= n.
A065514 gives the greatest prime-power < prime(n).
A080101 counts prime-powers between primes (exclusive), cf. A377286, A377287, A377288.
A246655 lists the prime-powers not including 1.

Programs

  • Mathematica
    Table[Prime[n]-NestWhile[#-1&, Prime[n]-1,#>1&&!PrimePowerQ[#]&],{n,100}]
  • Python
    from sympy import prime, factorint
    def A377289(n): return (p:=prime(n))-next(filter(lambda m:len(factorint(m))<=1, range(p-1,0,-1))) # Chai Wah Wu, Oct 25 2024

Formula

a(n) = prime(n) - A031218(prime(n)-1).
a(n) = prime(n) - A065514(n).
a(n) = A276781(prime(n)-1).

A035103 Number of 0's in binary representation of n-th prime.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a035103 = a023416 . a000040  -- Reinhard Zumkeller, Feb 19 2013
  • Mathematica
    Table[ Count[ IntegerDigits[ Prime[ n ], 2 ], 0 ], {n, 120} ]
    Table[DigitCount[p,2,0],{p,Prime[Range[120]]}] (* Harvey P. Dale, Mar 03 2023 *)
  • PARI
    A035103(n) = #(n=binary(prime(n)))-norml2(n) \\ M. F. Hasler, Nov 21 2009
    

Formula

a(n) = A035100(n) - A014499(n). - M. F. Hasler, Nov 21 2009
a(n) = 0 for n in { A059305 }. - Alois P. Heinz, Jun 26 2021

Extensions

More terms from Erich Friedman

A377281 Difference between the n-th prime and the next prime-power (exclusive).

Original entry on oeis.org

1, 1, 2, 1, 2, 3, 2, 4, 2, 2, 1, 4, 2, 4, 2, 6, 2, 3, 4, 2, 6, 2, 6, 8, 4, 2, 4, 2, 4, 8, 1, 6, 2, 10, 2, 6, 6, 4, 2, 6, 2, 10, 2, 4, 2, 12, 12, 4, 2, 4, 6, 2, 2, 5, 6, 6, 2, 6, 4, 2, 6, 14, 4, 2, 4, 14, 6, 6, 2, 4, 6, 2, 6, 6, 4, 6, 8, 4, 8, 10, 2, 10, 2, 6
Offset: 1

Views

Author

Gus Wiseman, Oct 23 2024

Keywords

Examples

			The twelfth prime is 37, with next prime-power 41, so a(12) = 4.
		

Crossrefs

For prime instead of prime-power we have A001223.
For powers of two instead of primes we have A013597, A014210, A014234, A244508, A304521.
This is the restriction of A377282 to the prime numbers.
For previous instead of next prime-power we have A377289, restriction of A276781.
A000015 gives the least prime-power >= n.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820, complement A361102.
A031218 gives the greatest prime-power <= n.
A080101 counts prime-powers between primes (exclusive), cf. A377286, A377287, A377288.
A246655 lists the prime-powers not including 1.

Programs

  • Mathematica
    Table[NestWhile[#+1&,Prime[n]+1,!PrimePowerQ[#]&]-Prime[n],{n,100}]
  • Python
    from itertools import count
    from sympy import prime, factorint
    def A377281(n): return -(p:=prime(n))+next(filter(lambda m:len(factorint(m))<=1, count(p+1))) # Chai Wah Wu, Oct 25 2024

Formula

a(n) = A000015(prime(n)) - prime(n).
a(n) = A345531(n) - prime(n).
a(n) = A377282(prime(n)).

A377282 Difference between n and the next prime-power (exclusive).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 3, 2, 1, 1, 2, 1, 4, 3, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 5, 4, 3, 2, 1, 4, 3, 2, 1, 2, 1, 4, 3, 2, 1, 2, 1, 4, 3, 2, 1, 6, 5, 4, 3, 2, 1, 2, 1, 3, 2, 1, 3, 2, 1, 4, 3, 2, 1, 2, 1, 6, 5, 4, 3, 2, 1, 2, 1, 2, 1, 6, 5, 4, 3, 2
Offset: 1

Views

Author

Gus Wiseman, Oct 23 2024

Keywords

Examples

			The next prime-power after 13 is 16, so a(12) = 3.
		

Crossrefs

For powers of 2 see A013597, A014210, A014234, A244508, A304521.
For prime instead of prime-power we have A013632.
For previous instead of next prime-power we have A276781, restriction A377289.
The restriction to the prime numbers is A377281.
A000015 gives the least prime-power >= n.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820, complement A361102.
A031218 gives the greatest prime-power <= n.
A080101 counts prime-powers between primes (exclusive), cf. A377286, A377287, A377288.

Programs

  • Mathematica
    Table[NestWhile[#+1&,n+1,!PrimePowerQ[#]&]-n,{n,100}]
  • Python
    from itertools import count
    from sympy import factorint
    def A377282(n): return next(filter(lambda m:len(factorint(m))<=1, count(n+1)))-n # Chai Wah Wu, Oct 25 2024

Formula

a(n) = A000015(n) - n + 1 for n > 1.
a(prime(n)) = A377281(n).

A016027 Indices of prime Mersenne numbers (A001348).

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 8, 11, 18, 24, 28, 31, 98, 111, 207, 328, 339, 455, 583, 602, 1196, 1226, 1357, 2254, 2435, 2591, 4624, 8384, 10489, 12331, 19292, 60745, 68301, 97017, 106991, 215208, 218239, 474908, 877615, 1329726, 1509263, 1622441, 1881339, 2007537, 2270720, 2584328, 2610944, 3443958
Offset: 1

Views

Author

Keywords

Comments

The following are also terms of the sequence: 4350601, 4517402, 4811740. [updated by Amiram Eldar, Jun 11 2024].
Numbers k such that A001348(k) is a Mersenne prime A000668. - Omar E. Pol, Jul 14 2012
Numbers k such that A060286(k) is a perfect number A000396. Assuming there are no odd perfect numbers, A060286(a(n)) = A000396(n). - Omar E. Pol, Dec 13 2012

Examples

			The first four Mersenne numbers 2^2 - 1 = 3, 2^3 - 1 = 7, 2^5 - 1 = 31 and 2^7 - 1 = 127 are prime, so 1, 2, 3, 4 are members. But the fifth Mersenne number 2^11 - 1 = 2047 = 23*89 is composite, so 5 is not a member.
		

References

  • Richard K. Guy, Unsolved Problems in Number Theory, 3rd ed., Springer-Verlag, NY, 2004, Sec. A3.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 3rd ed., Oxford Univ. Press, 1954, p. 16.
  • Paulo Ribenboim, The New Book of Prime Number Records, Springer-Verlag, NY, 1996, Chap. 2, Sec. VII.

Crossrefs

Cf. A000043, A000396, A001348, A059305 (index of the n-th Mersenne prime), A060286

Programs

Formula

a(n) = pi(A000043(n)).
a(n) = A000720(A000043(n)).

Extensions

Corrected by Vasiliy Danilov (danilovv(AT)usa.net), Jun 15 1998
Further corrections from Reto Keiser (rkeiser(AT)stud.ee.ethz.ch), Jan 10 2001
a(39) from Robert G. Wilson v, Mar 20 2006
a(40) from Robert G. Wilson v, May 29 2011
a(41) from Robert G. Wilson v, Jul 07 2012
a(42) from Robert G. Wilson v, Jan 20 2014
a(43)-a(44) from Robert G. Wilson v, Aug 20 2015
a(45) from Patrick J. McNab, Dec 18 2017
a(46)-a(47) from Ivan Panchenko, Apr 09 2018
a(48) from Amiram Eldar, Jun 11 2024

A372516 Number of ones minus number of zeros in the binary expansion of the n-th prime number.

Original entry on oeis.org

0, 2, 1, 3, 2, 2, -1, 1, 3, 3, 5, 0, 0, 2, 4, 2, 4, 4, -1, 1, -1, 3, 1, 1, -1, 1, 3, 3, 3, 1, 7, -2, -2, 0, 0, 2, 2, 0, 2, 2, 2, 2, 6, -2, 0, 2, 2, 6, 2, 2, 2, 6, 2, 6, -5, -1, -1, 1, -1, -1, 1, -1, 1, 3, 1, 3, 1, -1, 3, 3, -1, 3, 5, 3, 5, 7, -1, 1, -1, 1, 1
Offset: 1

Views

Author

Gus Wiseman, May 13 2024

Keywords

Comments

Absolute value is A177718.

Examples

			The binary expansion of 83 is (1,0,1,0,0,1,1), and 83 is the 23rd prime, so a(23) = 4 - 3 = 1.
		

Crossrefs

The sum instead of difference is A035100, firsts A372684 (primes A104080).
The negative version is A037861(A000040(n)).
Restriction of A145037 to the primes.
The unsigned version is A177718.
- Positions of zeros are A177796, indices of the primes A066196.
- Positions of positive terms are indices of the primes A095070.
- Positions of negative terms are indices of the primes A095071.
- Positions of negative ones are A372539, indices of the primes A095072.
- Positions of ones are A372538, indices of the primes A095073.
- Positions of nonnegative terms are indices of the primes A095074.
- Positions of nonpositive terms are indices of the primes A095075.
A000120 counts ones in binary expansion (binary weight), zeros A080791.
A030190 gives binary expansion, reversed A030308.
A035103 counts zeros in binary expansion of primes, firsts A372474.
A048793 lists binary indices, reverse A272020, sum A029931.
A070939 gives length of binary expansion.
A101211 lists run-lengths in binary expansion, row-lengths A069010.
A372471 lists the binary indices of each prime.

Programs

  • Mathematica
    Table[DigitCount[Prime[n],2,1]-DigitCount[Prime[n],2,0],{n,100}]
    DigitCount[#,2,1]-DigitCount[#,2,0]&/@Prime[Range[100]] (* Harvey P. Dale, May 09 2025 *)

Formula

a(n) = A000120(A000040(n)) - A080791(A000040(n)).
a(n) = A014499(n) - A035103(n).
a(n) = A145037(A000040(n))

A325612 Width (number of leaves) of the rooted tree with Matula-Goebel number 2^n - 1.

Original entry on oeis.org

1, 1, 2, 2, 1, 4, 1, 4, 5, 3, 6, 7, 4, 5, 7, 6, 7, 11, 7, 7, 9, 10, 7, 13, 7, 11, 9, 11, 11, 13, 11, 12, 15, 16, 10, 19, 19, 15, 18, 16, 16, 18, 10, 18, 18, 17, 15, 21, 15, 18, 24, 23, 19, 23, 25, 25, 18, 26, 25, 28, 21, 21, 25, 23, 21, 29, 28, 31, 21, 24, 23
Offset: 1

Views

Author

Gus Wiseman, May 12 2019

Keywords

Comments

Every positive integer has a unique q-factorization (encoded by A324924) into factors q(i) = prime(i)/i, i > 0. For example:
11 = q(1) q(2) q(3) q(5)
50 = q(1)^3 q(2)^2 q(3)^2
360 = q(1)^6 q(2)^3 q(3)
For n > 1, a(n) is the multiplicity of q(1) = 2 in the q-factorization of 2^n - 1.

Examples

			The rooted tree with Matula-Goebel number 2047 = 2^11 - 1 is (((o)(o))(ooo(o))), which has 6 leaves (o's), so a(11) = 6.
		

Crossrefs

Matula-Goebel numbers: A007097, A061775, A109082, A109129, A196050, A317713.
Mersenne numbers: A046051, A046800, A059305, A325610, A325611, A325625.

Programs

  • Mathematica
    mglv[n_]:=If[n==1,1,Total[Cases[FactorInteger[n],{p_,k_}:>mglv[PrimePi[p]]*k]]];
    Table[mglv[2^n-1],{n,30}]

Extensions

More terms from Jinyuan Wang, Feb 25 2025
Showing 1-10 of 30 results. Next