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.

A376900 a(n) is the number of distinct integer-sided right triangles that can be drawn into a square with side length n.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 8, 10, 10, 10, 11, 11, 11, 11, 13, 13, 14, 14, 17, 17, 17, 18, 18, 18, 18, 19, 20, 21, 23, 25, 25, 25, 25, 27, 27, 27, 27, 29, 31, 31, 31, 34, 34, 34, 34, 37, 37, 37, 37, 40, 41, 42, 43, 43, 45, 45, 46
Offset: 0

Views

Author

Felix Huber, Oct 25 2024

Keywords

Examples

			a(11) = 3 because exactly the 3 integer-sided right triangles (3, 4, 5), (6, 8, 10), (5, 12, 13) can be drawn into a square with side length 11.
See linked Maple program to calculate the right triangles for a given n.
		

Crossrefs

Cf. A009012.

Programs

  • Maple
    A376900:=proc(n)
       local a,p,q,v,k;
       a:=0;
          for p from 2 to evalf(sqrt(sqrt(2)*n+1)) do
             for q from 1 to min(p-1,floor(n/(sqrt(2)*p))) do
                if gcd(p,q)=1 and is(p+q,odd) then
                   v:=max(p^2-q^2,2*p*q);
                   k:=min(p^2-q^2,2*p*q)/v;
                   a:=a+floor(n/v*sqrt(k^2-2*k+2));
                fi;
             od;
          od;
       return a;
    end proc;
    seq(A376900(n),n=0..70);