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

A143071 A positive integer n is included if the number of 1's in the binary representation of n is a power of 2 (including being possibly 1).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 17, 18, 20, 23, 24, 27, 29, 30, 32, 33, 34, 36, 39, 40, 43, 45, 46, 48, 51, 53, 54, 57, 58, 60, 64, 65, 66, 68, 71, 72, 75, 77, 78, 80, 83, 85, 86, 89, 90, 92, 96, 99, 101, 102, 105, 106, 108, 113, 114, 116, 120, 128, 129, 130, 132, 135
Offset: 1

Views

Author

Leroy Quet, Jul 22 2008

Keywords

Examples

			34 in binary is 100010. This has 2 ones. And since 2 is a power of 2, 34 is included in the sequence.
		

Crossrefs

For complement see A271499.

Programs

  • Haskell
    a143071 n = a143071_list !! (n-1)
    a143071_list = filter ((== 1) . a209229 . a000120) [1..]
    -- Reinhard Zumkeller, Sep 14 2014
  • Maple
    a:=proc(n) local nn, n1: nn:=convert(n,base,2): n1:=add(nn[j],j=1..nops(nn)): if 0 < n1 and type(log[2](n1),integer)=true then n else end if end proc: seq(a(n),n=1..140); # Emeric Deutsch, Aug 13 2008
  • Mathematica
    Select[Range[150],IntegerQ[Log2[DigitCount[#,2,1]]]&] (* Harvey P. Dale, Sep 26 2020 *)

Formula

A209229(A000120(a(n))) = 1. - Reinhard Zumkeller, Sep 14 2014

Extensions

More terms from Emeric Deutsch, Aug 13 2008

A143070 A positive integer n is included if the number of 0's in the binary representation of n is a power of 2 (including being possibly 1).

Original entry on oeis.org

2, 4, 5, 6, 9, 10, 11, 12, 13, 14, 16, 19, 21, 22, 23, 25, 26, 27, 28, 29, 30, 33, 34, 36, 39, 40, 43, 45, 46, 47, 48, 51, 53, 54, 55, 57, 58, 59, 60, 61, 62, 67, 69, 70, 73, 74, 76, 79, 81, 82, 84, 87, 88, 91, 93, 94, 95, 97, 98, 100, 103, 104, 107, 109, 110, 111, 112, 115
Offset: 1

Views

Author

Leroy Quet, Jul 22 2008

Keywords

Examples

			34 in binary is 100010. This has 4 zeros. And since 4 is a power of 2, 34 is included in the sequence.
		

Crossrefs

Programs

  • Haskell
    a143070 n = a143070_list !! (n-1)
    a143070_list = filter ((== 1) . a209229 . a023416) [1..]
    -- Reinhard Zumkeller, Sep 14 2014
    
  • Maple
    a:=proc(n) local nn,n0: nn:=convert(n,base,2): n0:=nops(nn)-add(nn[j], j=1.. nops(nn)): if 0 < n0 and type(log[2](n0),integer)=true then n else end if end proc: seq(a(n),n=1..100); # Emeric Deutsch, Aug 11 2008
  • Mathematica
    Select[Range@ 120, IntegerQ@ Log2@ DigitCount[#, 2, 0] &] (* Michael De Vlieger, Oct 25 2017 *)
  • PARI
    ispow2(n) = (n==1) || (n==2) || (ispower(n,,&k) && (k==2));
    isok(n) = ispow2(#binary(n) - hammingweight(n)); \\ Michel Marcus, Oct 26 2017

Formula

A209229(A023416(a(n))) = 1. - Reinhard Zumkeller, Sep 14 2014

Extensions

More terms from Emeric Deutsch, Aug 11 2008
a(61)-a(68) from Ray Chandler, Jun 20 2009
Showing 1-2 of 2 results.