cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 67 results. Next

A263273 Bijective base-3 reverse: a(0) = 0; for n >= 1, a(n) = A030102(A038502(n)) * A038500(n).

Original entry on oeis.org

0, 1, 2, 3, 4, 7, 6, 5, 8, 9, 10, 19, 12, 13, 22, 21, 16, 25, 18, 11, 20, 15, 14, 23, 24, 17, 26, 27, 28, 55, 30, 37, 64, 57, 46, 73, 36, 31, 58, 39, 40, 67, 66, 49, 76, 63, 34, 61, 48, 43, 70, 75, 52, 79, 54, 29, 56, 33, 38, 65, 60, 47, 74, 45, 32, 59, 42, 41, 68, 69, 50, 77, 72, 35, 62, 51, 44, 71, 78, 53, 80, 81
Offset: 0

Views

Author

Antti Karttunen, Dec 05 2015

Keywords

Comments

Here the base-3 reverse has been adjusted so that the maximal suffix of trailing zeros (in base-3 representation A007089) stays where it is at the right side, and only the section from the most significant digit to the least significant nonzero digit is reversed, thus making this sequence a self-inverse permutation of nonnegative integers.
Because successive powers of 3 and 9 modulo 2, 4 and 8 are always either constant 1, 1, 1, ... or alternating 1, -1, 1, -1, ... it implies similar simple divisibility rules for 2, 4 and 8 in base 3 as e.g. 3, 9 and 11 have in decimal base (see the Wikipedia-link). As these rules do not depend on which direction they are applied from, it means that this bijection preserves the fact whether a number is divisible by 2, 4 or 8, or whether it is not. Thus natural numbers are divided to several subsets, each of which is closed with respect to this bijection. See the Crossrefs section for permutations obtained from these sections.
When polynomials over GF(3) are encoded as natural numbers (coefficients presented with the digits of the base-3 expansion of n), this bijection works as a multiplicative automorphism of the ring GF(3)[X]. This follows from the fact that as there are no carries involved, the multiplication (and thus also the division) of such polynomials could be as well performed by temporarily reversing all factors (like they were seen through mirror). This implies also that the sequences A207669 and A207670 are closed with respect to this bijection.

Examples

			For n = 15, A007089(15) = 120. Reversing this so that the trailing zero stays at the right yields 210 = A007089(21), thus a(15) = 21 and vice versa, a(21) = 15.
		

Crossrefs

Bisections: A264983, A264984.
Permutations induced by various sections: A263272 (a(2n)/2), A264974 (a(4n)/4), A264978 (a(8n)/8), A264985, A264989.
Cf. also A004488, A140263, A140264, A246207, A246208 (other base-3 related permutations).

Programs

  • Mathematica
    r[n_] := FromDigits[Reverse[IntegerDigits[n, 3]], 3]; b[n_] := n/ 3^IntegerExponent[n, 3]; c[n_] := n/b[n]; a[0]=0; a[n_] := r[b[n]]*c[n]; Table[a[n], {n, 0, 80}] (* Jean-François Alcover, Dec 29 2015 *)
  • Python
    from sympy import factorint
    from sympy.ntheory.factor_ import digits
    from operator import mul
    def a030102(n): return 0 if n==0 else int(''.join(map(str, digits(n, 3)[1:][::-1])), 3)
    def a038502(n):
        f=factorint(n)
        return 1 if n==1 else reduce(mul, [1 if i==3 else i**f[i] for i in f])
    def a038500(n): return n/a038502(n)
    def a(n): return 0 if n==0 else a030102(a038502(n))*a038500(n) # Indranil Ghosh, May 22 2017
  • Scheme
    (define (A263273 n) (if (zero? n) n (* (A030102 (A038502 n)) (A038500 n))))
    

Formula

a(0) = 0; for n >= 1, a(n) = A030102(A038502(n)) * A038500(n).
Other identities. For all n >= 0:
a(3*n) = 3*a(n).
A000035(a(n)) = A000035(n). [This permutation preserves the parity of n.]
A010873(a(n)) = 0 if and only if A010873(n) = 0. [See the comments section.]

