cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A065423 Number of ordered length 2 compositions of n with at least one even summand.

This page as a plain text file.
%I A065423 #57 Aug 27 2025 09:15:34
%S A065423 0,0,2,1,4,2,6,3,8,4,10,5,12,6,14,7,16,8,18,9,20,10,22,11,24,12,26,13,
%T A065423 28,14,30,15,32,16,34,17,36,18,38,19,40,20,42,21,44,22,46,23,48,24,50,
%U A065423 25,52,26,54,27,56,28,58,29,60,30,62,31,64,32,66,33,68,34,70,35,72,36,74
%N A065423 Number of ordered length 2 compositions of n with at least one even summand.
%H A065423 Stefano Spezia, <a href="/A065423/b065423.txt">Table of n, a(n) for n = 1..10000</a>
%H A065423 Mircea Merca and Emil Simion, <a href="https://doi.org/10.3390/sym15112067">n-Color Partitions into Distinct Parts as Sums over Partitions</a>, Symmetry (2023) Vol. 15, Iss. 11.
%H A065423 <a href="/index/Tu#2wis">Index entries for two-way infinite sequences</a>
%H A065423 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,2,0,-1).
%F A065423 G.f.: x^3*(x+2)/(1-x^2)^2.
%F A065423 a(n) = floor((n-1)/2) + (n is odd)*floor((n-1)/2).
%F A065423 a(n+2) = Sum_{k=0..n} (gcd(n, k) mod 2). - _Paul Barry_, May 02 2005
%F A065423 a(n) = Sum_{i=1..n-1} (-1)^i (floor(i/2) + ((i+1) mod 2)). - _Olivier Gérard_, Jun 21 2007
%F A065423 a(n) = A210530(n,4)/2 for n>2. - _Boris Putievskiy_, Jan 29 2013
%F A065423 a(n) = (3*n-4-n*(-1)^n)/4. - _Boris Putievskiy_, Jan 29 2013, corrected Jan 24 2022
%F A065423 a(n) = A026741(n)-1. - _Wesley Ivan Hurt_, Jun 23 2013
%F A065423 a(n) = floor((n-1) / 2^mod(n-1,2)). - _Mia Boudreau_, Aug 27 2025
%F A065423 E.g.f.: 1 + (x - 1)*cosh(x) + (x - 2)*sinh(x)/2. - _Stefano Spezia_, Dec 17 2023
%e A065423 a(7) = 6 because we can write 7 = 1+6 = 2+5 = 3+4 = 4+3 = 5+2 = 6+1; a(8) = 3 because we can write 8 = 2+6 = 4+4 = 6+2.
%p A065423 A065423 := proc(n)
%p A065423     (3*n-4-(-1)^n*n)/4 ;
%p A065423 end proc:
%p A065423 seq(A065423(n),n=1..40) ; # _R. J. Mathar_, Jan 24 2022
%t A065423 LinearRecurrence[{0,2,0,-1},{0,0,2,1},100] (* _Harvey P. Dale_, May 14 2014 *)
%o A065423 (PARI) a(n)=n-=2;if(n%2,n+1,n/2)
%o A065423 (C) int a(int n){n--;return n>>(n&1);} // _Mia Boudreau_, Aug 27 2025
%Y A065423 Cf. A026741, A097140 (first differences), A030451 (absolute first differences), A210530.
%K A065423 nonn,easy,changed
%O A065423 1,3
%A A065423 _Len Smiley_, Nov 23 2001