 # Lagrange four-square (Bachet Conjecture) for 178

<-- Enter Number

What is the Lagrange four-square (Bachet Conjecture) for 178

Lagrange's Four Square Theorem states that any natural number (p) can be stated as the sum of four-square integers
p = a2 + b2 + c2 + d2

## Step 1: - Determine a:

Step 1a: Floor(√178 = 13.341664064126) = Floor(13.341664064126)
Step 1a: Floor(13.341664064126) = 13 <-- This is the maximum value of a, call it max_a

Step 1b. Obtain the first value of a such that a2 ≥ n/4, call it min_a
Start with min_a = 1 and increase by 1 until we reach or breach n/4 → 178/4 = 44.5
When min_a = 7, then it is a2 = 49 ≥ 44.5, so min_a = 7

## a = 7

Step 3a: Determine max_b which is Floor(√n - a2)
max_b = Floor(√178 - 72)
max_b = Floor(√178 - 49)
max_b = Floor(√129)
max_b = Floor(11.357816691601)
max_b = 11

Step 3b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_b = 1 and increase by 1until we reach or breach (n - a2)/3 → (178 - 72)/3 = 43
When min_b = 7, then it is b2 = 49 ≥ 43, so min_b = 7

## b = 7

Step 5a: Determine max_c which is Floor(√n - a2 - b2)
max_c = Floor(√178 - 72 - 72)
max_c = Floor(√178 - 49 - 49)
max_c = Floor(√80)
max_c = Floor(8.9442719099992)
max_c = 8

Step 5b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_c = 1 and increase by 1 until we reach or breach (n - a2 - b2 )/2 → (178 - 72 - 72)/2 = 40
When min_c = 7, then it is c2 = 49 ≥ 40, so min_c = 7

## c = 7

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 72 - 72 - 72
max_d = √178 - 49 - 49 - 49
max_d = √31
max_d = 5.56776436283

Since max_d = 5.56776436283 is not an integer, this is not a solution

## c = 8

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 72 - 72 - 82
max_d = √178 - 49 - 49 - 64
max_d = √16
max_d = 4

Since max_d = 4, then (a, b, c, d) = (7, 7, 8, 4) is an integer solution proven below
72 + 72 + 82 + 42 → 49 + 49 + 64 + 16 = 178

## b = 8

Step 5a: Determine max_c which is Floor(√n - a2 - b2)
max_c = Floor(√178 - 72 - 82)
max_c = Floor(√178 - 49 - 64)
max_c = Floor(√65)
max_c = Floor(8.0622577482985)
max_c = 8

Step 5b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_c = 1 and increase by 1 until we reach or breach (n - a2 - b2 )/2 → (178 - 72 - 82)/2 = 32.5
When min_c = 6, then it is c2 = 36 ≥ 32.5, so min_c = 6

## c = 6

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 72 - 82 - 62
max_d = √178 - 49 - 64 - 36
max_d = √29
max_d = 5.3851648071345

Since max_d = 5.3851648071345 is not an integer, this is not a solution

## c = 7

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 72 - 82 - 72
max_d = √178 - 49 - 64 - 49
max_d = √16
max_d = 4

Since max_d = 4, then (a, b, c, d) = (7, 8, 7, 4) is an integer solution proven below
72 + 82 + 72 + 42 → 49 + 64 + 49 + 16 = 178

## c = 8

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 72 - 82 - 82
max_d = √178 - 49 - 64 - 64
max_d = √1
max_d = 1

Since max_d = 1, then (a, b, c, d) = (7, 8, 8, 1) is an integer solution proven below
72 + 82 + 82 + 12 → 49 + 64 + 64 + 1 = 178

## b = 9

Step 5a: Determine max_c which is Floor(√n - a2 - b2)
max_c = Floor(√178 - 72 - 92)
max_c = Floor(√178 - 49 - 81)
max_c = Floor(√48)
max_c = Floor(6.9282032302755)
max_c = 6

Step 5b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_c = 1 and increase by 1 until we reach or breach (n - a2 - b2 )/2 → (178 - 72 - 92)/2 = 24
When min_c = 5, then it is c2 = 25 ≥ 24, so min_c = 5

## c = 5

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 72 - 92 - 52
max_d = √178 - 49 - 81 - 25
max_d = √23
max_d = 4.7958315233127

Since max_d = 4.7958315233127 is not an integer, this is not a solution

## c = 6

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 72 - 92 - 62
max_d = √178 - 49 - 81 - 36
max_d = √12
max_d = 3.4641016151378

