buying high-quality supplements. There aren’t any pills that are available over-the-counter or on the brain create the feeling of fullness, and by extension in the fat burning craze they often associate it to the blood stream. Can you share Prescribed Best weight loss pills that work. ]]>

Thanks for your answer, “It was nice to see this interesting property formalized” : it’s good to hear (well read actually) ^^.

Wow, concerning you Haskell code … I have to say : “thanks for the lesson”. It’s so concise, thus more readable than my own boring code.

I’m rather new to Haskell, meaning I’m looking for ways to sharpen my skills, you’ve just give me some, thanks.

This haskell code is more complex than it needs to be, however.

mirror x = 100 * (x `mod` 10) + 10 * ((x `div` 10) `mod` 10) + (x `div` 100)

valid x = x /= mirror x

compute1089 x = let i = abs (x – mirror x) in i + mirror i

isProved = all (\x -> compute1089 x == 1089) . filter valid $ [1..999]

Mainly because, of course, the repdigits 111, 222, … already don’t pass the firstDigit /= thirdDigit test, so you don’t need to filter them out separately. Other than that, you used a lot more intermediate naming than I did, which is a stylistic choice ðŸ™‚

]]>Thanks for posting here.

First I’ll answer your second paragraph : when we have a number, when me ‘mirror’ it as I called (that’s tricky because I don’t think there is a mathematical term for this, and I can’t use “reverse” nor “opposite”, that’s why I used ‘mirror’), we get a number, with the reverted order of the digits. For instance : 283 (which is 2-8-3) gives 382 when mirrored (which is 3-8-2).

Because of this ‘mirror’ we apply to the number, it’s easy to see why this doesn’t work with numbers whose first and third digit are the same : take 848 for instance, when ‘mirrored’, it’s still 848. With our notations, it would give : A =848 and A’ = 848.

When you perform A – A’ it gives 848 – 848 which is 0 : we’re stuck, that’s why I set a condition on our numbers : the first and third digit must be different.

Concerning 100, it does work : 100 ‘mirrored’ is 001, then 100 – 001 = 099.

099 ‘mirrored’ is 990, and 990 + 099 is 1089 ^^

Concerning your first paragraph, can you send me your draft or somewhere you have written to get B + B’ is 0 ?

Some clues to confirm you’re on the good way : in the expression of B, do you have 9.10^1 in the second digit ? If no, then you’ve made a mistake : every B number we get with every A number should have 9 as the second digit.

When you perform B + B’ are you sure 1/ that your B expression has all the “10” and “1” added from the step above ? 2/ That you succeed in ‘mirroring’ the B number to get B’ ?

I should be able to help you a bit more if I saw your draft/paper/code .

]]>When I try to prove this myself, I seem to get B+B’=0. This is using probably the two more obvious approaches. You may have got this conclusion at least once while trying to prove it. Do you know why this is not correct?

You mentioned that the first and third digits must not be the same. Perhaps this has something to do with the above point? Also this takes away at least 100 of the 1000 possibilities (assuming 1′ is 100) and possibly more; Why would this not work when the first and third digits are the same?

Also the Haskell code seems to contain lexical errors.

]]>First I apologize for not beeing present all this time, but as a student I don’t have a stable Internet connection and I couldn’t come to reply nor could I come to add stuffs.

@solrize, thanks you a lot for answering (and again sorry for the delay, but now my connection is stable, and I will come more regularly, I hope it didn’t discourage you for posting other comments) and thank you for the ‘tip’.

I’m rather new to Haskell, and thus I didn’t know the existence of the ‘Printf’ library, it seems useful.

Moreover, I’m not used (yet) to Haskell programming techniques, so I didn’t think about using the empty list as the base case.

Thanks again for the tips, and please don’t worry, I’m not letting this blog die (it’s just started ^^) : I’m back.

import Text.Printf

hanoi :: [Int] -> a -> a -> a -> [(Int, a, a)]

hanoi [] a b c = []

hanoi (d:ds) a b c =

hanoi ds a c b ++ (d,a,b):(hanoi ds c b a)

main = mapM_ move (hanoi ([3,2,1]) “A” “B” “C”)

where

move (disc,from,to) =

printf “move disc %d from %s to %s\n” disc from to