A076178 a(n) = 2*n^2 - A077071(n).
0, 0, 0, 2, 2, 4, 6, 10, 10, 12, 14, 18, 20, 24, 28, 34, 34, 36, 38, 42, 44, 48, 52, 58, 60, 64, 68, 74, 78, 84, 90, 98, 98, 100, 102, 106, 108, 112, 116, 122, 124, 128, 132, 138, 142, 148, 154, 162, 164, 168, 172, 178, 182, 188, 194, 202, 206, 212, 218, 226, 232
Offset: 0
Keywords
Links
- Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, Exact and asymptotic solutions of the recurrence f(n) = f(floor(n/2)) + f(ceiling(n/2)) + g(n): theory and applications, preprint, 2016.
- Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, Exact and Asymptotic Solutions of a Divide-and-Conquer Recurrence Dividing at Half: Theory and Applications, ACM Transactions on Algorithms 13:4 (2017), #47.
- Ralf Stephan, Some divide-and-conquer sequences with (relatively) simple generating functions, 2004.
- Ralf Stephan, Table of generating functions (ps file).
- Ralf Stephan, Table of generating functions (pdf file).
Programs
-
PARI
a(n)=2*n^2-sum(k=0,n,-valuation(polcoeff(pollegendre(2*n),2*k),2))
-
Python
def A076178(n): return ((n+1)*n.bit_count()-n<<1)+sum((m:=1<
>j)-(r if n<<1>=m*(r:=k<<1|1) else 0)) for j in range(1,n.bit_length()+1)) # Chai Wah Wu, Nov 12 2024