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.

A352458 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).

This page as a plain text file.
%I A352458 #9 Mar 20 2022 18:29:45
%S A352458 0,1,2,1,4,5,2,1,8,1,2,1,12,5,2,1,16,17,18,17,4,5,2,1,24,17,18,17,12,
%T A352458 5,2,1,32,1,34,1,4,5,2,1,40,1,34,1,12,5,2,1,48,17,50,17,4,5,2,1,56,17,
%U A352458 50,17,12,5,2,1,64,65,2,1,4,5,2,1,72,65,2,1,12
%N A352458 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 A352458 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 A352458 Rémy Sigrist, <a href="/A352458/b352458.txt">Table of n, a(n) for n = 0..8192</a>
%H A352458 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F A352458 a(n) <= n with equality iff n belongs to A335702.
%F A352458 a(n) = n - A309274(n).
%e A352458 For n = 42:
%e A352458 - 42 = 2^5 + 2^3 + 2^1,
%e A352458 - 42 AND 5 = 0,
%e A352458 - 42 AND 3 = 2 <> 0,
%e A352458 - 42 AND 1 = 0,
%e A352458 - so a(42) = 2^5 + 2^1 = 34.
%o A352458 (PARI) a(n) = { my (v=0, m=n, k); while (m, m-=2^k=valuation(m,2); if (bitand(n, k)==0, v+=2^k)); v }
%Y A352458 See A352449, A352450, A352451, A352452 for similar sequences.
%Y A352458 Cf. A335702 (fixed points).
%K A352458 nonn,base
%O A352458 0,3
%A A352458 _Rémy Sigrist_, Mar 17 2022