|
|
A060236
|
|
If n mod 3 = 0 then a(n) = a(n/3), otherwise a(n) = n mod 3.
|
|
12
|
|
|
1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
A cubefree word. Start with 1, apply the morphisms 1 -> 121, 2 -> 122, take limit. See A080846 for another version.
Ultimate modulo 3: n-th digit of terms in "Ana sequence" (see A060032 for definition).
Equals A005148(n) reduced mod 3. In "On a sequence Arising in Series for Pi" Morris Newman and Daniel Shanks conjectured that 3 never divides A005148(n) and D. Zagier proved it. - Benoit Cloitre, Jun 22 2002
|
|
LINKS
|
|
|
FORMULA
|
a(3*n) = a(n), a(3*n + 1) = 1, a(3*n + 2) = 2. - Michael Somos, Jul 29 2009
nts of mappings</a>
|
|
EXAMPLE
|
a(10)=1 since 10=3^0*10 and 10 mod 3=1;
a(72)=2 since 24=3^3*8 and 8 mod 3=2.
|
|
MATHEMATICA
|
Nest[ Flatten[ # /. {1 -> {1, 2, 1}, 2 -> {1, 2, 2}}] &, {1}, 5] (* Robert G. Wilson v, Mar 04 2005 *)
Table[Mod[n/3^IntegerExponent[n, 3], 3], {n, 1, 120}] (* Clark Kimberling, Oct 19 2016 *)
lnzd[m_]:=Module[{s=Split[m]}, If[FreeQ[Last[s], 0], s[[-1, 1]], s[[-2, 1]]]]; lnzd/@Table[IntegerDigits[n, 3], {n, 120}] (* Harvey P. Dale, Oct 19 2018 *)
|
|
PROG
|
(PARI) a(n)=if(n<1, 0, n/3^valuation(n, 3)%3) /* Michael Somos, Nov 10 2005 */
a060236 = head . dropWhile (== 0) . a030341_row
|
|
CROSSREFS
|
Cf. A026140 and A026225 for sequence of n's for which a(n)=1, A026179 for sequence of n's for which a(n)=2. k-th term of A060032 is concatenation of first 3^k terms of a(n).
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|