Shining Umbra

RSS
Aug 1

Project Euler 4

Python

import time
def isPalindrome(n):
    n = list(str(n))
    start = 0
    back = len(n) - 1
    while start < back:
        if(n[start] == n[back]):
            start += 1
            back -= 1
        else:
            return False
    return True
i = 100
answer = 0
start_time = time.time()
while i < 1000:
    j = i
    while j < 1000:
        if isPalindrome(i * j) and i * j > answer:
            answer = i * j
        j += 1
    i += 1
print answer, time.time() - start_time

Aug 1

Project Euler 3

PARI/GP


ans=0;n=600851475143;fordiv(n,x,if(isprime(x),ans=x));print(ans)

Aug 1

Project Euler 2

PARI/GP

total = 0; for(x = 2, 33, if(fibonacci(x) % 2 == 0, total += fibonacci(x)));print (total)

Aug 1

Project Euler 1

PARI/GP

total = 0; for(x = 1, 999, if(x % 5 == 0 || x % 3 == 0, total += x)); print (total)

The chickens are taking over

The chickens are taking over

Failure

Let’s face it, failure and rejection suck. It’s the point where reality tells you “No. You’re not good enough and you would have been just as well not even trying.” It comes in many different ways and it’s something that we all have to face. No one bats 1.000 in life and those who think they do are only joking themselves. However, people are not judged by the fall. A person’s strength is shown through the manner in which they fight back up again. I for one, will choose to fight.

My friend Peter and I after our Math Competition at MAC. He got first in senior&#8217;s division with a 41/50. I got second with a 40/50. So close&#8230;

My friend Peter and I after our Math Competition at MAC. He got first in senior’s division with a 41/50. I got second with a 40/50. So close…

What I love about old computers: they let you know when you&#8217;ve messed up.

What I love about old computers: they let you know when you’ve messed up.

Coexistence — It’s the moment you realize that all that anger and resentment just isn’t useful and you start to let go of it and move on with your life. It just takes a while.

The Unknown Number

Sherlock HolmesI had my first “Sherlock Holmes” experience yesterday (by this, I mean that I was able to make inferences of small details and solve a problem). Though a small and pointless thing, I still felt rather ingenious. It all started when I received a text:

Hey
^o^ m&j ^o^

Normally, I would ignore such a text, however, my phone is relatively new and I do not have all of the contacts yet that my previous phone contained. My first thought was that it was Jaimie, because she was going out with Matt at the time so the signature made sense. Nonetheless, I made an inquiry:

This is?

To which I got an interesting response:

Mati who’s this ur # was in my fone
^o^ m&j ^o^

From this what do we know? We know that she is either young or dim due to her grammar usage. I opted on the side of young due to the fact that the only time I could remember anybody using phone signatures was 6th to 8th grade. We also know that her name is Mati, probably a nickname for a longer name. Maybe Madylin. Anyway, we can obviously figure out that who she is dating is the ‘j’ in the signature. In all likelihood, a guy, probably, James, John, Joey, etc. I need one final inquiry, for something to go on:

Connor, and I don’t know why my # was in your phone, but I don’t know you.

If she says that she knows me, then it’s obviously trying to prank me. If she says she doesn’t know me, I am going to ask how she came across my number. Her response was unexpected:

Well it’s saved under the name connor so we obviously must have met somewhere or i wouldn’t have your number saved as connor in my fone
^o^ m&j ^o^

Not many people had my phone number. I was careful not to post it to any sites where it would be in plain view. So this person had to have a phone of someone who knew me. I estimated that about 30 or so people had my phone number. Based on previous judgements, lets sum up as I did then, what we have. We have a young (6th-8th grade estimate) girl who goes by the nickname of Mati. She is currently in a relationship with someone whose name begins with a ‘j’, and is probably the younger sibling of someone to whom I am rather close. This would be enough to go by in figuring out who this was. It is easy nowadays to locate one’s identity with only a name, however, that can prove inaccurate unless you have other foundations of their persona to solidify the identity of the person in question. For me, all it took was an open-ended (meaning I did not press enter but looked at what names were auto-filled in for me) Facebook search to find the name of the unknown texter. Because I was quite sure that she went by a nickname, just typing “Mati” into Facebook would not have yielded the intended results. By leaving it open-ended, it filled in the rest of the missing name of the person to whom I was sure to have mutual friends with (being she probably a younger sister of one of my lesser, yet still close, friends). Sure enough, the search brought up Matilynn Kester: younger sister of Zane Kester, in a relationship with Joel Gormley, and an 8th grader. All that was left now was to subtly tell her that I was a friend of Zane’s and that she was using his hand-me-down phone which must obviously contain contacts from its previous owner without letting her know that I (sort of creepily) know who she is and all about her. My message was this:

Did you get the phone from an older brother maybe? (Zane perhaps?)

She did not think at all to question how I knew that it may have been Zane:

Oh! Your a friend of zane’s!
^o^ m&j ^o^

Meriting my:

Yup.

And thus the mystery of the unknown texter is put to rest. My first case turned out to be a smashing success. God! am I childish.