Example 29: Ramanujan Number Series
Explore how to program the Ramanujan number series in C using loops. Understand the concept of numbers expressed as sums of two cubes in two distinct ways, and use nested loops to identify such numbers. This lesson enhances your skills in loop control and problem-solving with nested iterations.
We'll cover the following...
We'll cover the following...
Problem
The Ramanujan number is the smallest number expressed as the sum of two cubes in two different ways.
Write a program to print all such numbers up to 20.
Example
| Input | Output |
|---|---|
| 20 |