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.

A074330 a(n) = Sum_{k=1..n} 2^b(k) where b(k) denotes the number of 1's in the binary representation of k.

This page as a plain text file.
%I A074330 #22 Oct 29 2022 11:51:30
%S A074330 2,4,8,10,14,18,26,28,32,36,44,48,56,64,80,82,86,90,98,102,110,118,
%T A074330 134,138,146,154,170,178,194,210,242,244,248,252,260,264,272,280,296,
%U A074330 300,308,316,332,340,356,372,404,408,416,424,440,448,464,480,512,520,536
%N A074330 a(n) = Sum_{k=1..n} 2^b(k) where b(k) denotes the number of 1's in the binary representation of k.
%H A074330 Robert Israel, <a href="/A074330/b074330.txt">Table of n, a(n) for n = 1..10000</a>
%H A074330 Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, <a href="https://arxiv.org/abs/2210.10968">Identities and periodic oscillations of divide-and-conquer recurrences splitting at half</a>, arXiv:2210.10968 [cs.DS], 2022, p. 29.
%F A074330 a(n+1)-a(n) = A001316(n)
%F A074330 From _Ralf Stephan_, Oct 07 2003: (Start)
%F A074330 a(0)=0, a(2n) = 2a(n-1) + a(n) + 2, a(2n+1) = 3a(n) + 2.
%F A074330 G.f.: (1/(1-x)) * Product_{k>=0} (1 + 2x^2^k). (End)
%p A074330 f:= proc(n) option remember; if n::even then 2*procname(n/2-1)+procname(n/2)+2
%p A074330   else 3*procname((n-1)/2)+2
%p A074330   fi
%p A074330 end proc:
%p A074330 f(0):= 0:
%p A074330 map(f, [$1..100]); # _Robert Israel_, Oct 08 2020
%t A074330 b[n_] := IntegerDigits[n, 2] // Total;
%t A074330 a[n_] := 2^(b /@ Range[n]) // Total;
%t A074330 Array[a, 100] (* _Jean-François Alcover_, Aug 16 2022 *)
%o A074330 (PARI) a(n)=sum(i=1,n,2^sum(k=1,length(binary(i)), component(binary(i),k)))
%Y A074330 a(n) = A006046(n+1)-1. Cf. A080263.
%K A074330 easy,nonn
%O A074330 1,1
%A A074330 _Benoit Cloitre_, Oct 06 2002