Since max_d = 3.4641016151378 is not an integer, this is not a solution

## b = 10

Step 5a: Determine max_c which is Floor(√n - a2 - b2)
max_c = Floor(√178 - 72 - 102)
max_c = Floor(√178 - 49 - 100)
max_c = Floor(√29)
max_c = Floor(5.3851648071345)
max_c = 5

Step 5b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_c = 1 and increase by 1 until we reach or breach (n - a2 - b2 )/2 → (178 - 72 - 102)/2 = 14.5
When min_c = 4, then it is c2 = 16 ≥ 14.5, so min_c = 4

## c = 4

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 72 - 102 - 42
max_d = √178 - 49 - 100 - 16
max_d = √13
max_d = 3.605551275464

Since max_d = 3.605551275464 is not an integer, this is not a solution

## c = 5

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 72 - 102 - 52
max_d = √178 - 49 - 100 - 25
max_d = √4
max_d = 2

Since max_d = 2, then (a, b, c, d) = (7, 10, 5, 2) is an integer solution proven below
72 + 102 + 52 + 22 → 49 + 100 + 25 + 4 = 178

## b = 11

Step 5a: Determine max_c which is Floor(√n - a2 - b2)
max_c = Floor(√178 - 72 - 112)
max_c = Floor(√178 - 49 - 121)
max_c = Floor(√8)
max_c = Floor(2.8284271247462)
max_c = 2

Step 5b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_c = 1 and increase by 1 until we reach or breach (n - a2 - b2 )/2 → (178 - 72 - 112)/2 = 4
When min_c = 2, then it is c2 = 4 ≥ 4, so min_c = 2

## c = 2

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 72 - 112 - 22
max_d = √178 - 49 - 121 - 4
max_d = √4
max_d = 2

Since max_d = 2, then (a, b, c, d) = (7, 11, 2, 2) is an integer solution proven below
72 + 112 + 22 + 22 → 49 + 121 + 4 + 4 = 178

## a = 8

Step 3a: Determine max_b which is Floor(√n - a2)
max_b = Floor(√178 - 82)
max_b = Floor(√178 - 64)
max_b = Floor(√114)
max_b = Floor(10.677078252031)
max_b = 10

Step 3b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_b = 1 and increase by 1until we reach or breach (n - a2)/3 → (178 - 82)/3 = 38
When min_b = 7, then it is b2 = 49 ≥ 38, so min_b = 7

## b = 7

Step 5a: Determine max_c which is Floor(√n - a2 - b2)
max_c = Floor(√178 - 82 - 72)
max_c = Floor(√178 - 64 - 49)
max_c = Floor(√65)
max_c = Floor(8.0622577482985)
max_c = 8

Step 5b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_c = 1 and increase by 1 until we reach or breach (n - a2 - b2 )/2 → (178 - 82 - 72)/2 = 32.5
When min_c = 6, then it is c2 = 36 ≥ 32.5, so min_c = 6

## c = 6

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 82 - 72 - 62
max_d = √178 - 64 - 49 - 36
max_d = √29
max_d = 5.3851648071345

Since max_d = 5.3851648071345 is not an integer, this is not a solution

## c = 7

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 82 - 72 - 72
max_d = √178 - 64 - 49 - 49
max_d = √16
max_d = 4

Since max_d = 4, then (a, b, c, d) = (8, 7, 7, 4) is an integer solution proven below
82 + 72 + 72 + 42 → 64 + 49 + 49 + 16 = 178

## c = 8

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 82 - 72 - 82
max_d = √178 - 64 - 49 - 64
max_d = √1
max_d = 1

Since max_d = 1, then (a, b, c, d) = (8, 7, 8, 1) is an integer solution proven below
82 + 72 + 82 + 12 → 64 + 49 + 64 + 1 = 178

## b = 8

Step 5a: Determine max_c which is Floor(√n - a2 - b2)
max_c = Floor(√178 - 82 - 82)
max_c = Floor(√178 - 64 - 64)
max_c = Floor(√50)
max_c = Floor(7.0710678118655)
max_c = 7

Step 5b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_c = 1 and increase by 1 until we reach or breach (n - a2 - b2 )/2 → (178 - 82 - 82)/2 = 25
When min_c = 5, then it is c2 = 25 ≥ 25, so min_c = 5

## c = 5

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 82 - 82 - 52
max_d = √178 - 64 - 64 - 25
max_d = √25
max_d = 5

