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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A051064 3^a(n) exactly divides 3n. Or, 3-adic valuation of 3n. 20
1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 4, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 4, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 5, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

a(n) is the Hamming distance between n and n-1 in ternary representation. - Philippe Deléham, Mar 29 2004

Also : 3^a(n) divides exactly 4^n-1. - Benoit Cloitre, Oct 25 2004

Generalized Ruler Function for k=3 - Frank Ruskey and Chris Deugau (deugaucj(AT)uvic.ca)

a(A007417(n)) is odd and a(A145204(n)) is even. - Reinhard Zumkeller, May 23 2013

First n terms comprise least cubefree word of length n using positive integers, where "cubefree" means that the word contains no three consecutive identical subwords; e.g., 1 contains no cube; 11 contains no cube; 111 does but 112 does not; ... 1,1,2,1,1,2,1,1,1 does, and 1,1,2,1,1,2,1,1,2 does, but 1,1,2,1,1,2,1,1,3 does not, etc. - Clark Kimberling, Sep 10 2013

REFERENCES

Letter from Gary W. Adamson to N. J. A. Sloane concerning Prouhet-Thue-Morse sequence, Nov. 11, 1999.

LINKS

T. D. Noe, Table of n, a(n) for n=1..1000

A. M. Hinz, S. Klavžar, U. Milutinović, C. Petr, The Tower of Hanoi - Myths and Maths, Birkhäuser 2013. See page 243. Book's website

Simon Plouffe, On the values of the functions ... [zeta and Gamma] ..., arXiv preprint arXiv:1310.7195, 2013

Index entries for sequences that are fixed points of mappings

FORMULA

Multiplicative with a(p^e) = e+1 if p = 3; 1 if p <> 3. - Vladeta Jovovic, Aug 24 2002

G.f.: Sum(k>=0, x^3^k/(1-x^3^k)). - Ralf Stephan, Apr 12 2002

Fixed point of the morphism: 1 -> 112; 2 -> 113; 3 -> 114; 4 -> 115; ...; starting from a(1) = 1. a(3n+1) = a(3n+2) = 1; a(3n) = 1 + a(n). - Philippe Deléham, Mar 29 2004

a(n) = (-1)*sum_{d divides n} mu(3d)*tau(n/d). - Benoit Cloitre, Jun 21 2007

Dirichlet g.f. zeta(s)/(1-1/3^s). - R. J. Mathar, Jun 13 2011

a(n) = 1/2*(3 - A053735(n) + A053735(n-1)) for n >= 1. - Tom Edgar, Aug 06 2014

a(n) = A007949(3n). - Cyril Damamme, Aug 04 2015

a(2n) = a(n), a(2n-1) = A254046(n). - Cyril Damamme, Aug 04 2015

EXAMPLE

3^2 | 3*6 = 18, so a(6) = 2.

MAPLE

seq(1+padic:-ordp(n, 3), n=1..100); # Robert Israel, Aug 07 2014

MATHEMATICA

Nest[ Function[ l, {Flatten[(l /. {1 -> {1, 1, 2}, 2 -> {1, 1, 3}, 3 -> {1, 1, 4}, 4 -> {1, 1, 5}})]}], {1}, 5] (* Robert G. Wilson v, Mar 03 2005 *)

Table[ IntegerExponent[3n, 3], {n, 1, 105}] (* Jean-François Alcover, Oct 10 2011 *)

PROG

(PARI) a(n)=if(n<1, 0, 1+valuation(n, 3))

(Haskell)

a051064 = (+ 1) . length .

                  takeWhile (== 3) . dropWhile (== 2) . a027746_row

-- Reinhard Zumkeller, May 23 2013

CROSSREFS

a(n) = A007949(n)+1 = A004128(n)-A004128(n-1).

Cf. A001511, A007949. Partial sums give A004128.

Cf. A027746.

Cf. A254046.

Sequence in context: A101022 A241153 A213852 * A280509 A153096 A210763

Adjacent sequences:  A051061 A051062 A051063 * A051065 A051066 A051067

KEYWORD

nonn,easy,nice,mult

AUTHOR

N. J. A. Sloane, Gary W. Adamson

EXTENSIONS

More terms from James A. Sellers, Dec 11 1999

More terms from Vladeta Jovovic, Aug 24 2002

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 April 27 00:46 EDT 2017. Contains 285506 sequences.