Factorization

Playing around with prime numbers, I created this simple factorization program.
The interesting thing about prime factors is that they are unique. There can only be one way to multiply prime numbers to get n where n \in \mathbb{N} and n \geq 2 (excluding the commutative property).
For example, 2 \cdot 3 \cdot 7 = 42 and that is the only way to multiply prime numbers to get to 42.
Factorizing some numbers...


# Python 2.7.7 Code
# Jonathan Frech 8th of April, 2016

Continue reading

Advertisements

JClock VII

This alternative clock is not really readable by human. It calculates the first 144┬╣ primes, assigns 60 of them to every possible second, 60 to every possible minute and 24 to every possible hour.
Multiplying those three primes for a given time results in a composite number representing said time. Using integer factorization, you then can get the three primes back, map them to seconds, minutes and hours, and by doing so calculate the time.

2 minutes of prime time┬╣This number is the sum of 60 seconds, 60 minutes and 24 hours.


# Python 2.7.7 Code
# Pygame 1.9.1 (for Python 2.7.7)
# Jonathan Frech 13th of November, 2015

Continue reading