Since max_d = 5, then (a, b, c, d) = (8, 8, 5, 5) is an integer solution proven below
82 + 82 + 52 + 52 → 64 + 64 + 25 + 25 = 178

## c = 6

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 82 - 82 - 62
max_d = √178 - 64 - 64 - 36
max_d = √14
max_d = 3.7416573867739

Since max_d = 3.7416573867739 is not an integer, this is not a solution

## c = 7

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 82 - 82 - 72
max_d = √178 - 64 - 64 - 49
max_d = √1
max_d = 1

Since max_d = 1, then (a, b, c, d) = (8, 8, 7, 1) is an integer solution proven below
82 + 82 + 72 + 12 → 64 + 64 + 49 + 1 = 178

## b = 9

Step 5a: Determine max_c which is Floor(√n - a2 - b2)
max_c = Floor(√178 - 82 - 92)
max_c = Floor(√178 - 64 - 81)
max_c = Floor(√33)
max_c = Floor(5.744562646538)
max_c = 5

Step 5b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_c = 1 and increase by 1 until we reach or breach (n - a2 - b2 )/2 → (178 - 82 - 92)/2 = 16.5
When min_c = 5, then it is c2 = 25 ≥ 16.5, so min_c = 5

## c = 5

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 82 - 92 - 52
max_d = √178 - 64 - 81 - 25
max_d = √8
max_d = 2.8284271247462

Since max_d = 2.8284271247462 is not an integer, this is not a solution

## b = 10

Step 5a: Determine max_c which is Floor(√n - a2 - b2)
max_c = Floor(√178 - 82 - 102)
max_c = Floor(√178 - 64 - 100)
max_c = Floor(√14)
max_c = Floor(3.7416573867739)
max_c = 3

Step 5b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_c = 1 and increase by 1 until we reach or breach (n - a2 - b2 )/2 → (178 - 82 - 102)/2 = 7
When min_c = 3, then it is c2 = 9 ≥ 7, so min_c = 3

## c = 3

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 82 - 102 - 32
max_d = √178 - 64 - 100 - 9
max_d = √5
max_d = 2.2360679774998

Since max_d = 2.2360679774998 is not an integer, this is not a solution

## a = 9

Step 3a: Determine max_b which is Floor(√n - a2)
max_b = Floor(√178 - 92)
max_b = Floor(√178 - 81)
max_b = Floor(√97)
max_b = Floor(9.8488578017961)
max_b = 9

Step 3b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_b = 1 and increase by 1until we reach or breach (n - a2)/3 → (178 - 92)/3 = 32.333333333333
When min_b = 6, then it is b2 = 36 ≥ 32.333333333333, so min_b = 6

## b = 6

Step 5a: Determine max_c which is Floor(√n - a2 - b2)
max_c = Floor(√178 - 92 - 62)
max_c = Floor(√178 - 81 - 36)
max_c = Floor(√61)
max_c = Floor(7.8102496759067)
max_c = 7

Step 5b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_c = 1 and increase by 1 until we reach or breach (n - a2 - b2 )/2 → (178 - 92 - 62)/2 = 30.5
When min_c = 6, then it is c2 = 36 ≥ 30.5, so min_c = 6

## c = 6

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 92 - 62 - 62
max_d = √178 - 81 - 36 - 36
max_d = √25
max_d = 5

Since max_d = 5, then (a, b, c, d) = (9, 6, 6, 5) is an integer solution proven below
92 + 62 + 62 + 52 → 81 + 36 + 36 + 25 = 178

## c = 7

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 92 - 62 - 72
max_d = √178 - 81 - 36 - 49
max_d = √12
max_d = 3.4641016151378

Since max_d = 3.4641016151378 is not an integer, this is not a solution

## b = 7

Step 5a: Determine max_c which is Floor(√n - a2 - b2)
max_c = Floor(√178 - 92 - 72)
max_c = Floor(√178 - 81 - 49)
max_c = Floor(√48)
max_c = Floor(6.9282032302755)
max_c = 6

Step 5b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_c = 1 and increase by 1 until we reach or breach (n - a2 - b2 )/2 → (178 - 92 - 72)/2 = 24
When min_c = 5, then it is c2 = 25 ≥ 24, so min_c = 5

## c = 5

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 92 - 72 - 52
max_d = √178 - 81 - 49 - 25
max_d = √23
max_d = 4.7958315233127

Since max_d = 4.7958315233127 is not an integer, this is not a solution

## c = 6

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 92 - 72 - 62
max_d = √178 - 81 - 49 - 36
max_d = √12
max_d = 3.4641016151378

