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.

A352729 The binary expansion of a(n) contains the runs of consecutive 1's that appear both in the binary expansions of n and n+1.

This page as a plain text file.
%I A352729 #10 Apr 01 2022 09:03:32
%S A352729 0,0,0,0,4,0,0,0,8,8,8,0,12,0,0,0,16,16,16,16,20,16,16,0,24,24,24,0,
%T A352729 28,0,0,0,32,32,32,32,36,32,32,32,40,40,40,32,44,32,32,0,48,48,48,48,
%U A352729 52,48,48,0,56,56,56,0,60,0,0,0,64,64,64,64,68,64,64,64
%N A352729 The binary expansion of a(n) contains the runs of consecutive 1's that appear both in the binary expansions of n and n+1.
%C A352729 We only consider runs of consecutive 1's that completely match in binary expansions of n and n+1, not simply single common 1's.
%H A352729 Rémy Sigrist, <a href="/A352729/b352729.txt">Table of n, a(n) for n = 0..8192</a>
%H A352729 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F A352729 a(n) = A352727(n, n+1).
%e A352729 For n = 42:
%e A352729 - the binary expansion of 42 is "101010",
%e A352729 - the binary expansion of 43 is "101011",
%e A352729 - the first two runs of 1's are the same, the others differ,
%e A352729 - so the binary expansion of a(42) is "101000",
%e A352729 - and a(42) = 40.
%o A352729 (PARI) A352724(n) = { my (r=[], o=0); while (n, my (v=valuation(n+n%2, 2)); if (n%2, r=concat(r, (2^v-1)*2^o)); o+=v; n\=2^v); r }
%o A352729 a(n) = vecsum(setintersect(A352724(n), A352724(n+1)))
%Y A352729 Cf. A129760, A352727.
%K A352729 nonn,base
%O A352729 0,5
%A A352729 _Rémy Sigrist_, Mar 30 2022