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.

A265917 a(n) = floor(A070939(n)/A000120(n)) where A070939(n) is the binary length of n and A000120(n) is the binary weight of n.

Original entry on oeis.org

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

Views

Author

Alex Ratushnyak, Dec 18 2015

Keywords

Comments

1/a(n) gives a very rough approximation of the density of 1-bits in the binary representation (A007088) of n. This is 1 if more than half of the bits of n are 1. - Antti Karttunen, Dec 19 2015

Crossrefs

Programs

  • Mathematica
    Table[Floor[IntegerLength[n, 2]/Total@ IntegerDigits[n, 2]], {n, 120}] (* Michael De Vlieger, Dec 21 2015 *)
  • PARI
    a(n) = #binary(n)\hammingweight(n); \\ Michel Marcus, Dec 19 2015
  • Python
    for n in range(1, 88):
        print(str((len(bin(n))-2) // bin(n).count('1')), end=',')
    

A265918 a(n) = A070939(n) mod A000120(n), where A070939(n) is the binary length of n and A000120(n) is the binary weight of n.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2, 2, 1, 0, 0, 0, 2, 0, 2, 2, 1, 0, 2, 2, 1, 2, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 3, 2, 1, 1, 1, 3, 1, 3, 3
Offset: 1

Views

Author

Alex Ratushnyak, Dec 18 2015

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Mod[IntegerLength[n, 2], Total@ IntegerDigits[n, 2]], {n, 120}] (* Michael De Vlieger, Dec 21 2015 *)
  • PARI
    a(n) = #binary(n) % hammingweight(n); \\ Michel Marcus, Dec 19 2015
  • Python
    for n in range(1, 88): print((len(bin(n))-2) % bin(n).count('1'), end=', ')
    

A135993 a(0) = 0; a(n) = (floor(n/S2(n))) mod 2 for n >= 1, where S2(n) is the binary weight of n.

Original entry on oeis.org

0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1
Offset: 0

Views

Author

Ctibor O. Zizka, Mar 03 2008

Keywords

Examples

			a(17) = floor(17/2) mod 2 = 0.
a(18) = floor(18/2) mod 2 = 1.
		

Crossrefs

Programs

  • PARI
    a(n) = if (n==0, 0, n\hammingweight(n) % 2); \\ Michel Marcus, Feb 04 2016

Formula

a(n) = A135941(n) mod 2 for n > 0. - Michel Marcus, Feb 04 2016

Extensions

Converted references into links - R. J. Mathar, Oct 30 2009

A264749 a(n) = floor(n/BL(n)) where BL(n) = A070939(n) is the binary length of n.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 12
Offset: 0

Views

Author

Alex Ratushnyak, Nov 23 2015

Keywords

Crossrefs

Programs

  • Haskell
    a264749 n = div n $ a070939 n  -- Reinhard Zumkeller, Dec 05 2015
  • Mathematica
    {0}~Join~Table[Floor[n/IntegerLength[n, 2]], {n, 84}] (* Michael De Vlieger, Dec 01 2015 *)
  • PARI
    a(n) = if (n, n\#binary(n)); \\ Michel Marcus, Dec 01 2015
    
  • Python
    for n in range(88):  print(n // (len(bin(n))-2), end=', ')
    
Showing 1-4 of 4 results.