OFFSET
1,2
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
EXAMPLE
Representations as binary words (as in A371032) have decreasing runlengths:
1: 1
6: 110
57: 111001
966: 1111000110 (runlengths 4,3,2,1)
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 *)
PROG
(Python)
def A371033(n):
c = 0
for i in range(n):
c <<= n-i
if i&1^1:
c += (1<<n-i)-1
return c # Chai Wah Wu, Mar 18 2024
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Clark Kimberling, Mar 18 2024
EXTENSIONS
New name from Michel Marcus, Jul 09 2024
a(15) corrected by Alois P. Heinz, Jul 09 2024
STATUS
approved