Problem 34 in Julia