A191254 Fixed point of the morphism 0 -> 01, 1 -> 02, 2 -> 01.
0, 1, 0, 2, 0, 1, 0, 1, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 1, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 1, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 1, 0, 2
Offset: 1
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537
Crossrefs
Programs
-
Mathematica
t = Nest[Flatten[# /. {0 -> {0, 1}, 1 -> {0, 2}, 2 -> {0, 1}}] &, {0}, 9] (* A191254 *) Flatten[Position[t, 0]] (* A005408, the odds *) a = Flatten[Position[t, 1]] (* A036554 *) b = Flatten[Position[t, 2]] (* A108269 *) a/2 (* A003159 *) b/4 (* A003159 *)
-
PARI
A191254(n) = if(n%2,0,if(valuation(n,2)%2,1,2)); \\ Antti Karttunen, Nov 06 2018
Formula
From Jianing Song, May 30 2024: (Start)
Recurrence: a(2n-1) = 0, a(2n) = 1, 2, 1 for a(n) = 0, 1, 2 respectively.
a(n) = 0 for odd n; a(n) = 1 for even n such that v2(n) is odd; a(n) = 2 for even n such that v2(n) is even, where v2(n) = A007814(n) is the 2-adic valuation of n. (End)
Comments