OFFSET
1,1
COMMENTS
15 divides abc. Since we define a=2mu and b=m^2-b^2, the order of the triple that generates a(n) can have the first term greater than the second term. For this reason I chose to list the smaller of a and b. The idea for this sequence comes from a post in the Yahoo group mathforfun which is in the link.
LINKS
Cino Hilliard and others, Pythagorean Theorem and prime factors, digest of 9 messages in mathforfun Yahoo group, Feb 20 - Feb 21, 2009. [Cached copy]
MathForFun, Pythagorean triple digital sums.
FORMULA
Let a,b,c, m > u,k be positive integers. If a^2 + b^2 = c^2 then
a = k*2mu,b=k*(m^2-u^2) and c=k*(m^2+u^2).
EXAMPLE
360^2+319^2=481^2. 360=2^3*3^2*5,319=11*29 and 481=13*37. 2+3+5+11+29=13+37.
So 319 is in the sequence.
PROG
(PARI) pythsum(n) =
{
local(v, x, a, b, cm, k, u, s, ct=0);
v=vector(400);
for(m=1, n+n,
for(u=1, n,
for(k=1, n,
a=2*m*u*k;
if(u>m, b=k*(u^2-m^2), b=k*(m^2-u^2));
c=k*(m^2+u^2);
fa=ifactord(a);
fb=ifactord(b);
fc=ifactord(c);
s=0;
s2=0;
for(a1=1, length(fa), s+=fa[a1]);
for(b1=1, length(fb), s+=fb[b1]);
for(c1=1, length(fc), s2+=fc[c1]);
if(s==s2&&b>0,
\\print(m", "u", "k", "a", "b", "c", " fa" + "fb" = "fc);
ct++;
if(a<b, v[ct]=a, v[ct]=b)
)
)
)
);
y=vecsort(v);
for(x=1, 399, if(y[x]>0&&y[x]<>y[x+1], print1(y[x]", ")));
}
ifactord(n) = /* The vector of the distinct integer factors of n. */
{
local(f, j, k, flist);
flist=[];
f=Vec(factor(n));
for(j=1, length(f[1]),
flist = concat(flist, f[1][j])
);
return(flist)
}
CROSSREFS
KEYWORD
nonn
AUTHOR
Cino Hilliard, Feb 20 2009
EXTENSIONS
Based on suggestions from Robert G. Wilson v, corrected sequence, definition, comments, formula and Pari program. - Cino Hilliard, Apr 03 2009
STATUS
approved