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

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

A143072 A positive integer n is included if both the number of 0's and the number of 1's in the binary representation of n are powers of 2 (including being possibly 1).

Original entry on oeis.org

2, 4, 5, 6, 9, 10, 12, 16, 23, 27, 29, 30, 33, 34, 36, 39, 40, 43, 45, 46, 48, 51, 53, 54, 57, 58, 60, 135, 139, 141, 142, 147, 149, 150, 153, 154, 156, 163, 165, 166, 169, 170, 172, 177, 178, 180, 184, 195, 197, 198, 201, 202, 204, 209, 210, 212, 216, 225, 226, 228
Offset: 1

Views

Author

Leroy Quet, Jul 22 2008

Keywords

Examples

			34 in binary is 100010. This has 4 zeros and 2 ones. And since 4 and 2 are both powers of 2, 34 is included in the sequence.
		

Crossrefs

Programs

  • Haskell
    a143072 n = a143072_list !! (n-1)
    a143072_list = filter ((== 1) . a209229 . a023416) a143071_list
    -- Reinhard Zumkeller, Sep 14 2014
  • Mathematica
    p2Q[n_]:=And@@(IntegerQ[Log[2,#]]&/@DigitCount[n,2]); Select[Range[250], p2Q] (* Harvey P. Dale, Aug 20 2013 *)

Formula

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

Extensions

Extended by Ray Chandler, Jun 20 2009

A271499 Positive numbers n such that the number of 1's in the binary expansion of n is not a power of 2.

Original entry on oeis.org

7, 11, 13, 14, 19, 21, 22, 25, 26, 28, 31, 35, 37, 38, 41, 42, 44, 47, 49, 50, 52, 55, 56, 59, 61, 62, 63, 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, 117, 118, 119, 121, 122, 123, 124, 125, 126, 127, 131, 133, 134, 137, 138, 140
Offset: 1

Views

Author

N. J. A. Sloane, Apr 16 2016

Keywords

Examples

			127 = 1111111_2 has seven 1's, so is a term (this distinguishes the sequence from A235336).
		

Crossrefs

Complement of A143071.
Similar to but different from A075930, A235336 and A271500.

Programs

  • Mathematica
    Select[Range@ 140, ! IntegerQ@ Log2@ First@ DigitCount[#, 2] &] (* Michael De Vlieger, Apr 16 2016 *)
  • PARI
    lista(nn) = {for (n=1, nn, my(nbd = hammingweight(n)); if (!((nbd==1) || (nbd==2) || (ispower(nbd,,&k) && (k==2))), print1(n, ", ")););} \\ Michel Marcus, Apr 16 2016
    
  • Python
    A271499_list = [n for n in range(1,10**6) if bin(bin(n).count('1')).count('1') != 1] # Chai Wah Wu, Apr 16 2016

A355810 a(n) is the number at the apex of a triangle whose base contains the distinct powers of 2 summing to n (in ascending order), and each number in a higher row is the bitwise XOR of the two numbers directly below it; a(0) = 0.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 5, 8, 9, 10, 9, 12, 9, 10, 15, 16, 17, 18, 17, 20, 17, 18, 23, 24, 17, 18, 27, 20, 29, 30, 17, 32, 33, 34, 33, 36, 33, 34, 39, 40, 33, 34, 43, 36, 45, 46, 33, 48, 33, 34, 51, 36, 53, 54, 33, 40, 57, 58, 33, 60, 33, 34, 51, 64, 65, 66, 65
Offset: 0

Views

Author

Rémy Sigrist, Jul 18 2022

Keywords

Examples

			For n = 27:
- we have the following triangle:
          27
         9  18
       3  10  24
     1   2   8  16
- so a(27) = 27.
		

Crossrefs

See A355807 for similar sequences.

Programs

  • PARI
    a(n) = { my (b=vector(hammingweight(n))); for (k=1, #b, n-=b[k]=2^valuation(n,2)); while (#b>1, b=vector(#b-1, k, bitxor(b[k+1], b[k]))); if (#b, b[1], 0) }

Formula

a(n) <= n with equality iff n = 0 or n belongs to A143071.
a(2*n) = 2*a(n).
Showing 1-4 of 4 results.