A051064 3^a(n) exactly divides 3n. Or, 3-adic valuation of 3n.
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
Offset: 1
Examples
3^2 | 3*6 = 18, so a(6) = 2.
References
- Letter from Gary W. Adamson to N. J. A. Sloane concerning Prouhet-Thue-Morse sequence, Nov. 11, 1999.
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..1000 from T. D. Noe)
- A. M. Hinz, S. Klavžar, U. Milutinović, and C. Petr, The Tower of Hanoi - Myths and Maths, Birkhäuser 2013. See page 243. Book's website
- Tamas Lengyel, Divisiblity Properties by Multisection, Fib. Quart. 41 (1) (2003) 72.
- Simon Plouffe, On the values of the functions zeta and gamma, arXiv preprint arXiv:1310.7195 [math.NT], 2013.
- Joseph Rosenbaum, Elementary Problem E319, American Mathematical Monthly, volume 45, number 10, December 1938, pages 694-696. (The A indices in P at equations 1' and 2' for p=3.)
- Index entries for sequences that are fixed points of mappings.
Crossrefs
Programs
-
Haskell
a051064 = (+ 1) . length . takeWhile (== 3) . dropWhile (== 2) . a027746_row -- Reinhard Zumkeller, May 23 2013
-
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 *)
-
PARI
a(n)=if(n<1,0,1+valuation(n,3))
-
Python
def A051064(n): c = 1 a, b = divmod(n,3) while b == 0: a, b = divmod(a,3) c += 1 return c # Chai Wah Wu, Apr 18 2022
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) = A007949(3n). - Cyril Damamme, Aug 04 2015
a(2n) = a(n), a(2n-1) = A254046(n). - Cyril Damamme, Aug 04 2015
G.f. A(x) satisfies: A(x) = A(x^3) + x/(1 - x). - Ilya Gutkovskiy, May 03 2019
Asymptotic mean: lim_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 3/2. - Amiram Eldar, Sep 11 2020 [corrected by Vaclav Kotesovec, Jun 25 2024, see also A004128]
a(n) = tau(n)/(tau(3*n) - tau(n)), where tau(n) = A000005(n). - Peter Bala, Jan 06 2021
G.f.: Sum_{i>=1, j>=0} x^(i*3^j). - Seiichi Manyama, Mar 23 2025
Conjecture: a(n) = A007949(A000045(4*n)), all other 3-adic quadrisections A007949(A000045(.))=0. [Lengyel?]. - R. J. Mathar, Jun 28 2025
Extensions
More terms from James Sellers, Dec 11 1999
More terms from Vladeta Jovovic, Aug 24 2002
Comments