OFFSET
0,6
COMMENTS
Also the minimal number of disjoint edge-paths into which the complete graph on n edges can be partitioned - Felix Goldberg (felixg(AT)tx.technion.ac.il), Jan 19 2001
For n >= 2, number of partitions of n-2 into parts that are distinct mod 2. - Giovanni Resta, Feb 06 2006
Sequence starting with a(3) obeys the rule "smallest positive value such that the ordered pair (a(n-1),a(n)) has not occurred previously", or the rule "smallest positive value such that the ratio a(n-1)/a(n) has not occurred previously". The same subsequence has its ordinal transform equal to itself, shifted left. (The ordinal transform has as its n-th term the number of values in a(1),...,a(n) that are equal to a(n).) - Franklin T. Adams-Watters, Dec 13 2006
Numerators of floor(n/2)/n, n > 0. - Wesley Ivan Hurt, Jun 14 2013
Number of nonisomorphic outer planar graphs of order n >= 3, maximum degree 3, and largest possible size. The size is (3n-2)/2 when n is even and (3n-3)/2 when n is odd. - Christian Barrientos and Sarah Minion, Feb 27 2018
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..1000
M. Janjic, Hessenberg Matrices and Integer Sequences , J. Int. Seq. 13 (2010) # 10.7.8
Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1).
FORMULA
a(n) = (n+1)/4+(3-n)*(-1)^n/4. - Paul Barry, Mar 21 2003, corrected by Hieronymus Fischer, Sep 25 2007
a(n) = (a(n-2) + a(n-3)) / a(n-1).
From Paul Barry, Oct 21 2004: (Start)
G.f.: (1-x^2+x^3)/((1+x)^2(1-x)^2);
a(n) = 2*a(n-2) - a(n-4);
a(n) = 0^n + Sum_{k=0..floor((n-2)/2)} C(n-k-2,k) * C(1,n-2k-2). (End)
a(n) = gcd(n-1, floor((n-1)/2)). - Paul Barry, May 02 2005
a(n) = binomial((2n-3)/4-(-1)^n/4, (1-(-1)^n)/2). - Paul Barry, Jun 29 2006
G.f.: (x^3-x^2+1)/(1-x^2)^2 = 1 + x^2*G(0) where G(k) = 1 + x*(k+1)/(1 - x/(x + (k+1)/G(k+1) )); (continued fraction, 3-step). - Sergei N. Gladkovskii, Nov 29 2012
a(n) = binomial(floor(n/2), n mod 2). - Wesley Ivan Hurt, Oct 14 2013
a(n) = 1 - n mod 2 * (1 - floor(n/2)). - Reinhard Zumkeller, Aug 11 2014
a(n) = floor(n/2)^(n mod 2). - Wesley Ivan Hurt, Mar 16 2015
E.g.f.: ((2 + x)*cosh(x) - sinh(x))/2. - Stefano Spezia, Mar 26 2022
EXAMPLE
For n=12, C(12,6) - C(11,5) = 924 - 462 = 462, gcd(C(12,6), C(11,5)) = 462, and the quotient is 1.
For n=13, C(13,6) - C(12,6) = 792, gcd(C(13,6), C(12,6)) = 132, and the quotient is 6.
MAPLE
MATHEMATICA
With[{no=45}, Riffle[Table[1, {no}], Range[0, no-1]]] (* Harvey P. Dale, Feb 18 2011 *)
PROG
(Haskell)
import Data.List (transpose)
a057979 n = 1 - rest * (1 - n') where (n', rest) = divMod n 2
a057979_list = concat $ transpose [repeat 1, [0..]]
-- Reinhard Zumkeller, Aug 11 2014
(Magma) [Floor(n/2)^(n mod 2): n in [0..100]]; // Vincenzo Librandi, Mar 17 2015
(PARI) a(n)=if(n%2, n-1, 2)/2 \\ Charles R Greathouse IV, Sep 02 2015
(Python)
def A057979(n): return n>>1 if n&1 else 1 # Chai Wah Wu, Jan 04 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Labos Elemer, Nov 13 2000
STATUS
approved