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 A352450 #11 Mar 20 2022 18:29:59 %S A352450 0,0,0,2,0,0,4,6,0,8,8,10,0,8,12,14,0,0,0,2,16,16,20,22,0,8,8,10,16, %T A352450 24,28,30,0,32,0,34,32,32,36,38,0,40,8,42,32,40,44,46,0,32,0,34,48,48, %U A352450 52,54,0,40,8,42,48,56,60,62,0,0,64,66,64,64,68,70,0 %N A352450 2^k appears in the binary expansion of a(n) iff 2^k appears in the binary expansion of n and k AND n > 0 (where AND denotes the bitwise AND operator). %C A352450 The idea is to keep the 1's in the binary expansion of a number whose positions are related in some way to that number. %H A352450 Rémy Sigrist, <a href="/A352450/b352450.txt">Table of n, a(n) for n = 0..8192</a> %H A352450 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %F A352450 a(n) <= n with equality iff n = 0. %e A352450 For n = 42: %e A352450 - 42 = 2^5 + 2^3 + 2^1, %e A352450 - 42 AND 5 = 0, %e A352450 - 42 AND 3 = 2 > 0, %e A352450 - 42 AND 1 = 0, %e A352450 - so a(42) = 2^3 = 8. %o A352450 (PARI) a(n) = { my (v=0, m=n, k); while (m, m-=2^k=valuation(m,2); if (bitand(n, k), v+=2^k)); v } %Y A352450 See A352449, A352451, A352452, A352458 for similar sequences. %K A352450 nonn,base %O A352450 0,4 %A A352450 _Rémy Sigrist_, Mar 16 2022