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 10 results.

A011754 Number of ones in the binary expansion of 3^n.

Original entry on oeis.org

1, 2, 2, 4, 3, 6, 6, 5, 6, 8, 9, 13, 10, 11, 14, 15, 11, 14, 14, 17, 17, 20, 19, 22, 16, 18, 24, 30, 25, 25, 25, 26, 26, 34, 29, 32, 27, 34, 36, 32, 28, 39, 38, 39, 34, 34, 45, 38, 41, 33, 41, 46, 42, 35, 39, 42, 39, 40, 42, 48, 56, 56, 49, 57, 56, 51, 45, 47, 55, 55, 64, 68, 58
Offset: 0

Views

Author

Allan C. Wechsler, Dec 11 1999

Keywords

Comments

Conjecture: a(n)/n tends to log(3)/(2*log(2)) = 0.792481250... (A094148). - Ed Pegg Jr, Dec 05 2002
Senge & Straus prove that for every m, there is some N such that for all n > N, a(n) > m. Dimitrov & Howe make this effective, proving that for n > 25, a(n) > 22. - Charles R Greathouse IV, Aug 23 2021
Ed Pegg's conjecture means that about half of the bits of 3^n are nonzero. It appears that the same is true for 5^n (A000351, cf. A118738) and 7^n (A000420). - M. F. Hasler, Apr 17 2024

References

  • S. Wolfram, "A new kind of science", p. 903.

Crossrefs

Cf. A007088, A000120 (Hamming weight), A000244 (3^n), A004656, A261009, A094148.
Cf. A118738 (same for 5^n).

Programs

Formula

a(n) = A000120(3^n). - Benoit Cloitre, Dec 06 2002
a(n) = A000120(A000244(n)). - Reinhard Zumkeller, Aug 14 2015

Extensions

More terms from Stefan Steinerberger, Apr 03 2006

A061785 a(n) = m such that 2^m < 5^n < 2^(m+1).

Original entry on oeis.org

2, 4, 6, 9, 11, 13, 16, 18, 20, 23, 25, 27, 30, 32, 34, 37, 39, 41, 44, 46, 48, 51, 53, 55, 58, 60, 62, 65, 67, 69, 71, 74, 76, 78, 81, 83, 85, 88, 90, 92, 95, 97, 99, 102, 104, 106, 109, 111, 113, 116, 118, 120, 123, 125, 127, 130, 132, 134, 136, 139, 141, 143, 146, 148
Offset: 1

Views

Author

Lekraj Beedassy, May 09 2003

Keywords

Comments

The Beatty sequence for log_2(5) (A020858). The asymptotic density of this sequence is log_5(2) (A152675). - Amiram Eldar, Apr 09 2021
One less than the length of 5^n written in binary. Could and should be extended to a(0) = 0 (with definition corrected to "2^m <= ..."). - M. F. Hasler, Apr 17 2024

Examples

			a(2) = 4 since 2^4 < 5^2 < 2^(4+1).
		

Crossrefs

Cf. A118738 (Hamming weight of 5^n).

Programs

  • Mathematica
    Table[Floor[n*Log2[5]], {n, 100}] (* Amiram Eldar, Apr 09 2021 *)
  • PARI
    a(n) = floor(n*log(5)/log(2)) \\ Michel Marcus, Jul 27 2013
    
  • Python
    def A061785(n): return (5**n).bit_length()-1 # Chai Wah Wu, Jul 22 2025

Formula

a(n) = floor(n*log_2(5)). - M. F. Hasler, Apr 17 2024

Extensions

Corrected and extended by John W. Layman, May 09 2003

A118737 Number of zeros in binary expansion of 5^n.

Original entry on oeis.org

0, 1, 2, 1, 5, 6, 7, 9, 7, 8, 13, 11, 15, 17, 16, 15, 18, 20, 18, 26, 21, 20, 27, 27, 26, 40, 30, 30, 37, 32, 33, 39, 36, 43, 37, 42, 40, 44, 51, 45, 40, 42, 49, 48, 51, 52, 57, 61, 58, 54, 59, 59, 67, 60, 68, 54, 70, 66, 61, 72, 79, 65, 70, 66, 63, 73, 67, 71, 76, 72, 80, 86, 78
Offset: 0

Views

Author

Zak Seidov, May 22 2006

Keywords

Crossrefs

Programs

  • Maple
    seq(numboccur(0,convert(5^n,base,2)),n=0..100); # Robert Israel, Dec 24 2017
  • Mathematica
    a[n_] := DigitCount[5^n, 2, 0]; Table[a[n], {n, 0, 72}] (* Ray Chandler, Sep 29 2006 *)
    DigitCount[5^Range[0,80],2,0] (* Harvey P. Dale, Aug 30 2021 *)
  • PARI
    a(n) = #binary(5^n)-hammingweight(5^n) \\ Felix Fröhlich, Dec 24 2017

Formula

a(n) + A118738(n) = A061785(n)+1 for n >= 1. - Robert Israel, Dec 24 2017
a(n) = A023416(A000351(n)). - Felix Fröhlich, Dec 24 2017

