I need to find perfect numbers


There are perfect numbers just waiting to be found, and I am going to find them.
To help me out I have a few tools, an Arduino (or two), a 4-digit 7-segment display, some resistors and a few wires.


The desk all set upA nice project

The electronics desk is all set up and waiting for me to start a project, and so a project got started.
I had heard some rumours about numbers that are perfect, and I knew just how to find them as well.
A plan was formed.


first things first

A test had to be done once everything was wired up, the display was programmed to read '9999' just so it could be confirmed that everything was working and ready.

So far so good, everything seemed to be working.

It should be said at this point that a perfect number is a number whose proper divisors add up to exactly to it. For example 6 has the proper divisors 1, 2, and also 3 and it's easy to see that 1 + 2 + 3 = 6


I did it, perfect numbers found

I had 4 digits to work with on the display, and it turns out there are 4 perfect numbers that are less than 9999 and the Arduino had found them all, they are 6, 28, 496, and 8128.
There was a problem that started appearing as the numbers got higher, the lights were flickering as the Arduino struggled to do all the calculations required of it.


parallel processing

There was a solution to this problem and I gave it my best shot, the idea was to parallelise the processing with another Arduino so that one was doing the calculations and then sending them over to the other Arduino that was powering the display
As you can see in the photo, the system was working and the problem had been solved.


The calculationsThe display driver

The code for these two micro controllers is simple enough and you can copy or get inspired from it yourself if you have any similar ideas.


This was a fun project to do that took only a few hours of my time, well worth it.


I hope you enjoyed reading it half as much as I enjoyed doing it.


You can check out a list of all the blog posts by clicking here

You can get back to the homepage by clicking here