A350040 Number of integer-sided right triangles with hypotenuse A009003(n).
1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 2, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 4, 1, 1, 1, 1, 1, 4, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 1, 1, 2, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 4, 1, 2
Offset: 1
Links
- Ruediger Jehn, Table of n, a(n) for n = 1..13211
- A. Tripathi, On Pythagorean triples containing a fixed integer, Fib. Q., 46/47 (2008/2009), 331-340.
- Wikipedia, Integer Triangle
Programs
-
PARI
is_A009003(n)=setsearch(Set(factor(n)[, 1]%4), 1); f(n) = {my(f = factor(n/(2^valuation(n, 2)))); (prod(k=1, #f~, if ((f[k, 1] % 4) == 1, 2*f[k, 2] + 1, 1)) - 1)/2; } \\ A046080 lista(nn) = apply(f, select(is_A009003, [1..nn])); \\ Michel Marcus, Jan 13 2022
-
PARI
A046080(n,f=factor(n))=prod(k=if(f[1,1]==2,2,1), #f~, if (f[k,1]%4 == 1, 2*f[k,2] + 1, 1))\2; \\ doesn't handle n = 1, not relevant here upto(lim)=my(v=List(),u=vectorsmall(lim\=1)); forprimestep(p=5,lim,4, forstep(n=p,lim,p, u[n]=1)); forfactored(n=5,lim, if(u[n[1]], listput(v, A046080(0,n[2])))); u=0; Vec(v) \\ Charles R Greathouse IV, Jan 13 2022
-
PARI
upto(lim)=my(v=List()); forfactored(n=5,lim\=1, if(vecmin(n[2][,1]%4)==1, listput(v, prod(k=if(n[2][1,1]>2,1,2),#n[2]~, if (n[2][k,1]%4 == 1, 2*n[2][k,2] + 1, 1))\2))); Vec(v) \\ Charles R Greathouse IV, Jan 13 2022
Comments