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.

A089401 a(n) = m - A089398(2^m + n) for m>=n.

This page as a plain text file.
%I A089401 #19 Mar 29 2015 21:26:15
%S A089401 1,1,3,2,4,5,6,5,7,8,11,9,11,12,13,12,14,15,18,18,19,20,21,20,22,23,
%T A089401 26,24,26,27,28,27,29,30,33,33,36,36,37,36,38,39,42,40,42,43,44,43,45,
%U A089401 46,49,49,50,51,52,51,53,54,57,55,57,58,59,58,60,61,64,64,67,69,69,68,70
%N A089401 a(n) = m - A089398(2^m + n) for m>=n.
%C A089401 A089398(n) = n-th column sum of binary digits of k*2^(k-1), where summation is over all k>=1, without carrying from columns sums that may exceed 2.
%C A089401 Row sums of triangular arrays in A103582 and in A103583. - _Philippe Deléham_, Apr 04 2005
%F A089401 a(n) = n/2+1/2*sum(k=1, n, (-1)^floor((n-k)/2^(k-1))). - _Benoit Cloitre_, Mar 28 2005
%F A089401 Let a(0)=0; when n - 2^[log_2(n)] <= [log_2(n)] then a(n) = a(n - 2^[log_2(n)]) + n - [log_2(n)], else a(n) = a(n - 2^[log_2(n)]) + 2^[log_2(n)] - 1. Thus a(2^m) = 2^m - m for all m>=0; for 0<=k<=m: a(2^m + k) = a(k) + 2^m + k - m; for m<k<=2^m: a(2^m + k) = a(k) + 2^m - 1. - _Paul D. Hanna_, Mar 28 2005
%e A089401 a(6)=5 since 7 - A089398(2^7 + 6) = 7 - 2 = 5.
%t A089401 f[n_] := Block[{lg = Floor[Log[2, n]] + 1}, Sum[ Join[ Reverse[ IntegerDigits[n - i + 1, 2]], {0}][[i]], {i, lg}]]; Table[n - f[2^n + n] + 2, {n, 0, 72}] (* _Robert G. Wilson v_, Mar 29 2005 *)
%o A089401 (PARI) a(n)=n/2+1/2*sum(k=1,n,(-1)^floor((n-k)/2^(k-1))) \\ _Benoit Cloitre_
%o A089401 (PARI) {a(n)=if(n<=0,0,m=floor(log(n)/log(2)); if(n-2^m<=m,n-m+a(n-2^m),2^m-1+a(n-2^m)))} \\ _Paul D. Hanna_, Mar 28 2005
%Y A089401 Cf. A089398, A089400.
%K A089401 nonn
%O A089401 1,3
%A A089401 _Paul D. Hanna_, Oct 30 2003
%E A089401 More terms from _Benoit Cloitre_ and _Robert G. Wilson v_, Mar 28 2005