| 154 | } |
| 155 | |
| 156 | std::list<int> collatz_seq(int x) |
| 157 | { |
| 158 | std::list<int> result; |
| 159 | while (x > 1) { |
| 160 | result.push_back(x); |
| 161 | if (x % 2 == 0) |
| 162 | x = x / 2; |
| 163 | else |
| 164 | x = 3 * x + 1; |
| 165 | } |
| 166 | result.push_back(x); |
| 167 | return result; |
| 168 | } |
| 169 | |
| 170 | TEST_CASE("fwd_test - collatz") |
| 171 | { |
nothing calls this directly
no outgoing calls
no test coverage detected