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.

A352449 2^k appears in the binary expansion of a(n) iff 2^k appears in the binary expansion of n and k AND n = k (where AND denotes the bitwise AND operator).

This page as a plain text file.
%I A352449 #10 Mar 20 2022 18:30:12
%S A352449 0,1,0,3,0,1,4,7,0,1,0,11,0,1,4,15,0,1,0,3,16,17,20,23,0,1,0,11,16,17,
%T A352449 20,31,0,1,0,3,0,33,4,39,0,1,0,11,0,33,4,47,0,1,0,3,16,49,20,55,0,1,0,
%U A352449 11,16,49,20,63,0,1,0,3,0,1,68,71,0,1,0,11,0,1
%N A352449 2^k appears in the binary expansion of a(n) iff 2^k appears in the binary expansion of n and k AND n = k (where AND denotes the bitwise AND operator).
%C A352449 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 A352449 Rémy Sigrist, <a href="/A352449/b352449.txt">Table of n, a(n) for n = 0..8192</a>
%H A352449 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F A352449 a(n) <= n with equality iff n belongs to A309274.
%e A352449 For n = 42:
%e A352449 - 42 = 2^5 + 2^3 + 2^1,
%e A352449 - 42 AND 5 = 0 <> 5,
%e A352449 - 42 AND 3 = 2 <> 3,
%e A352449 - 42 AND 1 = 0 <> 1,
%e A352449 - so a(42) = 0.
%o A352449 (PARI) a(n) = { my (v=0, m=n, k); while (m, m-=2^k=valuation(m,2); if (bitand(n, k)==k, v+=2^k)); v }
%Y A352449 See A352450, A352451, A352452, A352458 for similar sequences.
%Y A352449 Cf. A309274 (fixed points).
%K A352449 nonn,base
%O A352449 0,4
%A A352449 _Rémy Sigrist_, Mar 16 2022