login
Fixed point of the morphism 0 -> 01, 1 -> 02, 2 -> 03, 3 -> 01.
8

%I #45 May 31 2024 14:38:05

%S 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,1,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,2,0,1,

%T 0,2,0,1,0,3,0,1,0,2,0,1,0,1,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,3,0,1,0,2,

%U 0,1,0,3,0,1,0,2,0,1,0,1,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,2,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,1,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,1,0,1,0,2

%N Fixed point of the morphism 0 -> 01, 1 -> 02, 2 -> 03, 3 -> 01.

%C See A191250.

%C The asymptotic density of the occurrences of k = 0, 1, 2 and 3 is 1/2, 2/7, 1/7 and 1/14, respectively. The asymptotic mean of this sequence is 11/14. - _Amiram Eldar_, May 31 2024

%H Antti Karttunen, <a href="/A191255/b191255.txt">Table of n, a(n) for n = 1..65537</a>

%F a(n) = 0 for odd n, otherwise a(n) is the unique number in {1,2,3} that is congruent to v2(n) modulo 3, where v2(n) = A007814(n) is the 2-adic valuation of n. - _Jianing Song_, Sep 21 2018 [Clarified by _Jianing Song_, May 30 2024]

%F Recurrence: a(2n-1) = 0, a(2n) = 1, 2, 3, 1 for a(n) = 0, 1, 2, 3 respectively. - _Jianing Song_, May 30 2024

%t t = Nest[Flatten[# /. {0 -> {0, 1}, 1 -> {0, 2}, 2 -> {0, 3}, 3 -> {0, 1}}] &, {0}, 9] (* this sequence *)

%t Flatten[Position[t, 0]] (* A005408, the odds *)

%t a = Flatten[Position[t, 1]] (* A067368 *)

%t b = Flatten[Position[t, 2]] (* A213258 *)

%t a/2 (* A191257 *)

%t b/4 (* a/2 *)

%o (PARI) A191255(n) = if(n%2, 0, my(e=valuation(n, 2)%3); if(!e, 3, e)); \\ _Antti Karttunen_, May 28 2024, after _Jianing Song_'s Sep 21 2018 formula

%Y Cf. A191250, A191254, A373157.

%Y Positions of 0 or 3: A191257; positions of 0: A005408; positions of 1: A067368; positions of 2: A213258.

%K nonn

%O 1,4

%A _Clark Kimberling_, May 28 2011