A218451 a(n) = 10^n minus its binary weight.

Original entry on oeis.org

0, 8, 97, 994, 9995, 99994, 999993, 9999992, 99999988, 999999987, 9999999989, 99999999985, 999999999987, 9999999999986, 99999999999983, 999999999999980, 9999999999999980, 99999999999999980, 999999999999999976, 9999999999999999981, 99999999999999999974
Offset: 0

Views

Author

Alonso del Arte, Oct 28 2012, based on examples for A011371 from Hieronymus Fischer, Jun 06 2012

Keywords

Comments

Also exponent of highest power of 2 which divides (10^n)!. - Robert G. Wilson v, Jan 10 2025

Examples

			a(2) = 97 because 10^2 = 100, which is 1100100 in binary, having 3 on bits, and 100 - 3 = 97.
a(3) = 994 because 10^3 = 1000, which is 1111101000 in binary, having 6 on bits, and 1000 - 6 = 994.
		

Crossrefs

Programs

  • Mathematica
    Table[10^n - DigitCount[10^n, 2, 1], {n, 0, 19}]
  • PARI
    a(n)=10^n-hammingweight(5^n) \\ Charles R Greathouse IV, Oct 28 2012

Formula

a(n) = A011371(10^n) = 10^n - A000120(10^n).
a(n) = 10^n - A118738(n).
a(n) = A007814(A000142(A011557(n))). - Robert G. Wilson v, Jan 10 2025

Extensions

More terms from Amiram Eldar, Jul 16 2023

A369857 Number of nonzero bits (a.k.a. binary or Hamming weight) of 7^n.

Original entry on oeis.org

1, 3, 3, 6, 5, 7, 9, 11, 14, 17, 15, 20, 11, 20, 23, 20, 22, 24, 20, 31, 30, 24, 24, 36, 29, 29, 37, 33, 37, 42, 43, 43, 40, 50, 53, 44, 39, 53, 43, 60, 57, 53, 60, 59, 62, 68, 65, 66, 59, 68, 75, 71, 84, 77, 65, 74, 81, 87, 85, 83, 77, 89, 83, 95, 84, 89, 86, 98, 102, 94, 97, 104
Offset: 0

Views

Author

M. F. Hasler, Apr 17 2024

Keywords

Comments

Conjecture: a(n)/n -> log_4(7) = 1.403677461..., i.e., about half of the bits of 7^n are nonzero.

Examples

			The first few powers of 7 and their binary representation are as follows:
   n  | 0 |  1  |    3   |     4     |       5      |        6        | ...
  ----+---+-----+--------+-----------+--------------+-----------------+----
  7^n | 1 |  7  |   49   |    343    |     2401     |      16807      | ...
  ----+---+-----+--------+-----------+--------------+-----------------+----
  bin | 1 | 111 | 110001 | 101010111 | 100101100001 | 100000110100111 | ...
  ----+---+-----+--------+-----------+--------------+-----------------+----
  a(n)| 1 |  3  |    3   |     6     |       5      |        7        | ...
  ----+---+-----+--------+-----------+--------------+-----------------+----
		

Crossrefs

Cf. A000120 (Hamming weight), A000420 (7^n).
Cf. A011754, A118738 (analog for 3^n and 5^n).

Programs

Formula

a(n) = A000120(A000420(n)). (Definition of this sequence.)

A371470 Triangle read by rows: for 1 <= k <= n, T(n,k) is the least sum of decimal digits of numbers with n binary digits and binary weight k.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 1, 2, 6, 7, 2, 3, 3, 4, 5, 4, 5, 6, 7, 9, 10, 8, 1, 2, 2, 3, 10, 11, 4, 2, 3, 4, 5, 7, 12, 13, 5, 4, 3, 4, 5, 6, 6, 7, 8, 7, 8, 6, 7, 1, 2, 3, 4, 6, 7, 5, 4, 2, 3, 2, 3, 3, 4, 6, 13, 14, 6, 5, 3, 4, 4, 3, 4, 6, 7, 8, 18, 19, 5, 6, 6, 5, 6, 6, 6, 7, 8, 9, 14, 19, 20, 7, 8, 5
Offset: 1

Views

Author

Robert Israel, May 31 2024

Keywords

Examples

			T(5,3) = 3 because the numbers with 5 binary digits of which 3 are 1 are 19, 21, 22, 25, 26 and 28, and the least sum of decimal digits of these is 3 (for 21).
Triangle starts:
  1;
  2, 3;
  4, 5, 7;
  8, 1, 2, 6;
  7, 2, 3, 3, 4;
  5, 4, 5, 6, 7, 9;
		

Crossrefs

Programs

  • Maple
    M:= proc(n,k) local i,R,m,r,v;
       R:= ListTools:-Reverse(map(t -> 2^(n-1)+add(2^(n-1-t[i]),i=1..k-1), combinat:-choose(n-1,k-1 )));
       m:= infinity;
       for r in R do
         v:= convert(convert(r,base,10),`+`);
         if v < m then m:= v fi;
       od;
       m
    end proc:
    for n from 1 to 12 do
      seq(M(n,k),k=1..n)
    od;