Since max_d = 3.4641016151378 is not an integer, this is not a solution

## b = 8

Step 5a: Determine max_c which is Floor(√n - a2 - b2)
max_c = Floor(√178 - 92 - 82)
max_c = Floor(√178 - 81 - 64)
max_c = Floor(√33)
max_c = Floor(5.744562646538)
max_c = 5

Step 5b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_c = 1 and increase by 1 until we reach or breach (n - a2 - b2 )/2 → (178 - 92 - 82)/2 = 16.5
When min_c = 5, then it is c2 = 25 ≥ 16.5, so min_c = 5

## c = 5

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 92 - 82 - 52
max_d = √178 - 81 - 64 - 25
max_d = √8
max_d = 2.8284271247462

Since max_d = 2.8284271247462 is not an integer, this is not a solution

## b = 9

Step 5a: Determine max_c which is Floor(√n - a2 - b2)
max_c = Floor(√178 - 92 - 92)
max_c = Floor(√178 - 81 - 81)
max_c = Floor(√16)
max_c = Floor(4)
max_c = 4

Step 5b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_c = 1 and increase by 1 until we reach or breach (n - a2 - b2 )/2 → (178 - 92 - 92)/2 = 8
When min_c = 3, then it is c2 = 9 ≥ 8, so min_c = 3

## c = 3

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 92 - 92 - 32
max_d = √178 - 81 - 81 - 9
max_d = √7
max_d = 2.6457513110646

Since max_d = 2.6457513110646 is not an integer, this is not a solution

## c = 4

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 92 - 92 - 42
max_d = √178 - 81 - 81 - 16
max_d = √0
max_d = 0

Since max_d = 0, then (a, b, c, d) = (9, 9, 4, 0) is an integer solution proven below
92 + 92 + 42 + 02 → 81 + 81 + 16 + 0 = 178

## a = 10

Step 3a: Determine max_b which is Floor(√n - a2)
max_b = Floor(√178 - 102)
max_b = Floor(√178 - 100)
max_b = Floor(√78)
max_b = Floor(8.8317608663278)
max_b = 8

Step 3b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_b = 1 and increase by 1until we reach or breach (n - a2)/3 → (178 - 102)/3 = 26
When min_b = 6, then it is b2 = 36 ≥ 26, so min_b = 6

## b = 6

Step 5a: Determine max_c which is Floor(√n - a2 - b2)
max_c = Floor(√178 - 102 - 62)
max_c = Floor(√178 - 100 - 36)
max_c = Floor(√42)
max_c = Floor(6.4807406984079)
max_c = 6

Step 5b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_c = 1 and increase by 1 until we reach or breach (n - a2 - b2 )/2 → (178 - 102 - 62)/2 = 21
When min_c = 5, then it is c2 = 25 ≥ 21, so min_c = 5

## c = 5

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 102 - 62 - 52
max_d = √178 - 100 - 36 - 25
max_d = √17
max_d = 4.1231056256177

Since max_d = 4.1231056256177 is not an integer, this is not a solution

## c = 6

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 102 - 62 - 62
max_d = √178 - 100 - 36 - 36
max_d = √6
max_d = 2.4494897427832

Since max_d = 2.4494897427832 is not an integer, this is not a solution

## b = 7

Step 5a: Determine max_c which is Floor(√n - a2 - b2)
max_c = Floor(√178 - 102 - 72)
max_c = Floor(√178 - 100 - 49)
max_c = Floor(√29)
max_c = Floor(5.3851648071345)
max_c = 5

Step 5b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_c = 1 and increase by 1 until we reach or breach (n - a2 - b2 )/2 → (178 - 102 - 72)/2 = 14.5
When min_c = 4, then it is c2 = 16 ≥ 14.5, so min_c = 4

## c = 4

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 102 - 72 - 42
max_d = √178 - 100 - 49 - 16
max_d = √13
max_d = 3.605551275464

Since max_d = 3.605551275464 is not an integer, this is not a solution

## c = 5

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 102 - 72 - 52
max_d = √178 - 100 - 49 - 25
max_d = √4
max_d = 2

Since max_d = 2, then (a, b, c, d) = (10, 7, 5, 2) is an integer solution proven below
102 + 72 + 52 + 22 → 100 + 49 + 25 + 4 = 178

## b = 8

Step 5a: Determine max_c which is Floor(√n - a2 - b2)
max_c = Floor(√178 - 102 - 82)
max_c = Floor(√178 - 100 - 64)
max_c = Floor(√14)
max_c = Floor(3.7416573867739)
max_c = 3

