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.
%I A206920 #45 Sep 18 2018 04:41:12 %S A206920 0,1,4,9,16,25,40,57,78,105,136,169,214,265,328,393,466,551,644,743, %T A206920 850,969,1096,1225,1378,1543,1732,1927,2146,2377,2632,2889,3162,3459, %U A206920 3772,4097,4438,4803,5184,5571,5974,6401,6844,7299,7770,8265,8776,9289,9850 %N A206920 Sum of the first n binary palindromes; a(n) = Sum_{k=1..n} A006995(k). %C A206920 Different from A206919. %H A206920 Reinhard Zumkeller, <a href="/A206920/b206920.txt">Table of n, a(n) for n = 1..10000</a> %F A206920 Let n > 3, p = A006995(n), m = floor(log_2(p)), then %F A206920 a(n) = (8/7)*((3/4)*(4 - (-1)^m)/(3 + (-1)^m)*2^(3*floor(m/2)) - 1) + (floor(p/2^floor(m/2)) mod 2)*p + 2^m + 1 + Sum_{k = 1..(floor(m/2) - 1)} (floor(p/2^k) mod 2)*(2^k + 2^(m-k) + 2^(m-floor(m/2) + 1)*(4^(floor(m/2) - k - 1) - 1) + (2 - (-1)^m)*2^floor(m/2) + 2^(floor(m/2) - k)*(p - floor((p mod (2^(m-k+1)))/2^k)*2^k)). - [Corrected; missing factor to the sum term (2 -(-1)^m) pasted by the author, Sep 07 2018] %F A206920 From _Hieronymus Fischer_, Sep 07 2018: (Start) %F A206920 Slightly simplified and better readable formula: %F A206920 a(n) = A_m + B_m + 2^m + 1 + Sum_{k = 1..(m2-1)} C_k*(D_k + E_k + F_k + G_k), %F A206920 where m2 = floor(m/2), %F A206920 A_m = (8/7)*((3/4)*(4-(-1)^m)/(3+(-1)^m)*2^(3*m2)-1), %F A206920 B_m = p*(floor(p/2^m2) mod 2), %F A206920 C_k = floor(p/2^k) mod 2, %F A206920 D_k = 2^k + 2^(m-k), %F A206920 E_k = 2^(m-m2+1)*(4^(m2-k-1)-1), %F A206920 F_k = (2 - (-1)^m)*2^m2, %F A206920 G_k = 2^(m2-k) * (p - p mod (2^(m-k+1)) + p mod 2^k). (End) %F A206920 G.f.: g(x) = (x^2 + 3x^3 + Sum_{j >= 1} (3*2^j*(1 - x^floor((j+1)/2))/(1-x)*x^((1/2) - floor((j+1)/2)) + f_j(x) - f_j(1/x))*x^(2*2^floor(j/2) + 3*2^floor((j-1)/2) - (1/2)))/(1-x), where the f_j(x) are the same as defined for the g.f. of A006995. %e A206920 a(1) = 0, since A006995(1) = 0; %e A206920 a(4) = 9, since the sum of the first 4 binary palindromes is 9 = 0 + 1 + 3 + 5. %t A206920 Accumulate@ Map[FromDigits[#, 2] &, Select[Array[IntegerDigits[#, 2] &, 600, 0], PalindromeQ]] (* _Michael De Vlieger_, Feb 20 2018 *) %o A206920 (Haskell) %o A206920 a206920 n = a206920_list !! (n-1) %o A206920 a206920_list = scanl1 (+) a006995_list %o A206920 -- _Reinhard Zumkeller_, Feb 27 2012 %Y A206920 Cf. A006995, A206918, A206919. %K A206920 nonn,base %O A206920 1,3 %A A206920 _Hieronymus Fischer_, Feb 18 2012