A161809 G.f.: A(x) = exp( Sum_{n>=1} 3*A038500(n) * x^n/n ), where A038500 is the highest power of 3 dividing n.

Original entry on oeis.org

1, 3, 6, 12, 21, 33, 51, 75, 105, 147, 201, 267, 354, 462, 591, 753, 948, 1176, 1455, 1785, 2166, 2622, 3153, 3759, 4470, 5286, 6207, 7275, 8490, 9852, 11415, 13179, 15144, 17376, 19875, 22641, 25761, 29235, 33063, 37353, 42105, 47319, 53124
Offset: 0

Views

Author

Paul D. Hanna, Jul 20 2009

Keywords

Examples

			G.f.: A(x) = 1 + 3*x + 6*x^2 + 12*x^3 + 21*x^4 + 33*x^5 + 51*x^6 + ...
log(A(x)) = 3*x + 3*x^2/2 + 9*x^3/3 + 3*x^4/4 + 3*x^5/5 + 9*x^6/6 + ...
From _Paul D. Hanna_, Jul 27 2009: (Start)
TRISECTIONS begin:
T_0(x) = 1 + 12*x + 51*x^2 + 147*x^3 + 354*x^4 + 753*x^5 + ...
T_1(x) = 3 + 21*x + 75*x^2 + 201*x^3 + 462*x^4 + 948*x^5 + ...
T_2(x) = 6 + 33*x + 105*x^2 + 267*x^3 + 591*x^4 + 1176*x^5 + ...
(End)
		

Crossrefs

Partial sums of A309677.

Programs

  • Mathematica
    nmax = 50; CoefficientList[Series[Exp[Sum[3^(IntegerExponent[k, 3] + 1)*x^k/k, {k, 1, nmax}]], {x, 0, nmax}], x] (* Vaclav Kotesovec, Nov 01 2024 *)
  • PARI
    {a(n)=local(L=sum(m=1, n,3*3^valuation(m,3)*x^m/m)+x*O(x^n)); polcoeff(exp(L), n)}
    
  • PARI
    {a(n)=local(A=1+x);for(i=0,n\3,A=subst(A,x,x^3+x*O(x^n))*(1+x+x^2)/(1-x+x*O(x^n))^2);polcoeff(A,n)} \\ Paul D. Hanna, Jul 27 2009

Formula

From Paul D. Hanna, Jul 27 2009: (Start)
G.f. satisfies: A(x) = A(x^3)*(1+x+x^2)/(1-x)^2.
Define TRISECTIONS: A(x) = T_0(x^3) + x*T_1(x^3) + x^2*T_2(x^3), then:
T_1(x)/T_0(x) = 3*(1 + 2*x)/(1 + 7*x + x^2) and
T_2(x)/T_0(x) = 3*(2 + x)/(1 + 7*x + x^2).
(End)

A163129 G.f.: A(q) = exp( Sum_{n>=1} sigma(n) * 3*A038500(n) * q^n/n ), where A038500(n) = highest power of 3 dividing n.

Original entry on oeis.org

1, 3, 9, 30, 75, 180, 441, 969, 2070, 4431, 8964, 17775, 35094, 66975, 125865, 235053, 429096, 773766, 1386027, 2442372, 4260645, 7384578, 12640320, 21453975, 36192519, 60454713, 100250100, 165311094, 270391857, 439479198, 710631279
Offset: 0

Views

Author

Paul D. Hanna, Jul 21 2009, Jul 24 2009

Keywords

Examples

			G.f.: A(q) = 1 + 3*q + 9*q^2 + 30*q^3 + 75*q^4 + 180*q^5 + 441*q^6 + ...
