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.

This page as a plain text file.
%I A371033 #32 Jul 09 2024 16:31:09
%S A371033 1,6,57,966,31801,2065350,266370105,68453106630,35115918982201,
%T A371033 35993681099981766,73750982613738224697,302157703921043555451846,
%U A371033 2475577920866839506242796601,40562343629382474008388259775430,1329187433441286490429798672020569145
%N 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.
%F A371033 a(n) == n (mod 2). - _Alois P. Heinz_, Jul 09 2024
%F A371033 a(n) = 2^(n*(n+1)/2) - 1 - a(n-1). - _Robert Israel_, Jul 09 2024
%e A371033 Representations as binary words (as in A371032) have decreasing runlengths:
%e A371033     1:  1
%e A371033     6:  110
%e A371033    57:  111001
%e A371033   966:  1111000110  (runlengths 4,3,2,1)
%p A371033 a:= n-> Bits[Join]([seq((1-(n-i) mod 2)$i, i=1..n)]):
%p A371033 seq(a(n), n=1..15);  # _Alois P. Heinz_, Jul 09 2024
%t A371033 Map[FromDigits[#, 2] &, Table[Flatten[Map[ConstantArray[Mod[#, 2], n + 1 - #] &, Range[n]]], {n, 16}]]    (* _Peter J. C. Moses_, Mar 08 2024 *)
%o A371033 (Python)
%o A371033 def A371033(n):
%o A371033     c = 0
%o A371033     for i in range(n):
%o A371033         c <<= n-i
%o A371033         if i&1^1:
%o A371033             c += (1<<n-i)-1
%o A371033     return c # _Chai Wah Wu_, Mar 18 2024
%Y A371033 Cf. A006125, A007088, A065760, A126883, A371032 (binary version).
%K A371033 nonn,base,easy
%O A371033 1,2
%A A371033 _Clark Kimberling_, Mar 18 2024
%E A371033 New name from _Michel Marcus_, Jul 09 2024
%E A371033 a(15) corrected by _Alois P. Heinz_, Jul 09 2024