subject

(Ramanujan's Taxi) Srinivasa Ramanujan indian mathematician who became famous for his intuition for numbers. When the English mathemematician G. H. Hardy came ot visit him in the hospital one day, Hardy remarked that the number if his taxi was 1729, a rather dull number. To which Ramanujan replied, "No, Hardy! It is a very interesting number. It is the smallest number expressible as the sum of two cubes in two different ways." Verify this claim by writing a program Ramanujan. java that takes a command-line argument N and prints out all integers less than or equal to N that can be expressed as the sum of two cubes in two different ways. In other words, find distinct positive integers a, b, c, and d such that а3 + b3 = c3 - d3. Hint: Use four nested for loops, with these bounds on the loop variables: 0 < a < 3√N, a < b < 3√N - a3, a < c < 3√N and c < d < 3√N - C3; do not explicitly compute cube roots, and instead use x . x *x < y in place of х < Math. cbrt (y). $ javac Ramanujan. java
$ java Ramanujan 40000
1729 = 1"3 + 12^3 = 9^3 + 10"3
4104 = 2^3 + 16^3 = 9^3 + 15^3
13832 = 2^3 + 24^3 = 18^3 + 20^3
39312 = 2^3 + 34^3 = 15^3 + 33^3
32832 = 4^3 + 32^3 = 18^3 + 30^3
20683 = 10^3 + 27^3 = 19^3 + 24^3

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:30
Awell-diversified portfolio needs about 20-25 stocks from different categories is this true or false?
Answers: 2
question
Computers and Technology, 22.06.2019 20:00
What is the worst-case complexity of the maxrepeats function? assume that the longest string in the names array is at most 25 characters wide (i.e., string comparison can be treated as o( class namecounter { private: int* counts; int nc; string* names; int nn; public: namecounter (int ncounts, int nnames); int maxrepeats() const; }; int namecounter: : maxrepeats () { int maxcount = 0; for (int i = 0; i < nc; ++i) { int count = 1; for (int j = i+1; j < nc; ++j) { if (names[i] == names[j]) ++count; } maxcount = max(count, maxcount); } return maxcount; }
Answers: 3
question
Computers and Technology, 23.06.2019 12:00
Using the list, you can select the number of photos that will appear on each slide. a. theme b. frame shape c. pictures in album d. picture layout
Answers: 1
question
Computers and Technology, 24.06.2019 11:00
Under the home tab, where can a user find options to change the bullet style of an outline? in the slides group in the font group in the paragraph group in the drawing group
Answers: 1
You know the right answer?
(Ramanujan's Taxi) Srinivasa Ramanujan indian mathematician who became famous for his intuition for...
Questions
question
Mathematics, 02.08.2019 07:30
question
Social Studies, 02.08.2019 07:30
question
Geography, 02.08.2019 07:30
question
Mathematics, 02.08.2019 07:30
Questions on the website: 13722360