log(A(q)) = 3*q + 9*q^2/2 + 36*q^3/3 + 21*q^4/4 + 18*q^5/5 + 108*q^6/6 + ...
Define TRISECTIONS:
T_0(q) = 1 + 30*q^3 + 441*q^6 + 4431*q^9 + 35094*q^12 + ...
T_1(q) = 3*q + 75*q^4 + 969*q^7 + 8964*q^10 + 66975*q^13 + ...
T_2(q) = 9*q^2 + 180*q^5 + 2070*q^8 + 17775*q^11 + 125865*q^14 + ...
then:
3*T_0(q)/T_1(q) = 3*T_1(q)/T_2(q) = T9B(q), the g.f. of A058091:
T9B(q) = 1/q + 5*q^2 - 7*q^5 + 3*q^8 + 15*q^11 - 32*q^14 + 9*q^17 + 58*q^20 + ...
		

Crossrefs

Cf. trisections: A163130 (T_0), A163131 (T_1), A163132 (T_2).
Cf. A058091, A038500, A162584 (variant).

Programs

  • Mathematica
    nmax = 100; CoefficientList[Series[Exp[Sum[DivisorSigma[1, k]*3^(IntegerExponent[k, 3] + 1)*q^k/k, {k, 1, nmax}]], {q, 0, nmax}], q]  (* G. C. Greubel, Jul 03 2018, edited by Vaclav Kotesovec, Oct 20 2020 *)
  • PARI
    {a(n)=local(L=sum(m=1, n, 3*sigma(m)*3^valuation(m, 3)*x^m/m)+x*O(x^n)); polcoeff(exp(L), n)}

Formula

Define trisections by: A(q) = T_0(q) + T_1(q) + T_2(q), then:
3*T_0(q)/T_1(q) = 3*T_1(q)/T_2(q) = T9B(q), the g.f. of A058091,
which is the McKay-Thompson series of class 9B for Monster.
G.f.: 1/Product_{n>=0} R(q^(3^n))^(3^n) where R(q) = E(q)^3/E(q^3) and E(q) = Product_{k>=1} (1 - q^k). - Joerg Arndt, Aug 03 2011

A161804 G.f.: A(q) = exp( Sum_{n>=1} A002129(n) * 3*A038500(n) * q^n/n ).

Original entry on oeis.org

1, 3, 3, 12, 30, 27, 66, 141, 111, 255, 513, 378, 903, 1815, 1356, 2970, 5727, 4131, 8571, 15882, 10881, 23001, 42417, 29106, 59763, 108165, 73500, 145164, 255831, 167643, 333693, 585258, 382053, 751059, 1302966, 849339, 1623009, 2762349
Offset: 0

Views

Author

Paul D. Hanna, Jul 20 2009

Keywords

Comments

A002129 forms the l.g.f. of log[ Sum_{n>=0} x^(n(n+1)/2) ], while 3*A038500 forms the l.g.f. of the log of the g.f. of A161809 and A038500(n) is the highest power of 3 dividing n.

Examples

			G.f.: A(q) = 1 + 3*q + 3*q^2 + 12*q^3 + 30*q^4 + 27*q^5 + 66*q^6 + ...
log(A(q)) = 3*q - 3*q^2 + 36*q^3 - 15*q^4 + 18*q^5 - 36*q^6 + 24*q^7 + ...
Sum_{n>=1} A002129(n)*q^n/n = log(1 + q + q^3 + q^6 + q^10 + q^15 + ...),
Sum_{n>=1} 3*A038500(n)*x^n/n = log of the g.f. of A161809.
TRISECTIONS:
T_0(q) = 1 + 12*q + 66*q^2 + 255*q^3 + 903*q^4 + 2970*q^5 + ... (A161805)
T_1(q) = 3 + 30*q + 141*q^2 + 513*q^3 + 1815*q^4 + 5727*q^5 + ... (A161806)
T_2(q) = 3 + 27*q + 111*q^2 + 378*q^3 + 1356*q^4 + 4131*q^5 + ... (A161807)
where T_1(-q)/T_0(-q)/3 equals (cf. A132977):
1 + 2*q + 5*q^2 + 12*q^3 + 26*q^4 + 50*q^5 + 92*q^6 + 168*q^7 + ...
and T_2(-q)/T_0(-q)/3 equals (cf. A132978):
1 + 3*q + 7*q^2 + 15*q^3 + 32*q^4 + 63*q^5 + 114*q^6 + 201*q^7 + ...
also, T_2(q)/T_1(q) equals (cf. A092848):
1 - q + 2*q^3 - 2*q^4 - q^5 + 4*q^6 - 4*q^7 - q^8 + 8*q^9 - 8*q^10 + ...
		

