mogoh’s blog
something something technology

Edges and Degrees

I stumbled apon a small and interesting problem, that I would like to share.

Problem

We have three regular polygons , , and . Let , , and the number of edges of , and . Let and the degree of edges of and .

What is the number of edges of , , and , if

and and and is a square number.

Code for Calculation

function inner_degree(n) {
return ((n - 2) * 180) / n;
}

let c_sqrt = 3;
let found = false;

while (!found) {
let c = c_sqrt * c_sqrt;
let a = 3;
while (a < c / 2) {
let b = c - a;
let inner_degree_a = inner_degree(a);
let inner_degree_b = inner_degree(b);
let degree_delta = inner_degree_b - inner_degree_a;
let edge_delta = b - a;
if (degree_delta === edge_delta) {
console.log("A: ", a);
console.log("Inner degree: ", inner_degree_a);
console.log("B: ", b);
console.log("Inner degree: ", inner_degree_b);
console.log("Degree Delta: ", degree_delta);
console.log("Edge Delta: ", edge_delta);
console.log("C: ", c);
console.log("SQRT: ", c_sqrt);
found = true;
}
a += 1;
}
c_sqrt += 1;
}

Solution

has edges with an inner angle of . has edges with an inner angle of . The delta of inner angles is equal to the delta of eges: . has edges witch is a square number.

Degree Delta:
Edge Delta:
C:
SQRT: