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.

A352452 2^k appears in the binary expansion of a(n) iff 2^k appears in the binary expansion of n and k+1 does not divide n.

This page as a plain text file.
%I A352452 #11 Mar 20 2022 18:29:38
%S A352452 0,0,0,2,4,4,0,6,0,8,8,10,0,12,12,10,16,16,16,18,4,16,20,22,16,8,24,
%T A352452 26,20,28,8,30,32,32,32,34,0,36,36,34,32,40,8,42,36,40,44,46,16,48,32,
%U A352452 50,52,52,16,38,48,56,56,58,0,60,60,58,64,64,64,66,68,64
%N A352452 2^k appears in the binary expansion of a(n) iff 2^k appears in the binary expansion of n and k+1 does not divide n.
%C A352452 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 A352452 Rémy Sigrist, <a href="/A352452/b352452.txt">Table of n, a(n) for n = 0..8192</a>
%H A352452 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F A352452 a(n) <= n.
%e A352452 For n = 42:
%e A352452 - 42 = 2^5 + 2^3 + 2^1,
%e A352452 - 5+1 divides 42,
%e A352452 - 3+1 does not divide 42,
%e A352452 - 1+1 divides 42,
%e A352452 - so a(42) = 2^3 = 8.
%o A352452 (PARI) a(n) = { my (v=0, m=n, k); while (m, m-=2^k=valuation(m,2); if (n%(k+1), v+=2^k)); v }
%Y A352452 See A352449, A352450, A352451, A352458 for similar sequences.
%K A352452 nonn,base
%O A352452 0,4
%A A352452 _Rémy Sigrist_, Mar 16 2022