Crossrefs

Cf. trisections: A161805 (T_0), A161806 (T_1), A161807 (T_2).
Cf. A132977 (T_1/T_0), A132978 (T_2/T_0), A092848 (T_2/T_1).
Cf. A002129, A038500, A161809, A161800 (variant).

Programs

  • PARI
    {a(n)=local(L=sum(m=1, n,3*3^valuation(m,3)*sumdiv(m, d, -(-1)^d*d)*x^m/m)+x*O(x^n)); polcoeff(exp(L), n)}

Formula

Given trisections where A(q) = T_0(q^3) + q*T_1(q^3) + q^2*T_2(q^3):
T_0(q) = Sum_{n>=0} a(3n)*q^n,
T_1(q) = Sum_{n>=0} a(3n+1)*q^n,
T_2(q) = Sum_{n>=0} a(3n+2)*q^n,
then it appears that:
T_1(-q)/T_0(-q) = 3*q^(-1/3)*(eta(q^6)^4/(eta(q)*eta(q^3)*eta(q^4)*eta(q^12)))^2 (Cf. A132977);
T_2(-q)/T_0(-q) = 3*q^(-2/3)*(eta(q^2)*eta(q^6))^2*eta(q^3)*eta(q^12)/(eta(q)*eta(q^4))^3 (cf. A132978);
T_2(q)/T_1(q) = g.f. of A092848, the reciprocal of Hauptmodul for Gamma_0(18).

A161808 G.f.: A(q) = exp( Sum_{n>=1} A162552(n) * 3*A038500(n) * q^n/n ).

Original entry on oeis.org

1, 3, 3, 3, 9, 12, 12, 27, 36, 57, 141, 165, 135, 321, 450, 399, 780, 1068, 1308, 2913, 3537, 2736, 5940, 8430, 7173, 13251, 18267, 17661, 35007, 45051, 31866, 58506, 85890, 65694, 102000, 145293, 101547, 140574, 203781, 114765, 93051, 161754
Offset: 0

Views

Author

Paul D. Hanna, Jul 21 2009

Keywords

Comments

A162552 forms the l.g.f. of log[ Sum_{n>=0} x^(n^2) ], and
A038500(n) is the highest power of 3 dividing n.
The first negative term is a(43) = -162729.

Examples

			G.f.: A(q) = 1 + 3*q + 3*q^2 + 3*q^3 + 9*q^4 + 12*q^5 + 12*q^6 +...
log(A(q)) = 3*q - 3*q^2/2 + 9*q^3/3 + 9*q^4/4 - 12*q^5/5 + 45*q^6/6 - 18*q^7/7 +...
Compare to: q - q^2/2 + q^3/3 + 3*q^4/4 - 4*q^5/5 + 5*q^6/6 - 6*q^7/7 +...
which equals log( Sum_{n>=0} q^(n^2) ) as described by A162552.
		

Crossrefs

Cf. A161804 (variant).

Programs

  • PARI
    {a(n)=local(Q=sum(m=0,n,x^(m^2))+x*O(x^n),A); A=exp(sum(k=1,n,polcoeff(log(Q),k)*3*3^valuation(k,3)*x^k)+x*O(x^n));polcoeff(A,n)}

A162583 G.f.: A(x) = exp( 6*Sum_{n>=1} A006519(n)*A038500(n) * x^n/n ).

Original entry on oeis.org

1, 6, 24, 78, 222, 570, 1356, 3030, 6432, 13074, 25608, 48558, 89502, 160854, 282624, 486534, 822174, 1365978, 2234400, 3602742, 5732202, 9008034, 13993320, 21503730, 32711460, 49287750, 73598280, 108968334, 160041750, 233262786
Offset: 0

