OFFSET
1,1
COMMENTS
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..2500
FORMULA
G.f.: x * (2 + x + 10*x^2 - 5*x^3 + 11*x^4 - 19*x^5 + x^6 - 2*x^7 + 3*x^8) / (1 - x - 6*x^3 + 6*x^4 + x^6 - x^7). - Michael Somos, Dec 25 2016
a(n) = a(n-1) + 6*a(n-3) - 6*a(n-4) - a(n-6) + a(n-7) if n>9. - Michael Somos, Dec 25 2016
EXAMPLE
G.f. = 2*x + 3*x^2 + 13*x^3 + 20*x^4 + 37*x^5 + 78*x^6 + 119*x^7 + 218*x^8 + ...
MATHEMATICA
Drop[CoefficientList[Series[x*(2 + x + 10*x^2 - 5*x^3 + 11*x^4 - 19*x^5 + x^6 - 2*x^7 + 3*x^8)/(1 - x - 6*x^3 + 6*x^4 + x^6 - x^7), {x, 0, 50}], x], 1] (* G. C. Greubel, Aug 09 2018 *)
PROG
(PARI) m=0; for(n=1, 10^9, t=n*(n+1)/2; s=sqrtint(t); d=min(t-s^2, (s+1)^2-t); r=d/n; if(r>m, m=r; print1(n, ", ")))
(PARI) {a(n) = if( n<1, 0, polcoeff( (1 + x + x^2 + 4*x^3 + x^4 + 11*x^5 - 18*x^6 - 2*x^8 + 3*x^9) / (1 - x - 6*x^3 + 6*x^4 + x^6 - x^7) + x * O(x^n), n))}; /* Michael Somos, Dec 25 2016 */
(Magma) m:=50; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!(x*(2 +x+10*x^2-5*x^3+11*x^4-19*x^5+x^6-2*x^7+3*x^8)/(1-x-6*x^3+6*x^4+x^6- x^7))); // G. C. Greubel, Aug 09 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Ralf Stephan, Sep 14 2013
STATUS
approved