Formula

a(n) = A007953(A373289(n)).
T(A123384(i),A118738(i)) = 1.

A373289 Triangle read by rows: for 1 <= k <= n, T(n,k) is a number with n binary digits and binary weight k whose sum of decimal digits is least; in case of a tie, choose the least such number.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 10, 11, 15, 16, 20, 21, 30, 31, 32, 40, 41, 51, 61, 63, 64, 80, 100, 101, 110, 111, 127, 128, 130, 200, 201, 211, 221, 223, 255, 256, 320, 400, 300, 301, 311, 501, 510, 511, 512, 520, 521, 600, 601, 1000, 1001, 1011, 1021, 1023, 1024, 1040, 1030, 1100, 1101, 2000, 2001, 2010
Offset: 1

Views

Author

Robert Israel, May 30 2024

Keywords

Examples

			T(5,3) = 21 because 21 = 10101_2 has 5 binary digits of which 3 are 1, and it has a lower sum of decimal digits, 3, than the other numbers (19, 22, 25, 26 and 28) with 5 binary digits of which 3 are 1.
Triangle starts
   1;
   2,  3;
   4,  5,  7;
   8, 10, 11, 15;
  16, 20, 21, 30, 31;
  32, 40, 41, 51, 61, 63;
		

Crossrefs

Programs

  • Maple
    M:= proc(n,k) local i,R,m,b,r,v;
       R:= ListTools:-Reverse(map(t -> 2^(n-1)+add(2^(n-1-t[i]),i=1..k-1), combinat:-choose(n-1,k-1 )));
       m:= infinity;
       for r in R do
         v:= convert(convert(r,base,10),`+`);
         if v < m then b:= r; m:= v fi;
       od;
       b
    end proc:
    for n from 1 to 12 do
      seq(M(n,k),k=1..n)
    od;

Formula

T(A123384(i),A118738(i)) = 10^i.
T(m,1) = 2^(m-1).
T(m,m) = 2^m - 1.

A379446 a(n) is the number of ones in the binary expansion of 10^(10^n).

Original entry on oeis.org

2, 11, 105, 1163, 11683, 115979, 1161413, 11606847, 116093517, 1160951533, 11609679812, 116096181467, 1160963225086
Offset: 0

Views

Author

Hugo Pfoertner, Dec 26 2024

Keywords

Crossrefs

Programs

  • PARI
    a379446(n) = hammingweight(5^(10^n))

Formula

Conjectured: Limit_{n->oo} a(n)/10^n = log(5)/log(4). (A153201)

Extensions

a(12) from Markus Sigg, Dec 28 2024

A371971 a(n) is the least exponent m minimizing the percentage of set bits in the binary representation of prime(n)^m.

Original entry on oeis.org

24, 25, 12, 6, 16, 2, 10, 2, 7, 22, 16, 8, 15, 2, 14, 3, 20, 2, 4, 7, 21, 4, 19, 6, 13, 6, 7, 7, 3, 10, 2, 1, 9, 5, 2, 2, 6, 10, 36, 11, 13, 2, 2, 10, 9, 5, 2, 34, 5, 2, 4, 4, 8, 2, 9, 4, 6, 9, 3, 14, 38, 9, 14, 16, 2, 7, 4, 16, 3, 9, 6, 2, 4, 2, 10, 15, 10, 14, 6, 71, 31, 4
Offset: 2

Views

Author

Hugo Pfoertner, Apr 17 2024

Keywords

Crossrefs

Programs

  • PARI
    a371971(n,limit=10000) = {my(p=prime(n), q=1, m=1); for (k=1,limit, my (pp=p^k, h=hammingweight(pp), g=#binary(pp), qq=h/g); if (qq
    				

A320394 Number of ones in binary expansion n^5.

Original entry on oeis.org

0, 1, 1, 6, 1, 6, 6, 7, 1, 9, 6, 10, 6, 11, 7, 12, 1, 10, 9, 9, 6, 11, 10, 14, 6, 11, 11, 15, 7, 15, 12, 15, 1, 10, 10, 13, 9, 11, 9, 13, 6, 16, 11, 15, 10, 21, 14, 18, 6, 15, 11, 13, 11, 13, 15, 19, 7, 17, 15, 14, 12, 14, 15, 18, 1, 10, 10, 14, 10, 18, 13, 18
Offset: 0

Views

Author

Vincenzo Librandi, Nov 28 2018

Keywords

Comments

The binary weight of n^5.

Crossrefs

Programs

  • Magma
    [&+Intseq(n^5, 2): n in [0..79]];
    
  • Mathematica
    Table[DigitCount[n^5, 2][[1]], {n, 0, 100}]
  • PARI
    a(n) = hammingweight(n^5); \\ Michel Marcus, Nov 28 2018

Formula

a(n) = A000120(A000584(n)).
Showing 1-10 of 10 results.