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”).

A160020
Row sums of triangle in A160019 .
3
1, 4, 4, 16, 10, 18, 22, 64, 46, 46, 58, 76, 88, 94, 106, 256, 214, 198, 226, 196, 288, 246, 274, 312, 436, 370, 406, 388, 484, 438, 466, 1024, 934, 886, 946, 820, 1072, 934, 994, 808, 1348, 1186, 1254, 1012, 1396, 1126, 1186, 1264, 1996, 1786, 1870, 1516, 2044
OFFSET
0,2
LINKS
FORMULA
a(n) = b^2 + (n+1-b)*(n-b), where b = 2^A000120(n). - Andrew Howroyd, Feb 02 2020
EXAMPLE
Triangle A160019 begins : 1 ; 1,3 ; 1,0,3 ; 1,3,5,7 ; 1,0,2,4,3 ; 1,3,0,2,5,7 ; ...
PROG
(PARI) \\ here S(n, k) is A047999.S(n, k)={bitand(n-k, k)==0}a(n)={my(b=0); sum(k=0, n, if(S(n, k), b++; 2*b-1, 2*(k-b)))} \\ Andrew Howroyd, Feb 02 2020
(PARI) a(n)={my(b=2^hammingweight(n)); b^2 + (n+1-b)*(n-b)} \\ Andrew Howroyd, Feb 02 2020
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Philippe Deléham, Apr 29 2009
EXTENSIONS
Terms a(11) and beyond from Andrew Howroyd, Feb 02 2020
STATUS
approved