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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A038500 Highest power of 3 dividing n. 56
1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 27, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 27, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 81 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

To construct the sequence: start with 1 and concatenate twice: 1,1,1 then tripling the last term gives: 1,1,3. Concatenating those 3 terms twice gives: 1,1,3,1,1,3,1,1,3, triple the last term -> 1,1,3,1,1,3,1,1,9. Concatenating those 9 terms twice gives: 1,1,3,1,1,3,1,1,9,1,1,3,1,1,3,1,1,9,1,1,3,1,1,3,1,1,9, triple the last term -> 1,1,3,1,1,3,1,1,9,1,1,3,1,1,3,1,1,9,1,1,3,1,1,3,1,1,27 etc. - Benoit Cloitre, Dec 17 2002

Also 3-adic value of 1/n, n >= 1. See the Mahler reference, definition on p. 7. This is a non-archimedean valuation. See Mahler, p. 10. Sometimes also called 3-adic absolute value. - Wolfdieter Lang, Jun 28 2014

REFERENCES

K. Mahler, p-adic numbers and their functions, second ed., Cambridge University Press, 1981.

LINKS

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

Tyler Ball, Tom Edgar, and Daniel Juda, Dominance Orders, Generalized Binomial Coefficients, and Kummer's Theorem, Mathematics Magazine, Vol. 87, No. 2, April 2014, pp. 135-143.

Z. Sunic, Tree morphisms, transducers and integer sequences, arXiv:math/0612080 [math.CO], 2006.

FORMULA

Multiplicative with a(p^e) = p^e if p = 3, 1 otherwise. - Mitch Harris, Apr 19 2005

a(n) = n / A038502(n). Dirichlet g.f. zeta(s)*(3^s-1)/(3^s-3). - R. J. Mathar, Jul 12 2012

From Peter Bala, Feb 21 2019: (Start)

a(n) = gcd(n,3^n).

O.g.f.: x/(1 - x) + 2*Sum_{n >= 1} 3^(n-1)*x^(3^n)/ (1 - x^(3^n)).

End.

MAPLE

A038500 := n -> 3^padic[ordp](n, 3): # Peter Luschny, Nov 26 2010

MATHEMATICA

Flatten[{1, 1, #}&/@(3^IntegerExponent[#, 3]&/@(3*Range[40]))] (* or *) hp3[n_]:=If[Divisible[n, 3], 3^IntegerExponent[n, 3], 1]; Array[hp3, 90] (* Harvey P. Dale, Mar 24 2012 *)

Table[3^IntegerExponent[n, 3], {n, 100}] (* Vincenzo Librandi, Dec 29 2015 *)

PROG

(PARI) {a(n) = if( n<1, 0, 3^valuation(n, 3))};

(Haskell)

a038500 = f 1 where

   f y x = if m == 0 then f (y * 3) x' else y  where (x', m) = divMod x 3

-- Reinhard Zumkeller, Jul 06 2014

(MAGMA) [3^Valuation(n, 3): n in [1..100]]; // Vincenzo Librandi, Dec 29 2015

CROSSREFS

Cf. A007949, A038502, A060904, A268354, A268357.

Sequence in context: A251913 A285012 A139378 * A091840 A083985 A109848

Adjacent sequences:  A038497 A038498 A038499 * A038501 A038502 A038503

KEYWORD

nonn,mult

AUTHOR

N. J. A. Sloane

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
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 23 09:45 EDT 2019. Contains 328345 sequences. (Running on oeis4.)