Skip to main content
code layout
Source Link
Artes
  • 57.9k
  • 13
  • 159
  • 247
Solve[a^2Solve[ a^2 + b^2 == c^2 && a < 100 && b < 100 && c < 100, {a, b, c}, Integers]

gives me this result

{{c -> ConditionalExpression[-Sqrt[
a^2 + b^2], ((a | b | c) [Element] Integers &&
Sqrt[10000 - a^2] - b > 0 && -99 <=
a <= -1) || ((a | b | c) [Element] Integers &&
Sqrt[10000 - a^2] - b > 0 &&
1 <= a <= 99) || ((a | b | c) [Element] Integers &&
Sqrt[10000 - a^2] + b <= 0 && -99 <=
a <= -1) || ((a | b | c) [Element] Integers &&
Sqrt[10000 - a^2] + b <= 0 &&
[etc.]

{{c -> ConditionalExpression[-Sqrt[ a^2 + b^2],
         ((a | b | c) ∈ Integers &&  Sqrt[10000 - a^2] - b > 0  && -99 <= a <= -1) ||
         ((a | b | c) ∈ Integers &&  Sqrt[10000 - a^2] - b > 0  &&   1 <= a <= 99) || 
         ((a | b | c) ∈ Integers &&  Sqrt[10000 - a^2] + b <= 0 && -99 <= a <= -1) ||
         ((a | b | c) ∈ Integers &&  Sqrt[10000 - a^2] + b <= 0 &&   1 <= a <= 99) ||
              ...           ] },   ...  }

where I would expect something like

{{x $\rightarrow$ 3, y $\rightarrow$ 4, z $\rightarrow$ 5}, {x $\rightarrow$ 4, y $\rightarrow$ 3, z $\rightarrow$ 5}, {x $\rightarrow$ 5, y $\rightarrow$ 12, z $\rightarrow$ 13}...}

{{x -> 3, y -> 4, z -> 5}, {x -> 4, y -> 3, z -> 5}, {x -> 5, y -> 12, z -> 13},...}

What am I doing wrong?

Solve[a^2 + b^2 == c^2 && a < 100 && b < 100 && c < 100, {a, b, c}, Integers]

gives me this result

{{c -> ConditionalExpression[-Sqrt[
a^2 + b^2], ((a | b | c) [Element] Integers &&
Sqrt[10000 - a^2] - b > 0 && -99 <=
a <= -1) || ((a | b | c) [Element] Integers &&
Sqrt[10000 - a^2] - b > 0 &&
1 <= a <= 99) || ((a | b | c) [Element] Integers &&
Sqrt[10000 - a^2] + b <= 0 && -99 <=
a <= -1) || ((a | b | c) [Element] Integers &&
Sqrt[10000 - a^2] + b <= 0 &&
[etc.]

where I would expect something like

{{x $\rightarrow$ 3, y $\rightarrow$ 4, z $\rightarrow$ 5}, {x $\rightarrow$ 4, y $\rightarrow$ 3, z $\rightarrow$ 5}, {x $\rightarrow$ 5, y $\rightarrow$ 12, z $\rightarrow$ 13}...}

What am I doing wrong?

Solve[ a^2 + b^2 == c^2 && a < 100 && b < 100 && c < 100, {a, b, c}, Integers]

gives me this result

{{c -> ConditionalExpression[-Sqrt[ a^2 + b^2],
         ((a | b | c) ∈ Integers &&  Sqrt[10000 - a^2] - b > 0  && -99 <= a <= -1) ||
         ((a | b | c) ∈ Integers &&  Sqrt[10000 - a^2] - b > 0  &&   1 <= a <= 99) || 
         ((a | b | c) ∈ Integers &&  Sqrt[10000 - a^2] + b <= 0 && -99 <= a <= -1) ||
         ((a | b | c) ∈ Integers &&  Sqrt[10000 - a^2] + b <= 0 &&   1 <= a <= 99) ||
              ...           ] },   ...  }

where I would expect something like

{{x -> 3, y -> 4, z -> 5}, {x -> 4, y -> 3, z -> 5}, {x -> 5, y -> 12, z -> 13},...}

What am I doing wrong?

Tweeted twitter.com/#!/StackMma/status/245039546562129920
added 146 characters in body
Source Link
stevenvh
  • 7k
  • 5
  • 42
  • 64
Solve[a^2 + b^2 == c^2 && a < 100 && b < 100 && c < 100, {a, b, c}, Integers]

gives me this result

{{c -> ConditionalExpression[-Sqrt[
a^2 + b^2], ((a | b | c) [Element] Integers &&
Sqrt[10000 - a^2] - b > 0 && -99 <=
a <= -1) || ((a | b | c) [Element] Integers &&
Sqrt[10000 - a^2] - b > 0 &&
1 <= a <= 99) || ((a | b | c) [Element] Integers &&
Sqrt[10000 - a^2] + b <= 0 && -99 <=
a <= -1) || ((a | b | c) [Element] Integers &&
Sqrt[10000 - a^2] + b <= 0 &&
[etc.]

where I would expect something like

{{3x $\rightarrow$ 3, y $\rightarrow$ 4, z $\rightarrow$ 5}, {4x $\rightarrow$ 4, y $\rightarrow$ 3, z $\rightarrow$ 5}, {5x $\rightarrow$ 5, y $\rightarrow$ 12, z $\rightarrow$ 13}, ...}

What am I doing wrong?

Solve[a^2 + b^2 == c^2 && a < 100 && b < 100 && c < 100, {a, b, c}, Integers]

gives me this result

{{c -> ConditionalExpression[-Sqrt[
a^2 + b^2], ((a | b | c) [Element] Integers &&
Sqrt[10000 - a^2] - b > 0 && -99 <=
a <= -1) || ((a | b | c) [Element] Integers &&
Sqrt[10000 - a^2] - b > 0 &&
1 <= a <= 99) || ((a | b | c) [Element] Integers &&
Sqrt[10000 - a^2] + b <= 0 && -99 <=
a <= -1) || ((a | b | c) [Element] Integers &&
Sqrt[10000 - a^2] + b <= 0 &&
[etc.]

where I would expect something like

{{3, 4, 5}, {4, 3, 5}, {5, 12, 13}, ...}

What am I doing wrong?

Solve[a^2 + b^2 == c^2 && a < 100 && b < 100 && c < 100, {a, b, c}, Integers]

gives me this result

{{c -> ConditionalExpression[-Sqrt[
a^2 + b^2], ((a | b | c) [Element] Integers &&
Sqrt[10000 - a^2] - b > 0 && -99 <=
a <= -1) || ((a | b | c) [Element] Integers &&
Sqrt[10000 - a^2] - b > 0 &&
1 <= a <= 99) || ((a | b | c) [Element] Integers &&
Sqrt[10000 - a^2] + b <= 0 && -99 <=
a <= -1) || ((a | b | c) [Element] Integers &&
Sqrt[10000 - a^2] + b <= 0 &&
[etc.]

where I would expect something like

{{x $\rightarrow$ 3, y $\rightarrow$ 4, z $\rightarrow$ 5}, {x $\rightarrow$ 4, y $\rightarrow$ 3, z $\rightarrow$ 5}, {x $\rightarrow$ 5, y $\rightarrow$ 12, z $\rightarrow$ 13}...}

What am I doing wrong?

Source Link
stevenvh
  • 7k
  • 5
  • 42
  • 64

Why don't I get numeric values from this Solve?

Solve[a^2 + b^2 == c^2 && a < 100 && b < 100 && c < 100, {a, b, c}, Integers]

gives me this result

{{c -> ConditionalExpression[-Sqrt[
a^2 + b^2], ((a | b | c) [Element] Integers &&
Sqrt[10000 - a^2] - b > 0 && -99 <=
a <= -1) || ((a | b | c) [Element] Integers &&
Sqrt[10000 - a^2] - b > 0 &&
1 <= a <= 99) || ((a | b | c) [Element] Integers &&
Sqrt[10000 - a^2] + b <= 0 && -99 <=
a <= -1) || ((a | b | c) [Element] Integers &&
Sqrt[10000 - a^2] + b <= 0 &&
[etc.]

where I would expect something like

{{3, 4, 5}, {4, 3, 5}, {5, 12, 13}, ...}

What am I doing wrong?