A048881 a(n) = A000120(n+1) - 1 = wt(n+1) - 1.
0, 0, 1, 0, 1, 1, 2, 0, 1, 1, 2, 1, 2, 2, 3, 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3
Offset: 0
Examples
From _Omar E. Pol_, Mar 08 2011: (Start) Sequence can be written in the following form (irregular triangle): 0, 0,1, 0,1,1,2, 0,1,1,2,1,2,2,3, 0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4, 0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5, ... Row sums are A001787. (End)
Links
- R. Alter and K. K. Kubota, Prime and Prime Power Divisibility of Catalan Numbers, J. Comb. Th. A 15 (1973) pp. 243-256.
- E. Deutsch and B. E. Sagan, Congruences for Catalan and Motzkin numbers and related sequences, arXiv:math/0407326 [math.CO], 2004; J. Num. Theory 117 (2006), 191-215.
Programs
-
Haskell
a048881 n = a048881_list !! n a048881_list = c [0] where c (x:xs) = x : c (xs ++ [x,x+1]) -- Reinhard Zumkeller, Mar 07 2011 (Python 3.10+) def A048881(n): return (n+1).bit_count()-1 # Chai Wah Wu, Nov 15 2022
-
Maple
A048881 := proc(n) A000120(n+1)-1 ; end proc: seq(A048881(n),n=0..200) ; # R. J. Mathar, Mar 12 2018
-
Mathematica
a[n_] := IntegerExponent[ CatalanNumber[n], 2]; Table[a[n], {n, 0, 104}] (* Jean-François Alcover, Jun 21 2013 *)
-
PARI
{ a(n) = if( n<0, 0, n++; n /= 2^valuation(n,2); subst( Pol( binary( n ) ), x, 1) - 1 ) } /* Michael Somos, Aug 23 2007 */
-
PARI
{a(n) = if( n<0, 0, valuation( (2*n)! / n! / (n+1)!, 2 ) ) } /* Michael Somos, Aug 23 2007 */
-
PARI
a(n) = hammingweight(n+1) - 1; \\ Michel Marcus, Nov 15 2022
Formula
Writing n as 2^m+k with -1 <= k < 2^m-1, then a(n) = A000120(k+1). - Henry Bottomley, Mar 28 2000
a(2*n) = a(n-1)+1, a(2*n+1) = a(n). - Vladeta Jovovic, Oct 10 2002
G.f.: (1/(x-x^2)) * (x^2/(1-x) - Sum_{k>=1} x^(2^k)/(1-x^(2^k))). - Ralf Stephan, Apr 13 2002
a(n+k) = A240857(n,k), 0 <= k <= n; in particular: a(n) = A240857(n,0). - Reinhard Zumkeller, Apr 14 2014
a(n) = (n+1)*2 - A101925(n+1). - Gleb Ivanov, Jan 12 2022
Extensions
Entry revised by N. J. A. Sloane, Jun 07 2009
Comments