Project Euler #4
April 14th, 2008
If I had only seen the one liner at Slick or Slack (a pretty slick place) before writing this monstrosity:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| pal = 0
i = 999
while i > 0:
j = 999
while j > 0:
ftemp = str(i * j)
rtemp = ""
for letter in ftemp:
rtemp = letter + rtemp
if ftemp == rtemp:
if pal < i*j:
pal = i*j
break
j = j - 1
i = i - 1
print pal |
Yes I did skip #3 since I have yet to figure out how to factor huge numbers without it taking some huge distributed computing system due to my inefficient code.
Posted in Programming | No Comments »
Project Euler #2
April 13th, 2008
The sum of all of the even-valued terms in the sequence which do not exceed four million.
1
2
3
4
5
6
7
8
9
10
11
12
13
| sum = 0
first = 1
second = 1
current = 2
while(current < 4000000):
if (current %2 == 0):
sum = sum + current
first = second
second = current
current = current + first
print current,
print sum |
Efficiency and I do not get along.
Posted in Programming | No Comments »
Project Euler #1
April 13th, 2008
The sum of all of the multiples of 3 or 5 below 1000.
1
2
3
4
5
6
7
| sum = 0
i = 0
while(i < 1000):
if(i%5 == 0 or i%3 == 0):
sum = sum + i
i = i + 1
print sum |
Definitely not the best way to do it, but who am I kidding.
Posted in Programming | No Comments »
Welcome
April 8th, 2008
Congratulations, you have made it to the personal web site of Eddie Jesinsky. This site will serve to coagulate (that is the extent of my vocabulary) all of the major projects and activities I undertake. It will not be updated that often. If you desire to see what I do on a daily basis, feel free to visit one of the links on the right side of the page, which will likely be of a less academic nature.
I do intend to catalogue any software development under the Projects section of this web site. However, as I am slow to undertake any such activity, that part of the site will be left incomplete for the time being. I plan on working on some plugins for PunBB, a PHP wakaba replacement, and contributing to a few projects, among other things.
Posted in General | No Comments »