I am trying working on Problem 39 of Project Euler,you can see it here projecteuler.net/problem=39 .I use IntegerPartitions, but code turns out to be as slow as snails, more than one minutes!!! could you anyone give any advice?
@Rojo I don't know how to @ more people at once, I need your guys help.
This is my ugly code: Last@Sort@ Table[{Select[ IntegerPartitions[ i, {3}], #[[ 1]] < #[[2]] + #[[3]] && #[[ 1]]^2 == #[[2]]^2 + #[[3]]^2 &] // Length, i}, {i, 1, 1000}]
Consider a question like this; it would make sense to ask for more details, since it's hard to guess what the problem is from the error message. But, if I post a comment "please include details", most likely there will be an 8K codedump as seems to be the norm these days.
should we not have some standard comment, along the lines of the greeting comments, for this purpose?
The @stackmma twitter bot tweets certain questions (algorithmically determined) and converts the first tag (sorted by number of questions) to a hash tag. Hash tags are twitter's way of sorting things and the article says:
People use the hashtag symbol # before a relevant keyword or phrase ...
Well, I have come up with something slightly different. Please tell me what you think about it and I'll elaborate on it.
The basic idea is the following. Below you see a picture with some code in it (a piece of mr.wizard's code from here). It's apparently an inert picture and normally you couldn...