Step 5b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_c = 1 and increase by 1 until we reach or breach (n - a2 - b2 )/2 → (178 - 102 - 82)/2 = 7
When min_c = 3, then it is c2 = 9 ≥ 7, so min_c = 3

## c = 3

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 102 - 82 - 32
max_d = √178 - 100 - 64 - 9
max_d = √5
max_d = 2.2360679774998

Since max_d = 2.2360679774998 is not an integer, this is not a solution

## a = 11

Step 3a: Determine max_b which is Floor(√n - a2)
max_b = Floor(√178 - 112)
max_b = Floor(√178 - 121)
max_b = Floor(√57)
max_b = Floor(7.5498344352707)
max_b = 7

Step 3b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_b = 1 and increase by 1until we reach or breach (n - a2)/3 → (178 - 112)/3 = 19
When min_b = 5, then it is b2 = 25 ≥ 19, so min_b = 5

## b = 5

Step 5a: Determine max_c which is Floor(√n - a2 - b2)
max_c = Floor(√178 - 112 - 52)
max_c = Floor(√178 - 121 - 25)
max_c = Floor(√32)
max_c = Floor(5.6568542494924)
max_c = 5

Step 5b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_c = 1 and increase by 1 until we reach or breach (n - a2 - b2 )/2 → (178 - 112 - 52)/2 = 16
When min_c = 4, then it is c2 = 16 ≥ 16, so min_c = 4

## c = 4

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 112 - 52 - 42
max_d = √178 - 121 - 25 - 16
max_d = √16
max_d = 4

Since max_d = 4, then (a, b, c, d) = (11, 5, 4, 4) is an integer solution proven below
112 + 52 + 42 + 42 → 121 + 25 + 16 + 16 = 178

## c = 5

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 112 - 52 - 52
max_d = √178 - 121 - 25 - 25
max_d = √7
max_d = 2.6457513110646

Since max_d = 2.6457513110646 is not an integer, this is not a solution

## b = 6

Step 5a: Determine max_c which is Floor(√n - a2 - b2)
max_c = Floor(√178 - 112 - 62)
max_c = Floor(√178 - 121 - 36)
max_c = Floor(√21)
max_c = Floor(4.5825756949558)
max_c = 4

Step 5b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_c = 1 and increase by 1 until we reach or breach (n - a2 - b2 )/2 → (178 - 112 - 62)/2 = 10.5
When min_c = 4, then it is c2 = 16 ≥ 10.5, so min_c = 4

## c = 4

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 112 - 62 - 42
max_d = √178 - 121 - 36 - 16
max_d = √5
max_d = 2.2360679774998

Since max_d = 2.2360679774998 is not an integer, this is not a solution

## b = 7

Step 5a: Determine max_c which is Floor(√n - a2 - b2)
max_c = Floor(√178 - 112 - 72)
max_c = Floor(√178 - 121 - 49)
max_c = Floor(√8)
max_c = Floor(2.8284271247462)
max_c = 2

Step 5b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_c = 1 and increase by 1 until we reach or breach (n - a2 - b2 )/2 → (178 - 112 - 72)/2 = 4
When min_c = 2, then it is c2 = 4 ≥ 4, so min_c = 2

## c = 2

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 112 - 72 - 22
max_d = √178 - 121 - 49 - 4
max_d = √4
max_d = 2

Since max_d = 2, then (a, b, c, d) = (11, 7, 2, 2) is an integer solution proven below
112 + 72 + 22 + 22 → 121 + 49 + 4 + 4 = 178

## a = 12

Step 3a: Determine max_b which is Floor(√n - a2)
max_b = Floor(√178 - 122)
max_b = Floor(√178 - 144)
max_b = Floor(√34)
max_b = Floor(5.8309518948453)
max_b = 5

Step 3b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_b = 1 and increase by 1until we reach or breach (n - a2)/3 → (178 - 122)/3 = 11.333333333333
When min_b = 4, then it is b2 = 16 ≥ 11.333333333333, so min_b = 4

## b = 4

Step 5a: Determine max_c which is Floor(√n - a2 - b2)
max_c = Floor(√178 - 122 - 42)
max_c = Floor(√178 - 144 - 16)
max_c = Floor(√18)
max_c = Floor(4.2426406871193)
max_c = 4

Step 5b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_c = 1 and increase by 1 until we reach or breach (n - a2 - b2 )/2 → (178 - 122 - 42)/2 = 9
When min_c = 3, then it is c2 = 9 ≥ 9, so min_c = 3

