cp's OEIS Frontend

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.

A329752 a(0) = 0, a(n) = a(floor(n/2)) + (n mod 2) * floor(log_2(2n))^2 for n > 0.

This page as a plain text file.
%I A329752 #34 Nov 21 2019 19:54:56
%S A329752 0,1,1,5,1,10,5,14,1,17,10,26,5,21,14,30,1,26,17,42,10,35,26,51,5,30,
%T A329752 21,46,14,39,30,55,1,37,26,62,17,53,42,78,10,46,35,71,26,62,51,87,5,
%U A329752 41,30,66,21,57,46,82,14,50,39,75,30,66,55,91,1,50,37,86
%N A329752 a(0) = 0, a(n) = a(floor(n/2)) + (n mod 2) * floor(log_2(2n))^2 for n > 0.
%H A329752 Alois P. Heinz, <a href="/A329752/b329752.txt">Table of n, a(n) for n = 0..16383</a>
%F A329752 If n = Sum_{i=0..m} c(i)*2^i, c(i) = 0 or 1, then a(n) = Sum_{i=0..m} c(i)*(m+1-i)^2.
%F A329752 a(2^n-1) = n*(n+1)*(2*n+1)/6 = A000330(n).
%F A329752 a(2^n) = 1.
%F A329752 a(2^n+1) = n^2 + 1 = A002522(n).
%e A329752 For n = 11 = 1011_2 we have a(11) = 1^2 + 3^2 + 4^2 = 1 + 9 + 16 = 26.
%p A329752 a:= n-> (l-> add(l[-i]*i^2, i=1..nops(l)))(convert(n, base, 2)):
%p A329752 seq(a(n), n=0..80);
%p A329752 # second Maple program:
%p A329752 a:= proc(n) option remember; `if`(n=0, 0,
%p A329752       a(iquo(n, 2))+`if`(n::odd, ilog2(2*n)^2, 0))
%p A329752     end:
%p A329752 seq(a(n), n=0..80);
%Y A329752 Cf. A000079, A000225, A000290, A000330, A000523, A002522, A008935, A029837, A029931, A070939, A113473, A230877.
%K A329752 nonn,look
%O A329752 0,4
%A A329752 _Alois P. Heinz_, Nov 20 2019