In a classroom of 'n' children, every even numbered child gets one big candy and every odd numbered child gets two small candies. Count the total number of candies 'x' that one should bring to the class.
For example, if there are n = 10 children in the class, the first child gets two candies, second child gets one candy, third child gets two candies and so on. Total number of candies required is x = 15.
Solution Stats
Solution Comments
Show comments
Loading...
Problem Recent Solvers73
Suggested Problems
-
Project Euler: Problem 2, Sum of even Fibonacci
2850 Solvers
-
Back to basics 21 - Matrix replicating
1804 Solvers
-
398 Solvers
-
Area of an equilateral triangle
6827 Solvers
-
Find sum of negative elements in row.
122 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!