cp's OEIS Frontend

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.

Showing 1-1 of 1 results.

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.

Original entry on oeis.org

7, 8, 27, 19, 61, 42, 125, 83, 211, 137, 343, 204, 505, 299, 729, 428, 991, 578, 1331, 749, 1717, 964, 2197, 1229, 2731, 1523, 3375, 1846, 4081, 2229, 4913, 2678, 5815, 3164, 6859, 3687, 7981, 4286, 9261, 4967, 10627, 5693, 12167, 6464, 13801, 7327, 15625
Offset: 4

Views

Author

Charles L. Hohn, Sep 05 2024

Keywords

Crossrefs

Programs

  • 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--)
    for(n=4, 100, print(n, " ", a(n)))
    
  • 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
    for(n=4, 100, print(n, " ", a(n)))
    
  • Python
    def A376007(n):
        if (m:=n&7)==0 or m==4:
            return n*(n**2-4)+8>>3
        elif m==1 or m==7:
            return n*(n**2-9)+24>>4
        elif m==2 or m==6:
            return n**3>>3
        else:
            return n*(n**2-1)+8>>4 # Chai Wah Wu, Sep 27 2024

Formula

a(n) = A375336(n, A376005(n)).
a(n) = (n^3-4*n+8)/8 for n%4==0.
a(n) = (n^3-9*n+24)/16 for n%8==1 or n%8==7.
a(n) = (n^3)/8 for n%4==2.
a(n) = (n^3-n+8)/16 for n%8==3 or n%8==5.
From Chai Wah Wu, Sep 27 2024: (Start)
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.
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)
Showing 1-1 of 1 results.