## c = 3

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 122 - 42 - 32
max_d = √178 - 144 - 16 - 9
max_d = √9
max_d = 3

Since max_d = 3, then (a, b, c, d) = (12, 4, 3, 3) is an integer solution proven below
122 + 42 + 32 + 32 → 144 + 16 + 9 + 9 = 178

## c = 4

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 122 - 42 - 42
max_d = √178 - 144 - 16 - 16
max_d = √2
max_d = 1.4142135623731

Since max_d = 1.4142135623731 is not an integer, this is not a solution

## b = 5

Step 5a: Determine max_c which is Floor(√n - a2 - b2)
max_c = Floor(√178 - 122 - 52)
max_c = Floor(√178 - 144 - 25)
max_c = Floor(√9)
max_c = Floor(3)
max_c = 3

Step 5b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_c = 1 and increase by 1 until we reach or breach (n - a2 - b2 )/2 → (178 - 122 - 52)/2 = 4.5
When min_c = 3, then it is c2 = 9 ≥ 4.5, so min_c = 3

## c = 3

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 122 - 52 - 32
max_d = √178 - 144 - 25 - 9
max_d = √0
max_d = 0

Since max_d = 0, then (a, b, c, d) = (12, 5, 3, 0) is an integer solution proven below
122 + 52 + 32 + 02 → 144 + 25 + 9 + 0 = 178

## a = 13

Step 3a: Determine max_b which is Floor(√n - a2)
max_b = Floor(√178 - 132)
max_b = Floor(√178 - 169)
max_b = Floor(√9)
max_b = Floor(3)
max_b = 3

Step 3b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_b = 1 and increase by 1until we reach or breach (n - a2)/3 → (178 - 132)/3 = 3
When min_b = 2, then it is b2 = 4 ≥ 3, so min_b = 2

## b = 2

Step 5a: Determine max_c which is Floor(√n - a2 - b2)
max_c = Floor(√178 - 132 - 22)
max_c = Floor(√178 - 169 - 4)
max_c = Floor(√5)
max_c = Floor(2.2360679774998)
max_c = 2

Step 5b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_c = 1 and increase by 1 until we reach or breach (n - a2 - b2 )/2 → (178 - 132 - 22)/2 = 2.5
When min_c = 2, then it is c2 = 4 ≥ 2.5, so min_c = 2

## c = 2

Step 7: Determine if d is an integer solution which is √n - a2 - b2
max_d = √178 - 132 - 22 - 22
max_d = √178 - 169 - 4 - 4
max_d = √1
max_d = 1

Since max_d = 1, then (a, b, c, d) = (13, 2, 2, 1) is an integer solution proven below
132 + 22 + 22 + 12 → 169 + 4 + 4 + 1 = 178

## b = 3

Step 5a: Determine max_c which is Floor(√n - a2 - b2)
max_c = Floor(√178 - 132 - 32)
max_c = Floor(√178 - 169 - 9)
max_c = Floor(√0)
max_c = Floor(0)
max_c = 0

Step 5b. Obtain the first value of b such that b2 ≥ (n - a2)/3, call it min_b
Start with min_c = 1 and increase by 1 until we reach or breach (n - a2 - b2 )/2 → (178 - 132 - 32)/2 = 0
When min_c = 1, then it is c2 = 1 ≥ 0, so min_c = 1

## List out 17 solutions:

(a, b, c, d) = (7, 7, 8, 4)
(a, b, c, d) = (7, 8, 7, 4)
(a, b, c, d) = (7, 8, 8, 1)
(a, b, c, d) = (7, 10, 5, 2)
(a, b, c, d) = (7, 11, 2, 2)
(a, b, c, d) = (8, 7, 7, 4)
(a, b, c, d) = (8, 7, 8, 1)
(a, b, c, d) = (8, 8, 5, 5)
(a, b, c, d) = (8, 8, 7, 1)
(a, b, c, d) = (9, 6, 6, 5)
(a, b, c, d) = (9, 9, 4, 0)
(a, b, c, d) = (10, 7, 5, 2)
(a, b, c, d) = (11, 5, 4, 4)
(a, b, c, d) = (11, 7, 2, 2)
(a, b, c, d) = (12, 4, 3, 3)
(a, b, c, d) = (12, 5, 3, 0)
(a, b, c, d) = (13, 2, 2, 1)

Special thanks to Stack Overflow for this algorithm suggestion