Project Euler: Problem 6

The sum of the squares of the first ten natural numbers is,

1^2 + 2^2 + \ldots + 10^2 = 385

The square of the sum of the first ten natural numbers is,

(1 + 2 + \ldots + 10)^2 = 55^2 = 3025

Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 — 385 = 3640.

Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.

So, apparently my brother has joined me on my Project Euler solving quest. You can see his Delphi solution on his blog. My C# solution, you can find below 🙂

Continue reading Project Euler: Problem 6

Wild at Heart

The book cover of Wild at HeartThe other day I started reading a book called Wild at Heart. So far it has been a great book and fun to read. Certain things has already started to make a bit more sense than they did before.

Two of the many very interesting paragraphs from it:

There are three desires I find written so deeply into my heart I know now I can no longer disregard them without losing my soul. They are core to who and what I am and yearn to be. I gaze into boyhood, I search the pages of literature, I listen carefully to many, many men, and I am convinced these desires are universal, a clue into masculinity itself. They may be misplaced, forgotten, or misdirected, but in the heart of every man is a desperate desire for a battle to fight, an adventure to live, and a beauty to rescue. I want o you think of the films men love, the things they do with their free time, and especially the aspirations of little boys and see if I am not right on this.

There are also three desires that I have found essential to a woman’s heart, which are not entirely different from a man’s and yet they remain distinctly feminine. Not every woman wants a battle to fight, but every woman years to fought for. Listen to the longing of a woman’s heart: She wants to be more than noticed—she wants to be wanted. … Every woman also wants an adventure to share. … So many men make the mistake of thinking that the woman is the adventure. But that is where the relationship immediately goes downhill. A woman doesn’t want to be the adventure; she wants to be caught up into something greater than herself. … And finally, every woman wants to have a beauty to unveil. Not to conjure, but to unveil. Most women feel the pressure to be beautiful from very young, but that is not what I speak of. There is also a deep desire to simply and truly be the beauty, and be delighted in.

OK, actually that last one is three paragraphs in the book. But tried to get the similar three points that was mentioned for men (And for men they are each elaborated in three sub chapters).

Aaaanyways, very interesting book. You should definitely read it, especially if you are a guy. Could be interesting if you are a woman too of course, but I can only speak for myself, who is a guy. For women there is actually a similar book called Captivating, which I have heard is very good as well. I haven’t read it yet though… but I will 😉

Highly recommend them! Get them from Amazon, they are not even expensive 😀

What do you think about this matter? Did it sound about right? What is in the innermost parts of your heart?

Project Euler: Problem 1

Recently I decided that my brain needed some exercise. So I figured I would try to solve a couple of Project Euler problems once in a while. And while I was at it, try to to do a bit of TTD, or at least write test cases for things. What is Project Euler? Well, here is some of what they say about themselves, whoever they are:

Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems.

The motivation for starting Project Euler, and its continuation, is to provide a platform for the inquiring mind to delve into unfamiliar areas and learn new concepts in a fun and recreational context.

I’m not particularly good at these things, but it is quite fun when you get it right. I also get to practice my Google-Fu a bit when I need to freshen up things I learned during math at school, but have forgotten. Or if I find that my solution to a problem is totally awful and takes ages to solve…

Anyways, I can recommend the problems so far. They have (so far) been mind bending enough to be challenging, but not so insanely difficult that they are impossible.

The first problem goes like this:

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.

And to give you a chance to solve it without seeing my solution, I will put my solution on the next page 😉

With a hint of Social Ineptitude