Views

Author

Paul D. Hanna, Jul 06 2009

Keywords

Comments

A006519(n) = highest power of 2 dividing n and
A038500(n) = highest power of 3 dividing n.

Examples

			G.f.: A(x) = 1 + 6*x + 24*x^2 + 78*x^3 + 222*x^4 + 570*x^5 + 1356*x^6 + ...
log(A(x))/6 = x + 2*x^2/2 + 3*x^3/3 + 4*x^4/4 + x^5/5 + 6*x^6/6 + x^7/7 + 8*x^8/8 + 9*x^9/9 + ... + A006519(n)*A038500(n)*x^n/n + ...
		

Crossrefs

Programs

  • Mathematica
    nmax = 150; a[n_]:= SeriesCoefficient[Series[Exp[Sum[2^(IntegerExponent[k, 2] + 1)*3^(IntegerExponent[k, 3] + 1)*q^k/k, {k, 1, nmax}]], {q, 0, nmax}], n]; Table[a[n], {n, 0, 50}] (* G. C. Greubel, Jul 04 2018 *)
  • PARI
    {a(n)=local(L=sum(m=1,n,6*2^valuation(m,2)*3^valuation(m,3)*x^m/m)+x*O(x^n));polcoeff(exp(L),n)}

A377555 E.g.f.: exp(Sum_{n>=1} A038500(n) * x^n).

Original entry on oeis.org

1, 1, 3, 25, 121, 861, 10051, 88453, 972945, 16663321, 205667011, 3069838641, 61038456073, 997387656565, 18623707785411, 426663334715101, 8606752819074721, 192052302116929713, 5139946157328092035, 122142504609497184841, 3172736666738570349081, 94751480557190553846541
Offset: 0

Views

Author

Vaclav Kotesovec, Nov 01 2024

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 25; CoefficientList[Series[Exp[Sum[3^IntegerExponent[k, 3]*x^k, {k, 1, nmax}]], {x, 0, nmax}], x] * Range[0,nmax]!

A007949 Greatest k such that 3^k divides n. Or, 3-adic valuation of n.

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 4, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1
Offset: 1

Views

Author

R. Muller

Keywords

Comments

Obeys the general recurrences for p-adic valuation discussed in A214411. - Redjan Shabani, Jul 17 2012
Lexicographically earliest cubefree sequence, which also (conjecturally) appears in the construction of the lexicographically earliest cubefree {0,1}-sequence A282317, cf. Example section of A286940. - M. F. Hasler, May 21 2017
The sequence is invariant under the "lower trim" operator: remove all zeros, and subtract one from each remaining term. - Franklin T. Adams-Watters, May 25 2017

References

  • F. Q. Gouvea, p-Adic Numbers, Springer-Verlag, 1993; see p. 23.

Crossrefs

Partial sums give A054861.
One less than A051064.

