A067397 Maximal power of 3 that divides n-th Catalan number.
0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 3, 3, 3, 2, 2, 2, 2, 2, 2, 3, 3, 3, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 3, 3, 3, 2, 2, 2, 2, 2, 2, 3, 3, 3, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2
Offset: 0
Examples
a(13)=0 since Catalan(13)=742900, which is not divisible by 3; a(14)=2 since Catalan(14)=2674440, which is divisible by 9 but not by 27.
Links
- Robert Israel, Table of n, a(n) for n = 0..10000
- Henry Bottomley, Illustration for A067397.
Programs
-
Maple
ListTools:-PartialSums([seq(padic:-ordp((2*n-1)/(n+1),3),n=0..100)]); # Robert Israel, Sep 20 2015
-
Mathematica
f[n_] := Block[{p = FactorInteger@ n}, Take[Last /@ p, Flatten@ Position[First /@ p, 3]]]; Table[f[(2 n)!/n!/(n + 1)!], {n, 104}] /. {} -> 0 // Flatten (* Michael De Vlieger, Sep 21 2015 *) IntegerExponent[#,3]&/@CatalanNumber[Range[0,110]] (* Harvey P. Dale, Oct 09 2015 *)
-
PARI
a(n) = (sumdigits(n,3) + sumdigits(n+1,3) - sumdigits(2*n,3) - 1)/2 \\ Jianing Song, Feb 24 2024
Formula
Let k=floor(log3(n)), i.e., 3^k<=n<3^(k+1): if (3/2)*3^k
G.f.: Sum_{k>=1} (x^((3^k+1)/2) - x^(3^k-1))/((1-x^(3^k))*(1-x)). - Robert Israel, Sep 20 2015
Comments