Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8224643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:08:31+00:00 2026-06-07T15:08:31+00:00

Find the first n taxicab numbers. Given a value n . I would like

  • 0

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 sets referred to as
‘taxicab numbers’: the sums of 2 cubes in more than 1
way
, and the smallest numbers that are the
sum of 2 positive integral cubes in n
ways
. This question is about the former set,
since the latter set has only the first six members known)

For example:

1^3 + 12^3 = 1729 = 9^3 + 10^3

I would like a rough overview of the algorithm or the C snippet of how to approach the problem.

The first five of these are:

   I    J      K    L      Number 
---------------------------------
   1   12      9   10      1729       
   2   16      9   15      4104      
   2   24     18   20     13832       
  10   27     19   24     20683      
   4   32     18   30     32832    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T15:08:33+00:00Added an answer on June 7, 2026 at 3:08 pm

    I figured out the answer could be obtained this way:

    #include<stdio.h>
    
    int main() {
        int n, i, count=0, j, k, int_count;
        printf("Enter the number of values needed: ");
        scanf("%d", &n);
        i = 1;
        while(count < n) {
           int_count = 0;
           for (j=1; j<=pow(i, 1.0/3); j++) {
              for(k=j+1; k<=pow(i,1.0/3); k++) {
                  if(j*j*j+k*k*k == i)
                  int_count++;
              }
           }
           if(int_count == 2) {
              count++;
              printf("\nGot %d Hardy-Ramanujan numbers %d", count, i);  
           }
           i++;
        }
    }
    

    Since a^3+b^3 = n, a should be less than n^(1/3).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

These days I design some algorithms in python, but find first two greatest value
When we use ActiveRecord, we can use: User.find(:first, :conditions=>[name=?, name]) It looks like ActiveRecord
How to find first non-repeating element in an array. Provided that you can only
In Ruby on Rails I'm doing something like: Appointment.find( :first, :conditions => staff_id =
I have a quick question here. I know that the cakePHP find('first') function returns
I want to find the first element that has appeared in previous positions in
I want to find the first item in a sorted vector that has a
How can I find the first substring until I find the first digit? Example:
Would there be a better way to do this using alogrithm functions like std::find()?
i want to find first select ... from and replace that only, following code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.