Programs

  • Haskell
    a007949 n = if m > 0 then 0 else 1 + a007949 n'
                where (n', m) = divMod n 3
    -- Reinhard Zumkeller, Jun 23 2013, May 14 2011
    
  • MATLAB
    % Input:
    %  n: an integer
    % Output:
    %  m: max power of 3 such that 3^m divides n
    %  M: 1-by-K matrix where M(i) is the max power of 3 such that 3^M(i) divides n
    function [m,M] = Omega3(n)
      M = NaN*zeros(1,n);
      M(1)=0; M(2)=0; M(3)=0;
        for k=4:n
          if M(k-3)~=0
            M(k)=M(k-k/3)+1;
          else
            M(k)=0;
          end
        end
        m=M(end);
    end
    % Redjan Shabani, Jul 17 2012
    
  • Magma
    [Valuation(n, 3): n in [1..110]]; // Bruno Berselli, Aug 05 2013
    
  • Maple
    A007949 := proc(n) option remember; if n mod 3 > 0 then 0 else procname(n/3)+1; fi; end;
    # alternative by R. J. Mathar, Mar 29 2017
    A007949 := proc(n)
        padic[ordp](n,3) ;
    end proc:
  • Mathematica
    p=3; Array[ If[ Mod[ #, p ]==0, Select[ FactorInteger[ # ], Function[ q, q[ [ 1 ] ]==p ], 1 ][ [ 1, 2 ] ], 0 ]&, 81 ]
    Nest[ Function[ l, {Flatten[(l /. {0 -> {0, 0, 1}, 1 -> {0, 0, 2}, 2 -> {0, 0, 3}, 3 -> {0, 0, 4}}) ]}], {0}, 5] (* Robert G. Wilson v, Mar 03 2005 *)
    IntegerExponent[Range[200], 3] (* Zak Seidov, Apr 15 2010 *)
    Table[If[Mod[n, 3] > 0, 0, 1 + b[n/3]], {n, 200}] (* Zak Seidov, Apr 15 2010 *)
  • PARI
    a(n)=valuation(n,3)
    
  • Python
    def a(n):
        k = 0
        while n > 0 and n%3 == 0: n //= 3; k += 1
        return k
    print([a(n) for n in range(1, 106)]) # Michael S. Branicky, Aug 06 2021
  • Sage
    [valuation(n, 3) for n in (1..106)]  # Peter Luschny, Nov 16 2012
    
  • Scheme
    (define (A007949 n) (let loop ((n n) (k 0)) (cond ((not (zero? (modulo n 3))) k) (else (loop (/ n 3) (+ 1 k)))))) ;; Antti Karttunen, Oct 06 2017
    

Formula

a(n) = 0 if n != 0 (mod 3), otherwise a(n) = 1 + a(n/3). - Reinhard Zumkeller, Aug 12 2001, edited by M. F. Hasler, Aug 11 2015
From Ralf Stephan, Apr 12 2002: (Start)
a(n) = A051064(n) - 1.
G.f.: Sum_{k>=1} x^3^k/(1 - x^3^k). (End)
Fixed point of the morphism: 0 -> 001; 1 -> 002; 2 -> 003; 3 -> 004; 4 -> 005; etc.; starting from a(1) = 0. - Philippe Deléham, Mar 29 2004
a(n) mod 2 = 1 - A014578(n). - Reinhard Zumkeller, Oct 04 2008
Totally additive with a(p) = 1 if p = 3, 0 otherwise.
v_{m}(n) = Sum_{r>=1} (r/m^(r+1)) Sum_{j=1..m-1} Sum_{k=0..m^(r+1)-1} exp((2*k*Pi*i*(n+(m-j)*m^r)) / m^(r+1)). This formula is for the general case; for this specific one, set m=3. - A. Neves, Oct 04 2010
a(3n) = A051064(n), a(2n) = a(n), a(2n-1) = A253786(n). - Cyril Damamme, Aug 04 2015
a(3n) = a(n) + 1, a(pn) = a(n) for any other prime p != 3. - M. F. Hasler, Aug 11 2015
3^a(n) = A038500(n). - Antti Karttunen, Oct 09 2017
Asymptotic mean: lim_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 1/2. - Amiram Eldar, Jul 11 2020
a(n) = tau(n)/(tau(3*n) - tau(n)) - 1, where tau(n) = A000005(n). - Peter Bala, Jan 06 2021
a(n) = 3*Sum_{j=1..floor(log_3(n))} frac(binomial(n,3^j)*3^(j-1)/n). - Dario T. de Castro, Jul 10 2022
a(n) = A080342(gcd(n, 3^A080342(n))). - Alan Michael Gómez Calderón, Jul 28 2024

A038502 Remove 3's from n.

Original entry on oeis.org

1, 2, 1, 4, 5, 2, 7, 8, 1, 10, 11, 4, 13, 14, 5, 16, 17, 2, 19, 20, 7, 22, 23, 8, 25, 26, 1, 28, 29, 10, 31, 32, 11, 34, 35, 4, 37, 38, 13, 40, 41, 14, 43, 44, 5, 46, 47, 16, 49, 50, 17, 52, 53, 2, 55, 56, 19, 58, 59, 20, 61, 62, 7, 64, 65, 22, 67, 68, 23, 70, 71, 8, 73, 74, 25, 76
Offset: 1

Views

Author

Keywords

Comments

As well as being multiplicative, a(n) is a strong divisibility sequence, that is, gcd(a(n),a(m)) = a(gcd(n,m)) for n, m >= 1. In particular, a(n) is a divisibility sequence: if n divides m then a(n) divides a(m). - Peter Bala, Feb 21 2019
The largest divisor of n not divisible by 3. - Amiram Eldar, Sep 15 2020

Examples

			From _Peter Bala_, Feb 21 2019: (Start)
Sum_{n >= 1} n*a(n)*x^n = G(x) - (2*3)*G(x^3) - (2*9)*G(x^9) - (2*27)*G(x^27) - ..., where G(x) = x*(1 + x)/(1 - x)^3.
Sum_{n >= 1} (1/n)*a(n)*x^n = H(x) - (2/3)*H(x^3) - (2/9)*H(x^9) - (2/27)*H(x^27) - ..., where H(x) = x/(1 - x).
Sum_{n >= 1} (1/n^2)*a(n)*x^n = L(x) - (2/3^2)*L(x^3) - (2/9^2)*L(x^9) - (2/27^2)*L(x^27) - ..., where L(x) = Log(1/(1 - x)).
Also, Sum_{n >= 1} 1/a(n)*x^n = L(x) + (2/3)*L(x^3) + (2/3)*L(x^9) + (2/3)*L(x^27) + ... .
(End)
		

Crossrefs

Result of iterative removal of other factors: A000265 (2), A065883 (4), A132739 (5), A244414 (6), A242603 (7), A004151 (10).

Programs

  • Haskell
    a038502 n = if m > 0 then n else a038502 n'  where (n', m) = divMod n 3
    -- Reinhard Zumkeller, Jan 03 2011
    
  • Magma
    [n/3^Valuation(n,3): n in [1..80]]; // Bruno Berselli, May 21 2013
  • Mathematica
    f[n_] := Times @@ (First@#^Last@# & /@ Select[ FactorInteger@n, First@# != 3 &]); Array[f, 76] (* Robert G. Wilson v, Jul 31 2006 *)
    Table[n/3^IntegerExponent[n, 3], {n, 100}] (* Amiram Eldar, Sep 15 2020 *)
  • PARI
    a(n)=if(n<1, 0, n/3^valuation(n,3)) /* Michael Somos, Nov 10 2005 */
    

Formula

Multiplicative with a(p^e) = 1 if p = 3, otherwise p^e. - Mitch Harris, Apr 19 2005
a(0) = 0, a(3*n) = a(n), a(3*n+1) = 3*n+1, a(3*n+2) = 3*n+2.
Dirichlet g.f. zeta(s-1)*(3^s-3)/(3^s-1). - R. J. Mathar, Feb 11 2011
From Peter Bala, Feb 21 2019: (Start)
a(n) = n/gcd(n,3^n).
O.g.f.: F(x) - 2*F(x^3) - 2*F(x^9) - 2*F(x^27) - ..., where F(x) = x/(1 - x)^2 is the generating function for the positive integers. More generally, for m >= 1,
Sum_{n >= 0} a(n)^m*x^n = F(m,x) - (3^m - 1)( F(m,x^3) + F(m,x^9) + F(m,x^27) + ... ), where F(m,x) = A(m,x)/(1 - x)^(m+1) with A(m,x) the m_th Eulerian polynomial: A(1,x) = x, A(2,x) = x*(1 + x), A(3,x) = x*(1 + 4*x + x^2) - see A008292.
Repeatedly applying the Euler operator x*d/dx or its inverse operator to the o.g.f. for the sequence produces generating functions for the sequences n^m*a(n), m in Z. Some examples are given below. (End)
Sum_{k=1..n} a(k) ~ (3/8) * n^2. - Amiram Eldar, Oct 29 2022
a(n) = n / A038500(n). - R. J. Mathar, Mar 13 2024

A065331 Largest 3-smooth divisor of n.

Original entry on oeis.org

1, 2, 3, 4, 1, 6, 1, 8, 9, 2, 1, 12, 1, 2, 3, 16, 1, 18, 1, 4, 3, 2, 1, 24, 1, 2, 27, 4, 1, 6, 1, 32, 3, 2, 1, 36, 1, 2, 3, 8, 1, 6, 1, 4, 9, 2, 1, 48, 1, 2, 3, 4, 1, 54, 1, 8, 3, 2, 1, 12, 1, 2, 9, 64, 1, 6, 1, 4, 3, 2, 1, 72, 1, 2, 3, 4, 1, 6, 1, 16, 81, 2, 1, 12, 1, 2, 3, 8, 1, 18, 1, 4, 3, 2, 1, 96
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 29 2001

Keywords

Comments

Bennett, Filaseta, & Trifonov show that if n > 8 then a(n^2 + n) < n^0.715. - Charles R Greathouse IV, May 21 2014

Crossrefs

Related to A053165 via A225546.
Cf. A126760 (ordinal transform of this sequence, from its term a(1) = 1 onward).

Programs

  • Haskell
    a065331 = f 2 1 where
       f p y x | r == 0    = f p (y * p) x'
               | otherwise = if p == 2 then f 3 y x else y
               where (x', r) = divMod x p
    -- Reinhard Zumkeller, Nov 19 2015
    
  • Magma
    [Gcd(n,6^n): n in [1..100]]; // Vincenzo Librandi, Feb 09 2016
  • Maple
    A065331 := proc(n) n/A065330(n) ; end: # R. J. Mathar, Jun 24 2009
    seq(2^padic:-ordp(n,2)*3^padic:-ordp(n,3), n=1..100); # Robert Israel, Feb 08 2016
  • Mathematica
    Table[GCD[n, 6^n], {n, 100}] (* Vincenzo Librandi, Feb 09 2016 *)
    a[n_] := Times @@ ({2, 3}^IntegerExponent[n, {2, 3}]); Array[a, 100] (* Amiram Eldar, Sep 19 2020 *)
  • PARI
    a(n)=3^valuation(n,3)<Charles R Greathouse IV, Aug 21 2011
    
  • PARI
    a(n)=gcd(n,6^n) \\ Not very efficient, but simple. Stanislav Sykora, Feb 08 2016
    
  • PARI
    a(n)=gcd(6^logint(n,2),n) \\ 'optimized' version of Sykora's script; Charles R Greathouse IV, Jul 23 2024
    

Formula

a(n) = n / A065330(n).
a(n) = A006519(n) * A038500(n).
a(n) = (2^A007814 (n)) * (3^A007949(n)).
Multiplicative with a(2^e)=2^e, a(3^e)=3^e, a(p^e)=1, p>3. - Vladeta Jovovic, Nov 05 2001
Dirichlet g.f.: zeta(s)*(1-2^(-s))*(1-3^(-s))/ ( (1-2^(1-s))*(1-3^(1-s)) ). - R. J. Mathar, Jul 04 2011
a(n) = gcd(n,6^n). - Stanislav Sykora, Feb 08 2016
a(A225546(n)) = A225546(A053165(n)). - Peter Munn, Jan 17 2020
Sum_{k=1..n} a(k) ~ n*(log(n)^2 + (2*gamma + 3*log(2) + 2*log(3) - 2)*log(n) + (2 + log(2)^2/6 + 3*log(2)*(log(3) - 1) - 2*log(3) + log(3)^2/6 + gamma*(3*log(2) + 2*log(3) - 2) - 2*sg1)) / (6*log(2)*log(3)), where gamma is the Euler-Mascheroni constant A001620 and sg1 is the first Stieltjes constant (see A082633). - Vaclav Kotesovec, Sep 19 2020
a(n) = A003586(A322026(n)), A322026(n) = A071521(a(n)). - Antti Karttunen, Sep 08 2024
Showing 1-10 of 67 results. Next