%I #21 Jul 25 2024 20:56:10
%S 2,7,14,23,35,50,67,86,107,131,158,187,218,251,287,326,367,410,455,
%T 503,554,607,662,719,779,842,907,974,1043,1115,1190,1267,1346,1427,
%U 1511,1598,1687,1778,1871,1967,2066,2167,2270,2375,2483,2594,2707,2822,2939
%N Expansion of (2+3*x+2*x^2+2*x^3+3*x^4+x^5-x^6)/(1-2*x+x^2-x^5+2*x^6-x^7).
%C At A227581, it is conjectured that a(n) = floor[1/(2*H(n) + H(n^2 + n - 1) - g], where H denotes harmonic number and g denotes the Euler-Mascheroni constant.
%H Clark Kimberling, <a href="/A227582/b227582.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_07">Index entries for linear recurrences with constant coefficients</a>, signature (2,-1,0,0,1,-2,1)
%F a(n) = 2*a(n-1) - a(n-2) + a(n-5) - 2*a(n-6) + a(n-7).
%F G.f.: (1+x) * (2+x+x^2+x^3+2*x^4-x^5) / ((1-x)^3 * (1+x+x^2+x^3+x^4)).
%t z = 60; a[1]=2; a[2]=7; a[3]=14; a[4]=23; a[5]=35; a[6]=50; a[7] = 67; a[8]=86; a[n_]:= a[n]= 2*a[n-1] -a[n-2] +a[n-5] -2*a[n-6] + a[n-7]; Table[a[n], {n, 1, z}] (* A227582 *)
%t h[n_] := h[n] = HarmonicNumber[n]; t1 = N[Table[2 h[n] - h[n^2 + n - 1] - EulerGamma, {n, 1, z}]]; Floor[1/t1]; (* conjectured A227582 *)
%t CoefficientList[Series[(1+x)*(2+x+x^2+x^3+2*x^4-x^5)/((1-x)^3*(1+x+x^2+ x^3+x^4)), {x, 0, 50}], x]] (* _G. C. Greubel_, Aug 04 2018 *)
%o (PARI) my(x='x+O('x^50)); Vec((1+x)*(2+x+x^2+x^3+2*x^4-x^5)/((1-x)^3*(1+x + x^2+x^3+x^4))) \\ _G. C. Greubel_, Aug 04 2018
%o (Magma) R<x>:=PowerSeriesRing(Integers(), 50); Coefficients(R!( (1+x)*(2+x+x^2+x^3+2*x^4-x^5)/((1-x)^3*(1+x+x^2+x^3+x^4)) )); // _G. C. Greubel_, Aug 04 2018
%o (Sage) ((1+x)*(2+x+x^2+x^3+2*x^4-x^5)/((1-x)^3*(1+x+x^2+x^3+x^4)) ).series(x, 30).coefficients(x, sparse=False) # _G. C. Greubel_, May 06 2019
%Y Cf. A227581.
%K nonn,easy
%O 1,1
%A _Clark Kimberling_, Jul 17 2013