GitHub Repository:
Math ChallengeA while ago, I decided to try out a math challenge that was given by the Department of Mathematical Sciences & the IU Indianapolis School of Science. The challenge was as follows:
Consider an integer n > 99 and treat it is as a sequence of digits (so that 561 becomes [5,6,1]). Now insert between every two consecutive digits a symbol '+', '-', or '=', in such a way that there is exactly one '='. We get an equality, that can be true or false. If we can do it in such a way that it is true, we call n good; otherwise n is bad. For instance, 5 = 6 - 1, so 561 is good, but 562 is bad. 1) Give an example of a block of consecutive integers, each of them bad, of length 17. 2) Prove that any block of consecutive integers, each of them bad, has length at most 18. 3) Does there exist a block of consecutive integers, each of them bad, of length 18?
I decided to run a python script to try and brute force test every single number as far as I could go.
I found many patterns while evaluating, but I didn't have a good way to visualize them, until I learned about
cumulative sums. I tried it out with the following rules:
Take any integer you want to start at, say, 100, and set your sum at zero.
Test if the first integeris good or bad. If it is good, add two to the sum. If it is bad, subtract 1.
In this case, 100 is bad, so we subtract 1, leaving us with -1 in our sum. The next number is 101.
That number is good, so we add two to the sum, now giving us 1.Iterate that process over and over
for as many integers as you'd like. I initially tried out the graphs with just 1 and -1, but it
tended to go negative more often than positive, and frankly, the graph was boring.
So, I changed it to +2 and -1, and the fractal-like graphs came out. You can see all of my test images
in the GitHub Repository, as well as the Jupyter notebook and other programming I did.
I was really intrigued by this, so I made a
Reddit
post
about it to share my findings.
My method of generating the graphs was quite inefficient, but luckily, a Reddit user by the name of iamreddy44
designed
a web-based graph viewer that did the same thing as I had been doing, but faster and a lot better. (Thank you
iamreddy44!).
I made some tweaks to his code to allow for entering other values for the cumulative sum, as well
as an integer good/bad checker, but the rest was all
programmed by them.
I decided to name the fractal graph I discovered the Jones Fractal.