A285954 Positions of 1 in A285952; complement of A285953.
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, 38, 40, 42, 43, 45, 46, 47, 49, 51, 52, 53, 55, 56, 58, 60, 61, 62, 64, 66, 67, 69, 70, 71, 73, 74, 76, 78, 79, 81, 82, 83, 85, 87, 88, 89, 91, 92, 94, 96, 97, 99
Offset: 1
Examples
As a word, A285952 = 110101101110101..., in which 1 is in positions 1,2,4,6,7,9,...
Links
- Clark Kimberling, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
s = Nest[Flatten[# /. {0 -> {0, 1}, 1 -> {1, 0}}] &, {0}, 7] (* Thue-Morse, A010060 *) w = StringJoin[Map[ToString, s]] w1 = StringReplace[w, {"0" -> "1", "1" -> "10"}] (* A285952, word *) st = ToCharacterCode[w1] - 48 (* A285952, sequence *) Flatten[Position[st, 0]] (* A285953 *) Flatten[Position[st, 1]] (* A285954 *)
-
Python
def A285954(n): return n+(n>>1)-(0 if n&1 else (n-1).bit_count()&1) # Chai Wah Wu, Nov 17 2024
Formula
a(2n+1) = 3n+1, a(2n) = 3n - A010060(2n) - Michel Dekking, Jan 05 2018
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
Comments