A229117 Numbers k where d/k reaches a new record, with d the distance from the k-th triangular number to the nearest square.
2, 3, 13, 20, 37, 78, 119, 218, 457, 696, 1273, 2666, 4059, 7422, 15541, 23660, 43261, 90582, 137903, 252146, 527953, 803760, 1469617, 3077138, 4684659, 8565558, 17934877, 27304196, 49923733, 104532126, 159140519, 290976842
Offset: 1
Keywords
Examples
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 + ...
Links
- G. C. Greubel, Table of n, a(n) for n = 1..2500
Programs
-
Magma
m:=50; R
:=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 -
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 *)
-
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 */
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
Comments