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.
%I A105033 #36 Apr 07 2025 10:00:24 %S A105033 0,1,0,3,2,1,4,7,6,5,0,11,10,9,12,15,14,13,8,3,18,17,20,23,22,21,16, %T A105033 27,26,25,28,31,30,29,24,19,2,33,36,39,38,37,32,43,42,41,44,47,46,45, %U A105033 40,35,50,49,52,55,54,53,48,59,58,57,60,63,62,61,56,51,34,1,68,71,70,69,64,75 %N A105033 Read binary numbers downwards to the right. %C A105033 Equals A103530(n+2) - 1. - _Philippe Deléham_, Apr 06 2005 %C A105033 This sequence can also be produced as follows: %C A105033 Using binary arithmetic, start with zero and repeatedly add 1 while deferring carries one iteration. %C A105033 a(0) = 0, c(0) = 1 %C A105033 a(n) = a(n-1) XOR c(n-1) %C A105033 c(n) = (a(n-1) AND c(n-1))*2+1 %C A105033 where c is the carries, XOR is bitwise exclusive-or, and AND is bitwise and. %C A105033 This has the property that a(n) = n-c(n)+1. - _Christopher Scussel_, Jan 31 2025 %H A105033 David Applegate, Benoit Cloitre, Philippe Deléham and N. J. A. Sloane, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL8/Sloane/sloane300.html">Sloping binary numbers: a new sequence related to the binary numbers</a>, J. Integer Seq. 8 (2005), no. 3, Article 05.3.6, 15 pp. %F A105033 a(n) = n - Sum_{ k >= 0, 2^{k+1} <= n, n == k mod 2^(k+1) } 2^(k+1). %F A105033 Structure: blocks of size 2^k taken from A105025, interspersed with terms a(n) itself! Thus a(2^k + k - 1 ) = a(k-1) for k >= 1. %F A105033 From _David Applegate_, Apr 06 2005: (Start) %F A105033 "a(n) = 2^k + a(n-2^k) if k >= 1 and 0 <= n - 2^k - k < 2^k, = a(n-2^k) if k >= 1 and n - 2^k - k = -1, or = 0 if n = 0 (and exactly one of the three conditions is true for any n >= 0). %F A105033 "Equivalently, a(2^k + k + x) = 2^k + a(k+x) if 0 <= x < 2^k, = a(k+x) if x = -1 (for each n >= 0, there is a unique k, x such that 2^k + k + x = n, k >= 0, -1 <= x < 2^k). This recurrence follows immediately from the definition. %F A105033 "The recurrence captures three observed facts about a: a(2^k + k - 1) = a(k-1); a consists of blocks of length 2^k of A105025 interspersed with terms of a; a(n) = n - Sum_{ k >= 0, 2^{k+1} <= n, n = k mod 2^(k+1) } 2^(k+1)." (End) %F A105033 a(n) = sum_{k=0..n} A103589(n,k)*2^(n-k). - _L. Edson Jeffery_, Dec 01 2013 %e A105033 Start with the binary numbers: %e A105033 ......0 %e A105033 ......1 %e A105033 .....10 %e A105033 .....11 %e A105033 ....100 %e A105033 ....101 %e A105033 ....110 %e A105033 ....111 %e A105033 ...1000 %e A105033 ....... %e A105033 and read downwards to the right, getting 0, 1, 0, 11, 10, 1, 100, 111, ... %p A105033 f:= proc (n) local t1, l; t1 := n; for l from 0 to n do if `mod`(n-l,2^(l+1)) = 0 and n >= 2^(l+1) then t1 := t1-2^(l+1) fi; od; t1; end proc; %t A105033 f[n_] := Block[{k = 0, s = 0}, While[2^(k + 1) < n + 1, If[ Mod[n, 2^(k + 1)] == k, s = s + 2^(k + 1)]; k++ ]; n - s]; Table[ f[n], {n, 0, 75}] (* _Robert G. Wilson v_, Apr 06 2005 *) %Y A105033 Analog of A102370. Cf. A105034, A105025. %Y A105033 Cf. triangular array in A103589. %K A105033 nonn,base %O A105033 0,4 %A A105033 _N. J. A. Sloane_, Apr 04 2005