A285950 Positions of 0's in A285949; complement of A285951.
1, 3, 4, 5, 7, 8, 10, 12, 13, 14, 16, 18, 19, 21, 22, 23, 25, 26, 28, 30, 31, 33, 34, 35, 37, 39, 40, 41, 43, 44, 46, 48, 49, 50, 52, 54, 55, 57, 58, 59, 61, 63, 64, 65, 67, 68, 70, 72, 73, 75, 76, 77, 79, 80, 82, 84, 85, 86, 88, 90, 91, 93, 94, 95, 97, 98
Offset: 1
Examples
As a word, A285949 = 0100010010100010100100010..., in which 0 is in positions 1,3,4,5,7,...
Links
- Clark Kimberling, Table of n, a(n) for n = 1..10000
- Jacques Justin and Laurent Vuillon, Return words in Sturmian and episturmian words, RAIRO-Theoretical Informatics and Applications 34.5 (2000): 343-356.
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" -> "01", "1" -> "0"}] (* A285949, word *) st = ToCharacterCode[w1] - 48 (* A285949, sequence *) Flatten[Position[st, 0]] (* A285950 *) Flatten[Position[st, 1]] (* A285951 *)
-
PARI
a(n) = (3*n)>>1 - if(n%2==0, hammingweight(n-2)%2); \\ Kevin Ryde, Jan 28 2022
-
Python
def A285950(n): return 3*(n>>1)+(1 if n&1 else -((n-1>>1).bit_count()&1)) # Chai Wah Wu, May 21 2025
Formula
a(2n) = 3n - A010060(n-1); a(2n+1) = 3n + 1. - Michel Dekking, Sep 03 2019
Comments