about | help | code help+videos | done | prefs |
The Hailstone sequence of numbers can be generated from a starting positive integer, n by: If n is 1 then the sequence ends. If n is even then the next n of the sequence = n/2. If n is odd then the next n of the sequence = (3 * n) + 1. Return this sequence as a List given some n. hailStone(1) → [1] hailStone(6) → [6, 3, 10, 5, 16, 8, 4, 2, 1] hailStone(4) → [4, 2, 1] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 200 Post-solution available
Copyright Nick Parlante 2017 - privacy