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”).
%I #13 Jan 31 2024 02:11:09
%S 0,2,7,12,26,34,45,56,100,114,131,148,174,194,217,240,392,418,447,476,
%T 514,546,581,616,684,722,763,804,854,898,945,992,1552,1602,1655,1708,
%U 1770,1826,1885,1944,2036,2098,2163,2228,2302,2370,2441,2512,2712,2786,2863
%N a(n) = Sum_{k=0..n} n OR k where OR is the bitwise logical OR operator (A003986).
%C The effect of n OR k is to force a 1-bit at all bit positions where n has a 1-bit, which means n*(n+1) in the sum. Bits of k where n has a 0-bit are NOT(n) AND k = n CNIMPL k so that a(n) = A350094(n) + n*(n+1).
%H Winston de Greef, <a href="/A350093/b350093.txt">Table of n, a(n) for n = 0..10000</a>
%F a(n) = ((3*n+2)*n + A001196(n)) / 4.
%F a(2*n) = 4*a(n) - n.
%F a(2*n+1) = 4*a(n) + 2*n + 2.
%F a(n) = A222423(n) + A224915(n), being OR = AND + XOR.
%o (PARI) a(n) = (3*(n^2 + fromdigits(binary(n),4)) + 2*n) >> 2;
%Y Cf. A003986 (bitwise OR), A001196 (bit doubling).
%Y Row sums of A080098.
%Y Other sums: A222423 (AND), A224915 (XOR), A265736 (IMPL), A350094 (CNIMPL).
%K base,easy,nonn
%O 0,2
%A _Kevin Ryde_, Dec 14 2021