Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...
3 years ago
Solved
Alternating sum
Given vector x, calculate the alternating sum
y = x(1) - x(2) + x(3) - x(4) + ...
3 years ago
Solved
Weighted average
Given two lists of numbers, determine the weighted average.
Example
[1 2 3] and [10 15 20]
should result in
33.333...