"Interesting" Triangles
Let's start with the example below:
1^{2} = 1
11^{2} = 121
101^{2} = 10201
1001^{2} = 1002001
10001^{2} = 100020001
...
After:
1^{2} = 1
11^{2} = 121
111^{2} = 12321
1111^{2} = 1234321
11111^{2} = 123454321
...
Exercises. Create Python programs using the learned instructions to display others:
a) 9
^{2}, 99
^{2}, 999
^{2}, 9999
^{2}, ...
b) 9
^{3}, 99
^{3}, 999
^{3}, 9999
^{3}, ...
c)
1+2+3+...+10 = 55
1+2+3+...+100 = 5050
1+2+3+...+1000 = 500500
1+2+3+...+10000 = 50005000
1+2+3+...+100000 = 5000050000
...
d)
1*9+2=11
21*9+33=222
321*9+444=3333
4321*9+5555=44444
...
e)
9*9+7=88
98*9+6=888
987*9+5=8888
...
98765432*9+0=888888888
987654321*91=8888888888
f)
15873*1*7=111111
15873*2*7=222222
15873*3*7=333333
...
15873*9*7=999999
Editor  numerical_harmonies.py


Prime Numbers
You know that
a natural number is prime if it is greater than 1 and has only two divisors: 1 and itself.
Examples: 2, 3, 5, 7, 11, 13, 17, 19, 23, ...
Look at the examples below:
a) sums with prime numbers:
1
^{2} + 1 +
17 =
19 =
17 + 2
2
^{2} + 2 +
17 =
23 =
19 + 4
3
^{2} + 3 +
17 =
29 =
23 + 6
...
10
^{2} + 10 +
17 =
127 =
107 + 20
b) other prime numbers:
1
^{2} 
79 * 1 +
1601 =
1523
2
^{2} 
79 * 2 +
1601 =
1447
3
^{2} 
79 * 3 +
1601 =
1373
...
9
^{2} 
79 * 9 +
1601 =
971
Interesting are also the following prime numbers, which have their reversals also prime:
13 and
31
17 and
71
37 and
73
79 and
97
107 and
701
...
Exercise. Can you create a Python program to display all pairs of numbers with this property, from 2 to 10000?
Hint. If you have followed the lessons, it is not so difficult... for example, you can create a function to check if a number is prime.
365 ?
How beautifully it can be written as sums of squares:
365 = 13
^{2} + 14
^{2}
365 = 10
^{2} + 11
^{2} + 12
^{2}
Palindromes
Some words or numbers form a
palindrome, that is,
they read the same from left to right as from right to left.
Examples of words: "cojoc", "reper", "rotitor", or sentences: "ele fac cafele", "ene purta patru pene", etc. Do you know others?
Numbers are diverse, such as
1234321 or
75257.
How beautiful are, for example, the following two equalities:
14641 =
121^{2}
69696 =
264^{2}
So, there are palindromic numbers that when squared, still result in a palindrome!
Exercise. Create a Python program to find other numbers with the same property!
Test with large numbers, use loops, then conditional statements, ...
Pythagorean Numbers
You have probably learned about
Pythagoras' Theorem for a
right triangle:
It is known from practice that
Pythagorean numbers have some interesting properties:
a) one of the legs is a multiple of
3;
b) one of the legs is a multiple of
4;
c) one of the Pythagorean numbers is a multiple of
5.
Examples. The simplest is
3^{2} + 4^{2} = 5^{2}. Then, we have:
5^{2} + 12^{2} = 13^{2}
7^{2} + 24^{2} = 25^{2}
8^{2} + 15^{2} = 17^{2}
9^{2} + 40^{2} = 41^{2}
11^{2} + 60^{2} = 61^{2}
...
Exercise. Create a Python program to display
all Pythagorean triplets up to
10000.
The Universe of Numbers
There are many special cases, and what has been presented is minimal. Mathematics is fascinating, and the abundance of harmonies is great...
a) using all ten digits exactly once, we can write:
5649 * 3 = 807 * 21
5481 * 3 = 609 * 27
b) using each of the nine significant digits, you can write:
146 * 29 = 73 * 58
293 * 14 = 586 * 7
18 * 297 = 5346
27 * 198 = 5346
Exercise. Look, the squares of the following numbers are made up of the ten digits, each used once:
32043
^{2} = 1026753849
32286
^{2} = 1042385796
33144
^{2} = 1098524736
Write a Python program to display them all!
Good luck!
Bibliography
Mathematics for Everyone, Prof.
Armand Martinov, Expert Publishing House, 2015, ISBN: 9789736184130