login
Expansion of (1 + 2*x + 2*x^2 + 2*x^3 - 5*x^4 + 2*x^5 + 2*x^6 + 2*x^7)/((1 - x)^2*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7)).
2

%I #18 Feb 09 2023 01:58:01

%S 1,3,5,7,2,4,6,8,9,11,13,15,10,12,14,16,17,19,21,23,18,20,22,24,25,27,

%T 29,31,26,28,30,32,33,35,37,39,34,36,38,40,41,43,45,47,42,44,46,48,49,

%U 51,53,55,50,52,54,56,57,59,61,63,58,60,62,64,65,67,69,71,66,68,70,72,73,75,77

%N Expansion of (1 + 2*x + 2*x^2 + 2*x^3 - 5*x^4 + 2*x^5 + 2*x^6 + 2*x^7)/((1 - x)^2*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7)).

%C 4 consecutive odds, 4 consecutive evens.

%H Ilya Gutkovskiy, <a href="/A271833/a271833.jpg">Illustration of initial terms</a>.

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

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>.

%F G.f.: (1 + 2*x + 2*x^2 + 2*x^3 - 5*x^4 + 2*x^5 + 2*x^6 + 2*x^7)/((1 - x)^2*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7)).

%F a(n) = a(n-1) + a(n-8) - a(n-9).

%F a(n) = 1 + 2*n + 6*floor(n/8) - 7*floor(n/4). - _Vaclav Kotesovec_, Apr 15 2016

%F Sum_{n>=0} (-1)^n/a(n) = Pi/4 + log(2)/2. - _Amiram Eldar_, Feb 09 2023

%t CoefficientList[Series[(1 + 2 x + 2 x^2 + 2 x^3 - 5 x^4 + 2 x^5 + 2 x^6 + 2 x^7)/((1 - x)^2 (1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7)), {x, 0, 75}], x]

%t LinearRecurrence[{1, 0, 0, 0, 0, 0, 0, 1, -1}, {1, 3, 5, 7, 2, 4, 6, 8, 9}, 75]

%o (PARI) my(x='x+O('x^99)); Vec((1+2*x+2*x^2+2*x^3-5*x^4+2*x^5+2*x^6+2*x^7)/((1-x)^2*(1+x+x^2+x^3+x^4+x^5+x^6+x^7))) \\ _Altug Alkan_, Apr 15 2016

%Y Cf. A000027, A116966, A131793.

%K nonn,easy

%O 0,2

%A _Ilya Gutkovskiy_, Apr 15 2016