View Single Post
Old 2008-04-26, 07:28   #8
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

2×2,909 Posts
Default

Quote:
Originally Posted by petrw1 View Post
I would consider saving in an array all numbers (prime or otherwise) encountered so far. Whenever your current chain matches one of those you can skip to the next chain knowing it will eventually end in 3.

I suspect that most will abort a lot sooner.

I believe the astutue programmers call this memoization.
when i last posted i had one idea and it was that
i am going to my grandmother's 80th birthday meal 2day and i wont be back until 2morrow lunch time
i will program it then
henryzz is offline   Reply With Quote