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.

A006583 a(n) = Sum_{k=1..n-1} (k OR n-k).

This page as a plain text file.
%I A006583 M4069 #36 May 08 2023 03:24:45
%S A006583 1,6,8,16,25,42,44,56,69,94,108,136,165,210,208,224,241,278,296,336,
%T A006583 377,442,460,504,549,622,668,744,821,930,912,928,945,998,1016,1072,
%U A006583 1129,1226,1244,1304
%N A006583 a(n) = Sum_{k=1..n-1} (k OR n-k).
%D A006583 _Marc LeBrun_, personal communication.
%D A006583 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A006583 Michael De Vlieger, <a href="/A006583/b006583.txt">Table of n, a(n) for n = 2..8192</a>
%H A006583 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. 39.
%H A006583 M. Le Brun, <a href="/A006577/a006577.pdf">Email to N. J. A. Sloane, Jul 1991</a>
%F A006583 G.f.: 1/(1-x)^2 * sum(k>=0, 2^k*t^2(4t^2+6t+1)/(1+t)^2, t=x^2^k). - _Ralf Stephan_, Feb 12 2003
%F A006583 a(0)=a(1)=0, a(2n) = 2a(n)+2a(n-1)+5n-4, a(2n+1) = 4a(n)+6n. - _Ralf Stephan_, Oct 09 2003
%F A006583 a(n) = 2*(Sum_{k=1..floor((n-1)/2)} k OR n-k) + m where m is 0 if n is odd and n/2 otherwise. - _Chai Wah Wu_, May 07 2023
%t A006583 Table[Sum[BitOr[k,n-k],{k,n-1}],{n,2,50}] (* _Harvey P. Dale_, Dec 05 2020 *)
%o A006583 (PARI) a(n)=sum(k=1,n-1, bitor(k,n-k)) \\ _Charles R Greathouse IV_, Aug 11 2017
%o A006583 (Python)
%o A006583 def A006583(n): return (sum(k|n-k for k in range(1,n+1>>1))<<1)+(0 if n&1 else n>>1) # _Chai Wah Wu_, May 07 2023
%Y A006583 Antidiagonal sums of array A003986.
%K A006583 nonn,base
%O A006583 2,2
%A A006583 _N. J. A. Sloane_