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-5 of 5 results.

A059011 Odd number of 0's and 1's in binary expansion.

Original entry on oeis.org

2, 8, 11, 13, 14, 32, 35, 37, 38, 41, 42, 44, 47, 49, 50, 52, 55, 56, 59, 61, 62, 128, 131, 133, 134, 137, 138, 140, 143, 145, 146, 148, 151, 152, 155, 157, 158, 161, 162, 164, 167, 168, 171, 173, 174, 176, 179, 181, 182, 185, 186, 188, 191, 193, 194, 196, 199
Offset: 1

Views

Author

Patrick De Geest, Dec 15 2000

Keywords

Crossrefs

Programs

  • Haskell
    a059011 n = a059011_list !! (n-1)
    a059011_list = filter (odd . a071295) [0..]
    -- Reinhard Zumkeller, Aug 09 2014
  • Mathematica
    Select[Range[200],EvenQ[IntegerLength[#,2]]&&OddQ[DigitCount[#,2,1]]&] (* Harvey P. Dale, Oct 16 2012 *)
  • PARI
    is(n)=hammingweight(n)%2 && hammingweight(bitneg(n, #binary(n)))%2 \\ Charles R Greathouse IV, Mar 26 2013
    

Formula

A071295(a(n)) is odd. - Reinhard Zumkeller, Aug 09 2014

A301896 a(n) = product of total number of 0's and total number of 1's in binary expansions of 0, ..., n.

Original entry on oeis.org

0, 1, 4, 8, 20, 35, 54, 72, 117, 165, 221, 280, 352, 425, 504, 576, 726, 875, 1036, 1200, 1386, 1575, 1776, 1976, 2214, 2451, 2700, 2944, 3216, 3479, 3750, 4000, 4455, 4897, 5355, 5808, 6300, 6789, 7296, 7800, 8364, 8925, 9504, 10080, 10695, 11305, 11931, 12544, 13260, 13965, 14688
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 28 2018

Keywords

Examples

			+---+-----+---+---+---+---+----------+
| n | bin.|0's|sum|1's|sum|   a(n)   |
+---+-----+---+---+---+---+----------+
| 0 |   0 | 1 | 1 | 0 | 0 | 1*0 =  0 |
| 1 |   1 | 0 | 1 | 1 | 1 | 1*1 =  1 |
| 2 |  10 | 1 | 2 | 1 | 2 | 2*2 =  4 |
| 3 |  11 | 0 | 2 | 2 | 4 | 2*4 =  8 |
| 4 | 100 | 2 | 4 | 1 | 5 | 4*5 = 20 |
| 5 | 101 | 1 | 5 | 2 | 7 | 5*7 = 35 |
| 6 | 110 | 1 | 6 | 2 | 9 | 6*9 = 54 |
+---+-----+---+---+---+---+----------+
bin. - n written in base 2;
0's - number of 0's in binary expansion of n;
1's - number of 1's in binary expansion of n;
sum - total number of 0's (or 1's) in binary expansions of 0, ..., n.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=0, [1, 0], b(n-1)+
         (l-> [add(1-i, i=l), add(i, i=l)])(Bits[Split](n)))
        end:
    a:= n-> (l-> l[1]*l[2])(b(n)):
    seq(a(n), n=0..50);  # Alois P. Heinz, Mar 01 2023
  • Mathematica
    Accumulate[DigitCount[Range[0, 50], 2, 0]] Accumulate[DigitCount[Range[0, 50], 2, 1]]
  • Python
    def A301896(n): return (2+(n+1)*(m:=(n+1).bit_length())-(1<Chai Wah Wu, Mar 01 2023
    
  • Python
    def A301896(n): return (a:=(n+1)*n.bit_count()+(sum((m:=1<>j)-(r if n<<1>=m*(r:=k<<1|1) else 0)) for j in range(1,n.bit_length()+1))>>1))*(2+(n+1)*(t:=(n+1).bit_length())-(1<Chai Wah Wu, Nov 11 2024

Formula

a(n) = A059015(n)*A000788(n).
a(2^k-1) = 2^(k-2)*(2^k*(k - 2) + 4)*k.

A071639 Numbers k such that core(k) = b(k,1)*b(k,0) where b(k,1) is the number of 1's in binary representation of k, b(k,0) the number of 0's and core(k) the squarefree part of k.

Original entry on oeis.org

24, 3500, 6048, 52855, 56320, 67270, 71874, 80920, 85536, 95830, 105600, 112000, 117670, 131625, 142373, 155925, 250173, 262392, 280800, 350142, 360672, 673036, 965419, 984256, 1041859, 1078110, 1144440, 1166990, 1283040, 1331000, 1355310, 1454750, 1480160, 1691360
Offset: 1

Views

Author

Benoit Cloitre, Jun 22 2002

Keywords

Crossrefs

Programs

  • Mathematica
    core[n_] := Times @@ (First[#]^Mod[Last[#], 2]& /@ FactorInteger[n]); b[n_] := Times @@ DigitCount[n, 2, {0, 1}]; Select[Range[10^5], core[#] == b[#] &] (* Amiram Eldar, Sep 03 2020 *)
  • PARI
    for(s=1,500000,b=binary(s); l=length(b); if(sum(i=1,l,if(component(b,i)-1,0,1))*sum(i=1,l,if(component(b,i),0,1))==core(s),print1(s,",")))

Extensions

More terms from Amiram Eldar, Sep 03 2020

A173346 Numbers such that the product of numbers of 0's and 1's in the binary representation is equal to the square root of the number.

Original entry on oeis.org

0, 4, 16, 144, 324, 625
Offset: 1

Views

Author

Keywords

Comments

From Rémy Sigrist, Apr 30 2017: (Start)
In binary:
- the product of numbers of 0's and 1's for an N-digit number is at most N^2/4,
- the least N-digit number is 2^(N-1),
- for N >= 11, (N^2/4)^2 < 2^(N-1).
Hence there are no terms >= 2^10.
(End)

Examples

			625 -> 1001110001; five '0' and five '1'; 5*5=25; sqrt(625)=25.
324 -> 101000100; 3 '0' and 6 '1'; 3*6=18; sqrt(324)=18.
		

Crossrefs

Cf. A071295.

Programs

  • Mathematica
    Select[Range[8! ],DigitCount[ #,2,0]*DigitCount[ #,2,1]==Sqrt[ # ]&]
  • PARI
    isok(n) =  {n1 = hammingweight(n); n0 = #binary(n) - n1; (n0*n1)^2 == n;} \\ Michel Marcus, Nov 19 2015

Formula

Terms satisfy m = A071295(m)^2. - Michel Marcus, Nov 19 2015

Extensions

Minor edits by N. J. A. Sloane, Feb 21 2010
a(1) = 0 inserted by Michel Marcus, Nov 19 2015

A301895 a(n) = (number of 1's in binary expansion of n)^(number of 0's in binary expansion of n).

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 2, 1, 1, 4, 4, 3, 4, 3, 3, 1, 1, 8, 8, 9, 8, 9, 9, 4, 8, 9, 9, 4, 9, 4, 4, 1, 1, 16, 16, 27, 16, 27, 27, 16, 16, 27, 27, 16, 27, 16, 16, 5, 16, 27, 27, 16, 27, 16, 16, 5, 27, 16, 16, 5, 16, 5, 5, 1, 1, 32, 32, 81, 32, 81, 81, 64, 32, 81, 81, 64, 81, 64, 64, 25, 32
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 28 2018

Keywords

Comments

Union of A000079 and A000225 without zero gives positions of ones.

Examples

			+---+------+---+---+---------+
| n | bin. |1's|0's|  a(n)   |
+---+------+---+---+---------+
| 0 |    0 | 0 | 1 | 0^1 = 0 |
| 1 |    1 | 1 | 0 | 1^0 = 1 |
| 2 |   10 | 1 | 1 | 1^1 = 1 |
| 3 |   11 | 2 | 0 | 2^0 = 1 |
| 4 |  100 | 1 | 2 | 1^2 = 1 |
| 5 |  101 | 2 | 1 | 2^1 = 2 |
| 6 |  110 | 2 | 1 | 2^1 = 2 |
| 7 |  111 | 3 | 0 | 3^0 = 1 |
| 8 | 1000 | 1 | 3 | 1^3 = 1 |
| 9 | 1001 | 2 | 2 | 2^2 = 4 |
+---+------+---+---+---------+
bin. - n written in base 2;
1's - number of 1's in binary expansion of n;
0's - number of 0's in binary expansion of n.
		

Crossrefs

Programs

  • Mathematica
    DigitCount[Range[0, 80], 2, 1]^DigitCount[Range[0, 80], 2, 0]

Formula

a(n) = A000120(n)^A023416(n).
a(A000051(n)) = A011782(n).
Showing 1-5 of 5 results.