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.

A386705 a(n) = sum of the 2^(n-1) even positive integers having bit length 2*n and in which, when written in binary, each run of 0's is of exactly the same length as the run of 1's immediately before it.

Original entry on oeis.org

2, 22, 192, 1576, 12704, 101856, 815360, 6524032, 52194816, 417564160, 3340525568, 26724231168, 213793906688, 1710351376384, 13682811273216, 109462490742784, 875699927121920, 7005599419465728, 56044795360968704, 448358362898759680, 3586866903213146112, 28694935225753403392
Offset: 1

Views

Author

Paolo Xausa, Aug 28 2025

Keywords

Comments

Row sums of A166751, when viewed as an irregular triangle whose row terms have the same number of bits (see the Example section there).

Examples

			For n = 3, the 2^(n-1) terms with bit length 2*n = 6 satisfying the criteria are (in binary): 101010, 101100, 110010 and 111000, corresponding (in decimal) to 42, 44, 50 and 56, giving a sum of 192.
		

Crossrefs

Cf. A166751.

Programs

  • Mathematica
    A386705[n_] := With[{b = Array[IntegerDigits[4^# - 2^#, 2] &, n]}, Total[Map[FromDigits[Flatten[#], 2] &, Map[b[[#]] &, Map[Permutations, IntegerPartitions[n]], {2}], {2}], 2]];
    Array[A386705, 20]

Formula

Empirical: a(n) = 12*a(n-1) - 36*a(n-2) + 32*a(n-3), with a(1) = 2, a(2) = 22, a(3) = 192.