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 A352451 #11 Mar 20 2022 18:29:51 %S A352451 0,1,2,1,0,1,6,1,8,1,2,1,12,1,2,5,0,1,2,1,16,5,2,1,8,17,2,1,8,1,22,1, %T A352451 0,1,2,1,36,1,2,5,8,1,34,1,8,5,2,1,32,1,18,1,0,1,38,17,8,1,2,1,60,1,2, %U A352451 5,0,1,2,1,0,5,66,1,8,1,2,1,8,65,6,1,16,1 %N A352451 2^k appears in the binary expansion of a(n) iff 2^k appears in the binary expansion of n and k+1 divides n. %C A352451 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 A352451 Rémy Sigrist, <a href="/A352451/b352451.txt">Table of n, a(n) for n = 0..8192</a> %H A352451 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %F A352451 a(n) <= n. %e A352451 For n = 42: %e A352451 - 42 = 2^5 + 2^3 + 2^1, %e A352451 - 5+1 divides 42, %e A352451 - 3+1 does not divide 42, %e A352451 - 1+1 divides 42, %e A352451 - so a(42) = 2^5 + 2^1 = 34. %o A352451 (PARI) a(n) = { my (v=0, m=n, k); while (m, m-=2^k=valuation(m,2); if (n%(k+1)==0, v+=2^k)); v } %Y A352451 See A352449, A352450, A352452, A352458 for similar sequences. %K A352451 nonn,base %O A352451 0,3 %A A352451 _Rémy Sigrist_, Mar 16 2022