login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A060236 If n mod 3 = 0 then a(n) = a(n/3), otherwise a(n) = n mod 3. 7
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

Also equals A038502(n) mod 3.

Last nonzero digit in ternary representation of n. - Franklin T. Adams-Watters, Apr 01 2006

a(2*n) = length of n-th run of twos. - Reinhard Zumkeller, Mar 13 2015

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 1..1000

Jean Berstel and J. Karhumaki, Combinatorics on words - a tutorial, Bull. EATCS, #79 (2003), pp. 178-228.

Index entries for sequences related to final digits of numbers

Index entries for sequences that are fixed points of mappings

FORMULA

a(3*n) = a(n), a(3*n + 1) = 1, a(3*n + 2) = 2. - Michael Somos, Jul 29 2009

a(n) = 1 + A080846(n). - Joerg Arndt, Jan 21 2013

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 *)

PROG

(PARI) a(n)=if(n<1, 0, n/3^valuation(n, 3)%3) /* Michael Somos, Nov 10 2005 */

(Haskell)  following Franklin T. Adams-Watters' comment.

a060236 = head . dropWhile (== 0) . a030341_row

-- Reinhard Zumkeller, Mar 13 2015

Table[Mod[n/3^IntegerExponent[n, 3], 3], {n, 1, 120}] (* Clark Kimberling, Oct 19 2016 *)

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).

Cf. A030341, A007089.

Sequence in context: A265209 A202340 A049705 * A006345 A122497 A154402

Adjacent sequences:  A060233 A060234 A060235 * A060237 A060238 A060239

KEYWORD

easy,nonn

AUTHOR

Henry Bottomley, Mar 21 2001

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified October 20 15:14 EDT 2017. Contains 293612 sequences.