login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A166456
Row sums of triangle A166455.
2
1, 2, 6, 12, 30, 60, 124, 248, 510, 1020, 2044, 4088, 8188, 16376, 32760, 65520, 131070, 262140, 524284, 1048568, 2097148, 4194296, 8388600, 16777200, 33554428, 67108856, 134217720, 268435440, 536870904, 1073741808, 2147483632, 4294967264, 8589934590, 17179869180
OFFSET
0,2
FORMULA
a(n) = 2^(n+1) - A001316(n). - R. J. Mathar, Oct 30 2009
EXAMPLE
a(3) = 12 = (1 + 5 + 5 + 1).
MATHEMATICA
a[n_] := 2^(n+1) - 2^DigitCount[n, 2, 1]; Array[a, 31, 0] (* Amiram Eldar, Aug 01 2023 *)
PROG
(Python)
def A000120(n):
a = 0
while n > 0:
a += n % 2
n //= 2
return a
def A001316(n):
return 2**A000120(n)
def A166456(n):
return 2**(n+1) - A001316(n)
print([A166456(n) for n in range(80)])
# R. J. Mathar, Oct 30 2009
CROSSREFS
Sequence in context: A005417 A058215 A330542 * A162214 A309728 A100071
KEYWORD
nonn
AUTHOR
Gary W. Adamson, Oct 14 2009
EXTENSIONS
Extended by R. J. Mathar, Oct 30 2009
STATUS
approved