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.

A371033 a(n) is the integer whose binary expansion starts with 1 and such that the runs of identical bits have lengths n, n-1, n-2, ..., 3, 2, 1.

Original entry on oeis.org

1, 6, 57, 966, 31801, 2065350, 266370105, 68453106630, 35115918982201, 35993681099981766, 73750982613738224697, 302157703921043555451846, 2475577920866839506242796601, 40562343629382474008388259775430, 1329187433441286490429798672020569145
Offset: 1

Views

Author

Clark Kimberling, Mar 18 2024

Keywords

Examples

			Representations as binary words (as in A371032) have decreasing runlengths:
    1:  1
    6:  110
   57:  111001
  966:  1111000110  (runlengths 4,3,2,1)
		

Crossrefs

Cf. A006125, A007088, A065760, A126883, A371032 (binary version).

Programs

  • Maple
    a:= n-> Bits[Join]([seq((1-(n-i) mod 2)$i, i=1..n)]):
    seq(a(n), n=1..15);  # Alois P. Heinz, Jul 09 2024
  • Mathematica
    Map[FromDigits[#, 2] &, Table[Flatten[Map[ConstantArray[Mod[#, 2], n + 1 - #] &, Range[n]]], {n, 16}]]    (* Peter J. C. Moses, Mar 08 2024 *)
  • Python
    def A371033(n):
        c = 0
        for i in range(n):
            c <<= n-i
            if i&1^1:
                c += (1<Chai Wah Wu, Mar 18 2024

Formula

a(n) == n (mod 2). - Alois P. Heinz, Jul 09 2024
a(n) = 2^(n*(n+1)/2) - 1 - a(n-1). - Robert Israel, Jul 09 2024

Extensions

New name from Michel Marcus, Jul 09 2024
a(15) corrected by Alois P. Heinz, Jul 09 2024