Questions tagged [hardy-ramanujan]
9 questions
14
votes
7 answers
Finding taxicab Numbers
Find the first n taxicab numbers. Given a value n. I would like to find the first n taxicab numbers.
A taxicab being a number that can be expressed as the sum of two perfect cubes in more than one way.
(Note that there are two related but different…

sasidhar
- 7,523
- 15
- 49
- 75
4
votes
2 answers
Making Hardy-Ramanujan nth number finder more efficient
I tried to make an algorithm to find the nth Hardy-Ramanujan number(a number which can be expressed in more than one way as a sum of 2 cubes). Except I'm basically checking every single cube with another to see if it equals a sum of another 2 cubes.…

Raistlin
- 167
- 8
3
votes
4 answers
Find the lowest integer that matches equation in C++
Possible Duplicate:
Finding Hardy Ramanujan Numbers
I need to find the lowest natural number x where
x = k^3 + l^3 = i^3 + j^3
and (k, l, i, j) must all be different.
I tried the following four for loops, but I couldn't get it to the right…

user1836858
- 39
- 1
1
vote
1 answer
Ramanujan's number in C
[Hardy about Ramanujan]: I remember once going to see him when he was ill at Putney. I had ridden in taxi cab number 1729 and remarked that the number seemed to me rather a dull one, and that I hoped it was not an unfavourable omen. "No," he…

Crash Bandicoot
- 45
- 5
0
votes
0 answers
Ramanujan Function in VBA
I am trying to achieve the Ramanujan Function by using VBA. The formula is in the picture below.
My code is:
Function ramanuian(n)
left_part = (Application.sqrt(8) / 9801)
Dim temp As Double
temp = 0
For i = 0 To n
…

LightOwlGG
- 139
- 10
0
votes
4 answers
Is n a Ramanujan number--why am I getting errors in values near 2^63?
Given a number, test to see if it is a Ramanujan number (defined in our course as the sum of two cubes two different ways). It must run in n^(1/3) time.
My code is working--sometimes. As test values approach 2^63 -1 I am getting some random…

Julie Carres
- 37
- 1
0
votes
2 answers
Debugging Code: Finding Ramanujan Numbers Using 2 While Loops
I'm trying to find, using dictionaries:
Using two while loops, nested, create a dictionary whose keys are the sum of two cubes. That is iterate through all pairs i and j, calculating i^3+j^3 until it gets too large.
2.Whenever you calculate a new…

ryan tea
- 1
0
votes
3 answers
Smallest java structure with relatively decent contains() solution
Alright, here's the lowdown: I'm writing a class in Java that finds the Nth Hardy's Taxi number (a number that can be summed up by two different sets of two cubed numbers). I have the discovery itself down, but I am in desperate need of some space…

Slippery John
- 747
- 2
- 9
- 20
-2
votes
1 answer
C Program for Ramanujan-like Number Series
1729 is known as the Ramanujan number, after an anecdote of the British mathematician G. H. Hardy when he visited Indian mathematician Srinivasa Ramanujan in hospital. He related their conversation:
"I remember once going to see him when he was ill…

Vartika
- 77
- 1
- 6