/All/
|
index
catalog
recent
update
post
|
/math/
/tech/
/anime/
/misc/
/free/
/meta/
|
Guide
dark
mod
Log
P5722
Wed 2022-08-10 15:29:59
link
reply
Rtriangle.svg
814 B 346x294
One side of a right-angled triangle is 48. Find ten pairs of whole numbers which may represent the other two sides.
P5724
pyfaggotry theorem
Wed 2022-08-10 18:02:32
link
reply
10 and 49
14 and 50
20 and 52
27 and 55
36 and 60
55 and 73
64 and 80
90 and 102
100 and 111
111 and 121
Referenced by:
P5725
P5735
P5725
Wed 2022-08-10 18:07:41
link
reply
P5724
>>> [a**2 + b**2 == c**2 for a, b, c in [sorted([int(w) for w in l.split(' and ')] + [48]) for l in s.split('\n')]]
[False, True, True, False, True, True, True, True, False, False]
P5735
py*****ean faggotrem cont.
Wed 2022-08-10 20:50:28
link
reply
P5724
140 and 148
189 and 195
286 and 290
575 and 577
P5738
Wed 2022-08-10 21:21:01
link
reply
b8fac595b638fb1ae35f32520653d2b7b2dc3e57d1a17ab2ae432ef53124b6c6.txt
708 B
So, we want a and b integers, so that 48²=a²±b². I could easily write a program that loops over a and b to find each value that works, but are there optimizations that could be made?
Let's take N=48
For one, a and b have the same parity (if N even), or opposite parities (if N odd), so we only need to test half the pairs
Where N²=a²+b², (N is the hypotenuse) we only need a≤b≤N (we'll get the same values for b≤a≤N).
Where N²=a²-b², (a is the hypotenuse) we only need a-N≤b<a and a≥N. One fact that is less obvious is that we only have to test for
[tex:
a
\le
\frac
{
N
^
2
+1
}
{
2
}
]
Proof: Let's assume that there exist an integer
[tex:
a >
\frac
{
N
^
2
+1
}
{
2
}
]
such that there exist an integer b<a verifying N²=a²-b². Then, N²<2a-1 => N²<a²-(a-1)² => b>a-1 => b≥a.
Since b<a and b≥a cannot both be verified, there is no integer
[tex:
a >
\frac
{
N
^
2
+1
}
{
2
}
]
such that there exist an integer b<a verifying N²=a²-b².
With all that said, the pairs of whole numbers that satisfy 48²=a²±b² are only ten:
50, 14
52, 20
60, 36
73, 55
80, 64
102, 90
148, 140
195, 189
290, 286
577, 575
Attached is the program that computed these
Referenced by:
P5742
P5742
Wed 2022-08-10 22:10:07
link
reply
P5738
>Attached is the program that computed these
How do I run it?
Referenced by:
P5745
P5745
Wed 2022-08-10 22:38:33
link
reply
P5742
Name it foo.c and run
cc foo.c
./a.out
I am so glad I got sniped, I don't have optimized implementations of Euclid's method of finding pytriples for one given side length on the brain. What I was doing sucked.
>
[tex:
\exists
]
only ten, eh. What's the proof of that?
Referenced by:
P5757
P5757
Thu 2022-08-11 04:43:38
link
reply
P5745
I didn't exactly prove that there were only ten, I proved that there were no pair with a>1152, and I tried every value until that point
P5759
Thu 2022-08-11 06:35:27
link
reply
Hypothesis: when N is even,
[tex:
\left(\left
\lfloor
\frac
{
N
^
2
+5
}
{
4
}
\right
\rfloor
,
\lfloor
\frac
{
N
^
2
-3
}
{
4
}
\right
\rfloor
\right)
]
is a solution. When N is odd,
[tex:
\left(\left
\lfloor
\frac
{
N
^
2
+1
}
{
2
}
\right
\rfloor
,
\lfloor
\frac
{
N
^
2
-1
}
{
2
}
\right
\rfloor
\right)
]
is a solution.
Can you prove this or find a counter-example?
Referenced by:
P5760
P5761
P5760
Thu 2022-08-11 06:37:41
link
reply
P5759
Oh, this doesn't support large parentheses.
> Hypothesis: when N is even,
[tex:
(
\lfloor
\fracc{N
^
2
+5}{4}
\rfloor
,
\lfloor
\frac
{
N
^
2
-3
}
{
4
}
\rfloor
)
]
is a solution.
> When N is odd,
[tex:
(
\lfloor
\frac
{
N
^
2
+1
}
{
2
}
\rfloor
,
\lfloor
\frac
{
N
^
2
-1
}
{
2
}
\rfloor
)
]
is a solution.
> Can you prove this or find a counter-example?
Referenced by:
P5761
P5778
P5761
Thu 2022-08-11 06:52:57
link
reply
P5759
P5760
***** it, you get the idea.
I forgot to precise, this is for N≥3
P5778
Thu 2022-08-11 14:52:47
link
reply
P5760
You can drop the floor function by changing it to
> Hypothesis: when N is even,
[tex:
(\fracc{N
^
2
}{4}+1 ,
\frac
{
N
^
2
}
{
4
}
-1 )
]
is a solution.
> When N is odd,
[tex:
(
\frac
{
N
^
2
+1
}
{
2
}
,
\frac
{
N
^
2
-1
}
{
2
}
)
]
is a solution.
which is easy to verify algebraically.
Referenced by:
P5779
P5779
Thu 2022-08-11 14:53:15
link
reply
P5778
> Hypothesis: when N is even,
[tex:
(
\frac
{
N
^
2
}
{
4
}
+1 ,
\frac
{
N
^
2
}
{
4
}
-1 )
]
is a solution.
> When N is odd,
[tex:
(
\frac
{
N
^
2
+1
}
{
2
}
,
\frac
{
N
^
2
-1
}
{
2
}
)
]
is a solution.
Mod Controls:
x
Reason: