login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A057979 a(n) = 1 for even n and (n-1)/2 for odd n. 16

%I #73 Jan 04 2024 11:55:58

%S 1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1,8,1,9,1,10,1,11,1,12,1,13,1,14,1,

%T 15,1,16,1,17,1,18,1,19,1,20,1,21,1,22,1,23,1,24,1,25,1,26,1,27,1,28,

%U 1,29,1,30,1,31,1,32,1,33,1,34,1,35,1,36,1,37,1,38,1,39,1,40,1,41,1,42,1,43,1

%N a(n) = 1 for even n and (n-1)/2 for odd n.

%C a(n) = b(n)/c(n) where b(n) = A001405(n+1) - A001405(n), c(n) = gcd(A001405(n+1), A001405(n)).

%C 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

%C For n >= 2, number of partitions of n-2 into parts that are distinct mod 2. - _Giovanni Resta_, Feb 06 2006

%C 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

%C Numerators of floor(n/2)/n, n > 0. - _Wesley Ivan Hurt_, Jun 14 2013

%C 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

%H Reinhard Zumkeller, <a href="/A057979/b057979.txt">Table of n, a(n) for n = 0..1000</a>

%H M. Janjic, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL13/Janjic/janjic33.html">Hessenberg Matrices and Integer Sequences </a>, J. Int. Seq. 13 (2010) # 10.7.8

%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,2,0,-1).

%F a(n) = (n+1)/4+(3-n)*(-1)^n/4. - _Paul Barry_, Mar 21 2003, corrected by _Hieronymus Fischer_, Sep 25 2007

%F a(n) = (a(n-2) + a(n-3)) / a(n-1).

%F From _Paul Barry_, Oct 21 2004: (Start)

%F G.f.: (1-x^2+x^3)/((1+x)^2(1-x)^2);

%F a(n) = 2*a(n-2) - a(n-4);

%F a(n) = 0^n + Sum_{k=0..floor((n-2)/2)} C(n-k-2,k) * C(1,n-2k-2). (End)

%F a(n) = gcd(n-1, floor((n-1)/2)). - _Paul Barry_, May 02 2005

%F a(n) = binomial((2n-3)/4-(-1)^n/4, (1-(-1)^n)/2). - _Paul Barry_, Jun 29 2006

%F 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

%F a(n) = binomial(floor(n/2), n mod 2). - _Wesley Ivan Hurt_, Oct 14 2013

%F a(n) = 1 - n mod 2 * (1 - floor(n/2)). - _Reinhard Zumkeller_, Aug 11 2014

%F a(n) = floor(n/2)^(n mod 2). - _Wesley Ivan Hurt_, Mar 16 2015

%F E.g.f.: ((2 + x)*cosh(x) - sinh(x))/2. - _Stefano Spezia_, Mar 26 2022

%e 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.

%e For n=13, C(13,6) - C(12,6) = 792, gcd(C(13,6), C(12,6)) = 132, and the quotient is 6.

%p A057979:=n->(n+1)/4+(3-n)*(-1)^n/4; seq(A057979(k), k=0..100); # _Wesley Ivan Hurt_, Oct 14 2013

%t With[{no=45},Riffle[Table[1,{no}],Range[0,no-1]]] (* _Harvey P. Dale_, Feb 18 2011 *)

%o (Haskell)

%o import Data.List (transpose)

%o a057979 n = 1 - rest * (1 - n') where (n', rest) = divMod n 2

%o a057979_list = concat $ transpose [repeat 1, [0..]]

%o -- _Reinhard Zumkeller_, Aug 11 2014

%o (Magma) [Floor(n/2)^(n mod 2): n in [0..100]]; // _Vincenzo Librandi_, Mar 17 2015

%o (PARI) a(n)=if(n%2,n-1,2)/2 \\ _Charles R Greathouse IV_, Sep 02 2015

%o (Python)

%o def A057979(n): return n>>1 if n&1 else 1 # _Chai Wah Wu_, Jan 04 2024

%Y Cf. A001405, A007879, A059222, A000035, A027656, A037952, A067992, A152271.

%K nonn,easy

%O 0,6

%A _Labos Elemer_, Nov 13 2000

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 22:18 EDT 2024. Contains 371782 sequences. (Running on oeis4.)