|
| |
|
|
A051064
|
|
3^a(n) exactly divides 3n. Or, 3-adic valuation of 3n.
|
|
16
| |
|
|
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; internal format)
|
|
|
|
OFFSET
| 1,3
|
|
|
COMMENTS
| a(n) is the Hamming distance between n and n-1 in ternary representation. - DELEHAM Philippe (kolotoko(AT)wanadoo.fr), Mar 29 2004
Also : 3^a(n) divides exactly 4^n-1 - Benoit Cloitre (benoit7848c(AT)orange.fr), Oct 25 2004
Generalized Ruler Function for k=3 - Frank Ruskey (http://www.cs.uvic.ca/~ruskey/) and Chris Deugau (deugaucj(AT)uvic.ca)
|
|
|
REFERENCES
| Letter from Gary W. Adamson concerning Prouhet-Thue-Morse sequence, Nov. 11, 1999.
|
|
|
LINKS
| T. D. Noe, Table of n, a(n) for n=1..1000
|
|
|
FORMULA
| Multiplicative with a(p^e) = e+1 if p = 3; 1 if p <> 3. - Vladeta Jovovic (vladeta(AT)eunet.rs), Aug 24 2002
G.f.: Sum(k>=0, x^3^k/(1-x^3^k)). - Ralf Stephan (ralf(AT)ark.in-berlin.de), 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). - DELEHAM Philippe (kolotoko(AT)wanadoo.fr), Mar 29 2004
a(n)=(-1)*sum_{d divides n} mu(3d)*tau(n/d) - Benoit Cloitre (benoit7848c(AT)orange.fr), Jun 21 2007
Dirichlet g.f. zeta(s)/(1-1/3^s). - R. J. Mathar, Jun 13 2011
|
|
|
EXAMPLE
| 3^2 | 3*6 = 18, so a(6) = 2.
|
|
|
MATHEMATICA
| Nest[ Function[ l, {Flatten[(l /. {1 -> {1, 1, 2}, 2 -> {1, 1, 3}, 3 -> {1, 1, 4}, 4 -> {1, 1, 5}})]}], {1}, 5] (from Robert G. Wilson v Mar 03 2005)
Table[ IntegerExponent[3n, 3], {n, 1, 105}] (* From Jean-François Alcover, Oct 10 2011 *)
|
|
|
PROG
| (PARI) a(n)=if(n<1, 0, 1+valuation(n, 3))
|
|
|
CROSSREFS
| a(n) = A007949(n)+1 = A004128(n)-A004128(n-1).
Cf. A001511, A007949. Partial sums give A004128.
Sequence in context: A162320 A136610 A101022 * A153096 A078770 A072038
Adjacent sequences: A051061 A051062 A051063 * A051065 A051066 A051067
|
|
|
KEYWORD
| nonn,easy,nice,mult
|
|
|
AUTHOR
| N. J. A. Sloane (njas(AT)research.att.com), Gary W. Adamson
|
|
|
EXTENSIONS
| More terms from James A. Sellers (sellersj(AT)math.psu.edu), Dec 11 1999
More terms from Vladeta Jovovic (vladeta(AT)eunet.rs), Aug 24 2002
|
| |
|
|