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.

A285954 Positions of 1 in A285952; complement of A285953.

This page as a plain text file.
%I A285954 #15 Nov 18 2024 07:35:35
%S A285954 1,2,4,6,7,9,10,11,13,15,16,17,19,20,22,24,25,27,28,29,31,32,34,36,37,
%T A285954 38,40,42,43,45,46,47,49,51,52,53,55,56,58,60,61,62,64,66,67,69,70,71,
%U A285954 73,74,76,78,79,81,82,83,85,87,88,89,91,92,94,96,97,99
%N A285954 Positions of 1 in A285952; complement of A285953.
%C A285954 Conjecture: 3n/2 - a(n) is in {0, 1/2, 1} for n >= 1.
%C A285954 Proof of the conjecture: Let t=A010060 be the Thue-Morse sequence. Every pair t(2n-1),t(2n)  is either 01 or 10.  Since 01 and 10 map to 110 and 101 under the transform, which both have length 3, it follows that a(2n+1) = 3n+1, and a(2n) = 3n if t(2n)=0, a(2n) = 3n-1 if t(2n)=1 for n=1,2,..., and so certainly 3n/2 - a(n) is 0, 1/2 or 1. - _Michel Dekking_, Jan 05 2018
%H A285954 Clark Kimberling, <a href="/A285954/b285954.txt">Table of n, a(n) for n = 1..10000</a>
%F A285954 a(2n+1) = 3n+1, a(2n) = 3n - A010060(2n) - _Michel Dekking_, Jan 05 2018
%F A285954 a(n) = n+floor(n/2) if n is odd and a(n) = n+floor(n/2)-A010060(n-1) otherwise. - _Chai Wah Wu_, Nov 17 2024
%e A285954 As a word, A285952 = 110101101110101..., in which 1 is in positions 1,2,4,6,7,9,...
%t A285954 s = Nest[Flatten[# /. {0 -> {0, 1}, 1 -> {1, 0}}] &, {0}, 7]  (* Thue-Morse, A010060 *)
%t A285954 w = StringJoin[Map[ToString, s]]
%t A285954 w1 = StringReplace[w, {"0" -> "1", "1" -> "10"}]  (* A285952, word *)
%t A285954 st = ToCharacterCode[w1] - 48 (* A285952, sequence *)
%t A285954 Flatten[Position[st, 0]]  (* A285953 *)
%t A285954 Flatten[Position[st, 1]]  (* A285954 *)
%o A285954 (Python)
%o A285954 def A285954(n): return n+(n>>1)-(0 if n&1 else (n-1).bit_count()&1) # _Chai Wah Wu_, Nov 17 2024
%Y A285954 Cf. A010060, A005614, A285950, A285952, A285953.
%K A285954 nonn,easy
%O A285954 1,2
%A A285954 _Clark Kimberling_, May 05 2017