A270417 Number of integer-sided right triangles with semiperimeter n.
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 2, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 3, 0, 0, 1, 0, 0, 2, 0, 0, 0, 1, 0, 2, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 3, 0, 0, 0, 1, 0, 3, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 2, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1
Offset: 1
Keywords
Examples
a(25)=0 since 2*25 = 50 is not the perimeter of a suitable triangle; a(30)=2 since 2*30 = 60 = 15+20+25 = 10+24+26; a(35)=1 since 2*35 = 70 = 20+21+29.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537
Programs
-
Mathematica
a[n_] := Count[{x, y, z} /. {ToRules[Reduce[x>0 && y>0 && z>0 && z
Jean-François Alcover, Jun 03 2017 *) -
PARI
A270417(n) = { my(s=0); fordiv(n,x,fordiv(n/x,y,my(w=n/(x*y)); if((w < 2*y)&&(w>y)&&(w%2)&&(1==gcd(w,y)),s++))); (s); }; \\ (Here z = w-y) - Antti Karttunen, Sep 25 2018
Comments