4 lines to rule them all

Image
Heres a visual representation of what your life looks like if you live above the statistical benchmark to the age of 80. Each square here represents one week at an average of 53 weeks per year To some this might seem morbid, but I find it fascinating, humbling. You see a box I see milestones; birth of a child. The passing of a loved one. Graduation. The first paycheck. Marriage. Happiness and sadness and everything in between all rolled into 4 lines connected together. I like to fill in each week as it passes, it serves the following purpose - acts as a reminder on how far I have to go, so I contemplate and reflect on mistakes to learn from them - helps in keeping my self aligned to my values and stick to my smaller seemingly mundane habits that will only benefit me in the long run (like staying active/ keeping relationships) - keeps me grounded on how much I do not know - a constant reminder on not to take small things too seriously as it will all eventually come to an end - lastl...

Project Euler Q2

I've recently begun to re-teach myself, to learn how to think more structurally. My goal isn't really to get to an answer but to understand why I think the way I think, so I spent some time on the 2nd question on Project Euler


Solving this with brute force was mentally frustrating, but more so because I could feel there was a faster way to do it, just not sure what that was. What was interesting was that I saw there was a sequence, every 3rd term was even. But despite knowing that, it was hard to develop some sort of formula to solve.


Heres the question:


Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:

[1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ]


By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms



If you want to try it out yourself: https://projecteuler.net/problem=2


Comments

Popular posts from this blog

A Thousand Flames

Clear Warnings

Bi-pedal on M.M Alam