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.
%I A376007 #8 Sep 27 2024 10:08:47 %S A376007 7,8,27,19,61,42,125,83,211,137,343,204,505,299,729,428,991,578,1331, %T A376007 749,1717,964,2197,1229,2731,1523,3375,1846,4081,2229,4913,2678,5815, %U A376007 3164,6859,3687,7981,4286,9261,4967,10627,5693,12167,6464,13801,7327,15625 %N A376007 For integers n>=4, greatest integer that can satisfy sqrt((n^2-c)*b^2 + c*(b+1)^2) where b and c are positive integers and c < n^2. %H A376007 <a href="/index/Rec#order_20">Index entries for linear recurrences with constant coefficients</a>, signature (0,2,0,-1,0,0,0,2,0,-4,0,2,0,0,0,-1,0,2,0,-1). %F A376007 a(n) = A375336(n, A376005(n)). %F A376007 a(n) = (n^3-4*n+8)/8 for n%4==0. %F A376007 a(n) = (n^3-9*n+24)/16 for n%8==1 or n%8==7. %F A376007 a(n) = (n^3)/8 for n%4==2. %F A376007 a(n) = (n^3-n+8)/16 for n%8==3 or n%8==5. %F A376007 From _Chai Wah Wu_, Sep 27 2024: (Start) %F A376007 a(n) = 2*a(n-2) - a(n-4) + 2*a(n-8) - 4*a(n-10) + 2*a(n-12) - a(n-16) + 2*a(n-18) - a(n-20) for n > 23. %F A376007 G.f.: x^4*(-2*x^19 - x^18 + 3*x^17 + x^16 - 2*x^15 + 2*x^14 + 4*x^13 + 2*x^12 + 7*x^11 + 20*x^10 - 3*x^9 + 8*x^8 + 18*x^7 + 30*x^6 + 12*x^5 + 14*x^4 + 3*x^3 + 13*x^2 + 8*x + 7)/((x - 1)^4*(x + 1)^4*(x^2 + 1)^2*(x^4 + 1)^2). (End) %o A376007 (PARI) a(n)=my(d=n^2, t=ceil(n^3/8)); while(t>=n, my(b=floor(sqrt(t^2/d)), r=t^2-d*b^2); if (r && r%(b*2+1)==0, return(t)); t--) %o A376007 for(n=4, 100, print(n, " ", a(n))) %o A376007 (PARI) a(n)=if(n%4==2, 2*n^3, n%4==0, 2*n^3-8*n+16, abs(n%8-4)==1, n^3-n+8, n^3-9*n+24)/16 %o A376007 for(n=4, 100, print(n, " ", a(n))) %o A376007 (Python) %o A376007 def A376007(n): %o A376007 if (m:=n&7)==0 or m==4: %o A376007 return n*(n**2-4)+8>>3 %o A376007 elif m==1 or m==7: %o A376007 return n*(n**2-9)+24>>4 %o A376007 elif m==2 or m==6: %o A376007 return n**3>>3 %o A376007 else: %o A376007 return n*(n**2-1)+8>>4 # _Chai Wah Wu_, Sep 27 2024 %Y A376007 Cf. A375336, A376005. %K A376007 nonn %O A376007 4,1 %A A376007 _Charles L. Hohn_, Sep 05 2024