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.

A079947 Partial sums of A030300.

This page as a plain text file.
%I A079947 #29 Jan 30 2023 19:34:39
%S A079947 1,1,1,2,3,4,5,5,5,5,5,5,5,5,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,
%T A079947 20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,
%U A079947 21,21,21,21,21,21,21,21,21,21,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36
%N A079947 Partial sums of A030300.
%H A079947 Kevin Ryde, <a href="/A079947/b079947.txt">Table of n, a(n) for n = 1..8192</a>
%H A079947 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, pp. 49-50.
%F A079947 a(n) = (n+1+(2/3)*(4^e_4-1)+(-1)^e_2*(n-1-2*(4^e_4-1)))/2 where e_4=floor(log[4](n)) and e_2=floor(log[2](n))=floor(log[4](n^2)). - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Feb 22 2003
%F A079947 a(n) = n - A079954(n).  Let k=A000523(n), then a(n) = n-A000975(k) if k even, or a(n) = A000975(k) if k odd. - _Kevin Ryde_, Jul 13 2019
%t A079947 Accumulate@ Flatten@ Table[1 - Mod[n, 2], {n, 0, 6}, {2^n}] (* _Michael De Vlieger_, Oct 29 2022 *)
%o A079947 (PARI) a(n) = my(k=logint(n,2), p=(2<<k)\3); if(bittest(k,0), p, n-p); /* _Kevin Ryde_, Jul 13 2019 */
%o A079947 (Python)
%o A079947 def A079947(n): return n-((1<<k)-2)//3 if (k:=n.bit_length())&1 else ((1<<k)-1)//3 # _Chai Wah Wu_, Jan 30 2023
%K A079947 nonn
%O A079947 1,4
%A A079947 _N. J. A. Sloane_, Feb 22 2003