A004396 One even number followed by two odd numbers.
0, 1, 1, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 11, 11, 12, 13, 13, 14, 15, 15, 16, 17, 17, 18, 19, 19, 20, 21, 21, 22, 23, 23, 24, 25, 25, 26, 27, 27, 28, 29, 29, 30, 31, 31, 32, 33, 33, 34, 35, 35, 36, 37, 37, 38, 39, 39, 40, 41, 41, 42, 43, 43, 44, 45, 45, 46, 47, 47
Offset: 0
Examples
G.f. = x + x^2 + 2*x^3 + 3*x^4 + 3*x^5 + 4*x^6 + 5*x^7 + 5*x^8 + 6*x^9 + 7*x^10 + ...
References
- J. Kurschak, Hungarian Mathematical Olympiads, 1976, Mir, Moscow.
- Paul Vanderlind, Richard K. Guy, and Loren C. Larson, The Inquisitive Problem Solver, MAA, 2002. See Problem 252.
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..10000
- A. Adem and R. J. Milgram, Cohomology of Finite Groups, Springer-Verlag, 2nd. ed., 2004; p. 246.
- Art of Problem Solving Forum, Ordered triples choosing. - _Joel B. Lewis_, May 21 2009
- J. Choi and N. Pippenger, Counting the Angels and Devils in Escher's Circle Limit IV, arXiv preprint arXiv:1310.1357 [math.CO], 2013.
- C. L. Mallows and N. J. A. Sloane, Weight enumerators of self-orthogonal codes, Discrete Math., 9 (1974), 391-400 (see proof of Theorem 1).
- Gabriel Nivasch and Eyal Lev, Nonattacking Queens on a Triangle, Mathematics Magazine, Vol. 78, No. 5 (Dec., 2005), pp. 399-403. See Eq. (4).
- John A. Pelesko, Generalizing the Conway-Hofstadter $10,000 Sequence, Journal of Integer Sequences, Vol. 7 (2004), Article 04.3.5.
- William A. Stein, Dimensions of the spaces S_k(Gamma_0(N)).
- William A. Stein, The modular forms database
- Eric Weisstein's World of Mathematics, Independence Number.
- 50th International Mathematical Olympiad 2009, Problem Shortlist with Solutions.
- Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
- Index to sequences related to Olympiads.
Crossrefs
Programs
-
Haskell
a004396 n = a004396_list !! n a004396_list = 0 : 1 : 1 : map (+ 2) a004396_list -- Reinhard Zumkeller, Nov 06 2012
-
Magma
[(Floor(n/3) + Ceiling(n/3)): n in [0..70]]; // Vincenzo Librandi, Aug 07 2011
-
Maple
A004396:=n->floor((2*n + 1)/3); seq(A004396(n), n=0..100); # Wesley Ivan Hurt, Nov 30 2013
-
Mathematica
Table[Floor[(2 n + 1)/3], {n, 0, 75}] With[{n = 50}, Riffle[Range[0, n], Range[1, n, 2], {3, -1, 3}]] (* Harvey P. Dale, May 14 2015 *) CoefficientList[Series[(x + x^3)/((1 - x) (1 - x^3)), {x, 0, 71}], x] (* Michael De Vlieger, Oct 27 2016 *) a[ n_] := Quotient[2 n + 1, 3]; (* Michael Somos, Oct 23 2017 *) a[ n_] := Sign[n] SeriesCoefficient[ (x + x^3) / ((1 - x) (1 - x^3)), {x, 0, Abs@n}]; (* Michael Somos, Oct 23 2017 *) LinearRecurrence[{1, 0, 1, -1}, {1, 1, 2, 3}, {0, 20}] (* Eric W. Weisstein, Jul 14 2017 *) f[-1]=0; f[n_]:=Length[Union[Plus@@@FrobeniusSolve[{1,2,3},n]]]; f/@Range[-1,100] (* Ivan N. Ianakiev, Mar 31 2025 *)
-
PARI
a(n)=2*n\/3 \\ Charles R Greathouse IV, Apr 17 2012
-
Sage
def a(n) : return( dimension_cusp_forms( Gamma0(3), 2*n+4) ); # Michael Somos, Jul 03 2014
Formula
G.f.: (x+x^3)/((1-x)*(1-x^3)).
a(n) = floor( (2*n + 1)/3 ).
a(n) = a(n-1) + (1/2)*((-1)^floor((4*n+2)/3) + 1), a(0) = 0. - Mario Catalani (mario.catalani(AT)unito.it), Oct 20 2003
a(n) = 2n/3 - cos(2*Pi*n/3 + Pi/3)/3 + sqrt(3)*sin(2*Pi*n/3 + Pi/3)/9. - Paul Barry, Mar 18 2004
From Paul Barry, Jan 16 2005: (Start)
G.f.: x*(1+x^2)/(1-x-x^3+x^4).
a(n) = a(n-1) + a(n-3) - a(n-4) for n>3.
a(n) = Sum_{k = 0..n} binomial(n-k-1, k)*(-1)^k*A001045(n-2k). (End)
a(n) = (A006369(n) - (A006369(n) mod 2) * (-1)^(n mod 3)) / (1 + A006369(n) mod 2). - Reinhard Zumkeller, Jan 23 2005
a(n) = floor(n/3) + ceiling(n/3). - Jonathan Vos Post, Mar 19 2006
a(n+1) = A008620(2n). - Philippe Deléham, Dec 14 2006
a(A032766(n)) = n. - Reinhard Zumkeller, Oct 30 2009
a(n) = floor((2*n^2+4*n+2)/(3*n+4)). - Gary Detlefs, Jul 13 2010
Euler transform of length 4 sequence [1, 1, 1, -1]. - Michael Somos, Jul 03 2014
a(n) = n - floor((n+1)/3). - Wesley Ivan Hurt, Sep 17 2015
a(n) = A092200(n) - floor((n+5)/3). - Filip Zaludek, Oct 27 2016
a(n) = -a(-n) for all n in Z. - Michael Somos, Oct 30 2016
E.g.f.: (2/9)*(3*exp(x)*x + sqrt(3)*exp(-x/2)*sin(sqrt(3)*x/2)). - Stefano Spezia, Sep 20 2022
Sum_{n>=1} (-1)^(n+1)/a(n) = log(2)/2. - Amiram Eldar, Sep 29 2022
Comments