kazuyamaa/multi-language-messages-01 huggingface dataset:
Task: Linear congruential generator
Python: def bsd_rand(seed):
   def rand():
      rand.seed = (1103515245*rand.seed + 12345) & 0x7fffffff
      return rand.seed
   rand.seed = seed
   return rand

def msvcrt_rand(seed):
   def rand():
      rand.seed = (214013*rand.seed + 2531011) & 0x7fffffff
      return rand.seed >> 16
   rand.seed = seed
   return rand

PHP: <?php
function bsd_rand($seed) {
    return function() use (&$seed) {
        return $seed = (1103515245 * $seed + 12345) % (1 << 31);
    };
}

function msvcrt_rand($seed) {
    return function() use (&$seed) {
        return ($seed = (214013 * $seed + 2531011) % (1 << 31)) >> 16;
    };
}

$lcg = bsd_rand(0);
echo "BSD ";
for ($i = 0; $i < 10; $i++)
    echo $lcg(), " ";
echo "\n";

$lcg = msvcrt_rand(0);
echo "Microsoft ";
for ($i = 0; $i < 10; $i++)
    echo $lcg(), " ";
echo "\n";
?>
Task: Linear congruential generator
VB: Public stateBSD As Variant
Public stateMS As Variant
Private Function bsd() As Long
    Dim temp As Variant
    temp = CDec(1103515245 * stateBSD + 12345)
    temp2 = temp / 2 ^ 31
    temp3 = CDec(WorksheetFunction.Floor_Precise(temp2))
    stateBSD = temp - (2 ^ 31) * temp3
    bsd = stateBSD
End Function
Private Function ms() As Integer
    Dim temp As Variant
    temp = CDec(214013 * stateMS + 2531011)
    temp2 = temp / 2 ^ 31
    temp3 = CDec(WorksheetFunction.Floor_Precise(temp2))
    stateMS = temp - (2 ^ 31) * temp3
    ms = stateMS \ 2 ^ 16
End Function
Public Sub main()
    stateBSD = CDec(0)
    stateMS = CDec(0)
    Debug.Print "       BSD", "   MS"
    For i = 1 To 10
        Debug.Print Format(bsd, "@@@@@@@@@@"), Format(ms, "@@@@@")
    Next i
End Sub

PHP: <?php
function bsd_rand($seed) {
    return function() use (&$seed) {
        return $seed = (1103515245 * $seed + 12345) % (1 << 31);
    };
}

function msvcrt_rand($seed) {
    return function() use (&$seed) {
        return ($seed = (214013 * $seed + 2531011) % (1 << 31)) >> 16;
    };
}

$lcg = bsd_rand(0);
echo "BSD ";
for ($i = 0; $i < 10; $i++)
    echo $lcg(), " ";
echo "\n";

$lcg = msvcrt_rand(0);
echo "Microsoft ";
for ($i = 0; $i < 10; $i++)
    echo $lcg(), " ";
echo "\n";
?>
Task: Formatted numeric output
C: #include <stdio.h>
main(){
  float r=7.125;
  printf(" %9.3f\n",-r);
  printf(" %9.3f\n",r);
  printf(" %-9.3f\n",r);
  printf(" %09.3f\n",-r);
  printf(" %09.3f\n",r);
  printf(" %-09.3f\n",r);
  return 0;
}

C#: class Program
    {


        static void Main(string[] args)
        {

            float myNumbers = 7.125F;
            
            string strnumber = Convert.ToString(myNumbers);
                       
            Console.WriteLine(strnumber.PadLeft(9, '0'));
           
            Console.ReadLine();
        }
        

             
       
    }
Task: Formatted numeric output
C: #include <stdio.h>
main(){
  float r=7.125;
  printf(" %9.3f\n",-r);
  printf(" %9.3f\n",r);
  printf(" %-9.3f\n",r);
  printf(" %09.3f\n",-r);
  printf(" %09.3f\n",r);
  printf(" %-09.3f\n",r);
  return 0;
}

C++: #include <iostream>
#include <iomanip>

int main()
{
  std::cout << std::setfill('0') << std::setw(9) << std::fixed << std::setprecision(3) << 7.125 << std::endl;
  return 0;
}
Task: Formatted numeric output
C: #include <stdio.h>
main(){
  float r=7.125;
  printf(" %9.3f\n",-r);
  printf(" %9.3f\n",r);
  printf(" %-9.3f\n",r);
  printf(" %09.3f\n",-r);
  printf(" %09.3f\n",r);
  printf(" %-09.3f\n",r);
  return 0;
}

Go: fmt.Printf("%09.3f", 7.125)
Task: Formatted numeric output
C: #include <stdio.h>
main(){
  float r=7.125;
  printf(" %9.3f\n",-r);
  printf(" %9.3f\n",r);
  printf(" %-9.3f\n",r);
  printf(" %09.3f\n",-r);
  printf(" %09.3f\n",r);
  printf(" %-09.3f\n",r);
  return 0;
}

Java: public class Printing{
	public static void main(String[] args){
		double value = 7.125;
		System.out.printf("%09.3f",value); 
		System.out.println(String.format("%09.3f",value));
	}
}
Task: Formatted numeric output
C: #include <stdio.h>
main(){
  float r=7.125;
  printf(" %9.3f\n",-r);
  printf(" %9.3f\n",r);
  printf(" %-9.3f\n",r);
  printf(" %09.3f\n",-r);
  printf(" %09.3f\n",r);
  printf(" %-09.3f\n",r);
  return 0;
}

VB: Option Explicit

Sub Main()
Debug.Print fFormat(13, 2, 1230.3333)
Debug.Print fFormat(2, 13, 1230.3333)
Debug.Print fFormat(10, 5, 0.3333)
Debug.Print fFormat(13, 2, 1230)
End Sub

Private Function fFormat(NbInt As Integer, NbDec As Integer, Nb As Double) As String



Dim u As String, v As String, i As Integer
   u = CStr(Nb)
   i = InStr(u, Application.DecimalSeparator)
   If i > 0 Then
      v = Mid(u, i + 1)
      u = Left(u, i - 1)
      fFormat = Right(String(NbInt, "0") & u, NbInt) & Application.DecimalSeparator & Left(v & String(NbDec, "0"), NbDec)
   Else
      fFormat = Right(String(NbInt, "0") & u, NbInt) & Application.DecimalSeparator & String(NbDec, "0")
   End If
End Function
Task: Formatted numeric output
C#: class Program
    {


        static void Main(string[] args)
        {

            float myNumbers = 7.125F;
            
            string strnumber = Convert.ToString(myNumbers);
                       
            Console.WriteLine(strnumber.PadLeft(9, '0'));
           
            Console.ReadLine();
        }
        

             
       
    }

C++: #include <iostream>
#include <iomanip>

int main()
{
  std::cout << std::setfill('0') << std::setw(9) << std::fixed << std::setprecision(3) << 7.125 << std::endl;
  return 0;
}
Task: Formatted numeric output
C++: #include <iostream>
#include <iomanip>

int main()
{
  std::cout << std::setfill('0') << std::setw(9) << std::fixed << std::setprecision(3) << 7.125 << std::endl;
  return 0;
}

Go: fmt.Printf("%09.3f", 7.125)
Task: Formatted numeric output
C++: #include <iostream>
#include <iomanip>

int main()
{
  std::cout << std::setfill('0') << std::setw(9) << std::fixed << std::setprecision(3) << 7.125 << std::endl;
  return 0;
}

Java: public class Printing{
	public static void main(String[] args){
		double value = 7.125;
		System.out.printf("%09.3f",value); 
		System.out.println(String.format("%09.3f",value));
	}
}
Task: Formatted numeric output
C++: #include <iostream>
#include <iomanip>

int main()
{
  std::cout << std::setfill('0') << std::setw(9) << std::fixed << std::setprecision(3) << 7.125 << std::endl;
  return 0;
}

Python: from math import pi, exp
r = exp(pi)-pi
print r
print "e=%e f=%f g=%g G=%G s=%s r=%r!"%(r,r,r,r,r,r)
print "e=%9.4e f=%9.4f g=%9.4g!"%(-r,-r,-r)
print "e=%9.4e f=%9.4f g=%9.4g!"%(r,r,r)
print "e=%-9.4e f=%-9.4f g=%-9.4g!"%(r,r,r)
print "e=%09.4e f=%09.4f g=%09.4g!"%(-r,-r,-r)
print "e=%09.4e f=%09.4f g=%09.4g!"%(r,r,r)
print "e=%-09.4e f=%-09.4f g=%-09.4g!"%(r,r,r)
Task: Formatted numeric output
C++: #include <iostream>
#include <iomanip>

int main()
{
  std::cout << std::setfill('0') << std::setw(9) << std::fixed << std::setprecision(3) << 7.125 << std::endl;
  return 0;
}

VB: Option Explicit

Sub Main()
Debug.Print fFormat(13, 2, 1230.3333)
Debug.Print fFormat(2, 13, 1230.3333)
Debug.Print fFormat(10, 5, 0.3333)
Debug.Print fFormat(13, 2, 1230)
End Sub

Private Function fFormat(NbInt As Integer, NbDec As Integer, Nb As Double) As String



Dim u As String, v As String, i As Integer
   u = CStr(Nb)
   i = InStr(u, Application.DecimalSeparator)
   If i > 0 Then
      v = Mid(u, i + 1)
      u = Left(u, i - 1)
      fFormat = Right(String(NbInt, "0") & u, NbInt) & Application.DecimalSeparator & Left(v & String(NbDec, "0"), NbDec)
   Else
      fFormat = Right(String(NbInt, "0") & u, NbInt) & Application.DecimalSeparator & String(NbDec, "0")
   End If
End Function
Task: Formatted numeric output
C#: class Program
    {


        static void Main(string[] args)
        {

            float myNumbers = 7.125F;
            
            string strnumber = Convert.ToString(myNumbers);
                       
            Console.WriteLine(strnumber.PadLeft(9, '0'));
           
            Console.ReadLine();
        }
        

             
       
    }

Go: fmt.Printf("%09.3f", 7.125)
Task: Formatted numeric output
C#: class Program
    {


        static void Main(string[] args)
        {

            float myNumbers = 7.125F;
            
            string strnumber = Convert.ToString(myNumbers);
                       
            Console.WriteLine(strnumber.PadLeft(9, '0'));
           
            Console.ReadLine();
        }
        

             
       
    }

Java: public class Printing{
	public static void main(String[] args){
		double value = 7.125;
		System.out.printf("%09.3f",value); 
		System.out.println(String.format("%09.3f",value));
	}
}
Task: Formatted numeric output
C#: class Program
    {


        static void Main(string[] args)
        {

            float myNumbers = 7.125F;
            
            string strnumber = Convert.ToString(myNumbers);
                       
            Console.WriteLine(strnumber.PadLeft(9, '0'));
           
            Console.ReadLine();
        }
        

             
       
    }

Python: from math import pi, exp
r = exp(pi)-pi
print r
print "e=%e f=%f g=%g G=%G s=%s r=%r!"%(r,r,r,r,r,r)
print "e=%9.4e f=%9.4f g=%9.4g!"%(-r,-r,-r)
print "e=%9.4e f=%9.4f g=%9.4g!"%(r,r,r)
print "e=%-9.4e f=%-9.4f g=%-9.4g!"%(r,r,r)
print "e=%09.4e f=%09.4f g=%09.4g!"%(-r,-r,-r)
print "e=%09.4e f=%09.4f g=%09.4g!"%(r,r,r)
print "e=%-09.4e f=%-09.4f g=%-09.4g!"%(r,r,r)
Task: Formatted numeric output
C#: class Program
    {


        static void Main(string[] args)
        {

            float myNumbers = 7.125F;
            
            string strnumber = Convert.ToString(myNumbers);
                       
            Console.WriteLine(strnumber.PadLeft(9, '0'));
           
            Console.ReadLine();
        }
        

             
       
    }

VB: Option Explicit

Sub Main()
Debug.Print fFormat(13, 2, 1230.3333)
Debug.Print fFormat(2, 13, 1230.3333)
Debug.Print fFormat(10, 5, 0.3333)
Debug.Print fFormat(13, 2, 1230)
End Sub

Private Function fFormat(NbInt As Integer, NbDec As Integer, Nb As Double) As String



Dim u As String, v As String, i As Integer
   u = CStr(Nb)
   i = InStr(u, Application.DecimalSeparator)
   If i > 0 Then
      v = Mid(u, i + 1)
      u = Left(u, i - 1)
      fFormat = Right(String(NbInt, "0") & u, NbInt) & Application.DecimalSeparator & Left(v & String(NbDec, "0"), NbDec)
   Else
      fFormat = Right(String(NbInt, "0") & u, NbInt) & Application.DecimalSeparator & String(NbDec, "0")
   End If
End Function
Task: Formatted numeric output
Java: public class Printing{
	public static void main(String[] args){
		double value = 7.125;
		System.out.printf("%09.3f",value); 
		System.out.println(String.format("%09.3f",value));
	}
}

Python: from math import pi, exp
r = exp(pi)-pi
print r
print "e=%e f=%f g=%g G=%G s=%s r=%r!"%(r,r,r,r,r,r)
print "e=%9.4e f=%9.4f g=%9.4g!"%(-r,-r,-r)
print "e=%9.4e f=%9.4f g=%9.4g!"%(r,r,r)
print "e=%-9.4e f=%-9.4f g=%-9.4g!"%(r,r,r)
print "e=%09.4e f=%09.4f g=%09.4g!"%(-r,-r,-r)
print "e=%09.4e f=%09.4f g=%09.4g!"%(r,r,r)
print "e=%-09.4e f=%-09.4f g=%-09.4g!"%(r,r,r)
Task: Formatted numeric output
Java: public class Printing{
	public static void main(String[] args){
		double value = 7.125;
		System.out.printf("%09.3f",value); 
		System.out.println(String.format("%09.3f",value));
	}
}

VB: Option Explicit

Sub Main()
Debug.Print fFormat(13, 2, 1230.3333)
Debug.Print fFormat(2, 13, 1230.3333)
Debug.Print fFormat(10, 5, 0.3333)
Debug.Print fFormat(13, 2, 1230)
End Sub

Private Function fFormat(NbInt As Integer, NbDec As Integer, Nb As Double) As String



Dim u As String, v As String, i As Integer
   u = CStr(Nb)
   i = InStr(u, Application.DecimalSeparator)
   If i > 0 Then
      v = Mid(u, i + 1)
      u = Left(u, i - 1)
      fFormat = Right(String(NbInt, "0") & u, NbInt) & Application.DecimalSeparator & Left(v & String(NbDec, "0"), NbDec)
   Else
      fFormat = Right(String(NbInt, "0") & u, NbInt) & Application.DecimalSeparator & String(NbDec, "0")
   End If
End Function
Task: Formatted numeric output
Python: from math import pi, exp
r = exp(pi)-pi
print r
print "e=%e f=%f g=%g G=%G s=%s r=%r!"%(r,r,r,r,r,r)
print "e=%9.4e f=%9.4f g=%9.4g!"%(-r,-r,-r)
print "e=%9.4e f=%9.4f g=%9.4g!"%(r,r,r)
print "e=%-9.4e f=%-9.4f g=%-9.4g!"%(r,r,r)
print "e=%09.4e f=%09.4f g=%09.4g!"%(-r,-r,-r)
print "e=%09.4e f=%09.4f g=%09.4g!"%(r,r,r)
print "e=%-09.4e f=%-09.4f g=%-09.4g!"%(r,r,r)

VB: Option Explicit

Sub Main()
Debug.Print fFormat(13, 2, 1230.3333)
Debug.Print fFormat(2, 13, 1230.3333)
Debug.Print fFormat(10, 5, 0.3333)
Debug.Print fFormat(13, 2, 1230)
End Sub

Private Function fFormat(NbInt As Integer, NbDec As Integer, Nb As Double) As String



Dim u As String, v As String, i As Integer
   u = CStr(Nb)
   i = InStr(u, Application.DecimalSeparator)
   If i > 0 Then
      v = Mid(u, i + 1)
      u = Left(u, i - 1)
      fFormat = Right(String(NbInt, "0") & u, NbInt) & Application.DecimalSeparator & Left(v & String(NbDec, "0"), NbDec)
   Else
      fFormat = Right(String(NbInt, "0") & u, NbInt) & Application.DecimalSeparator & String(NbDec, "0")
   End If
End Function
Task: Formatted numeric output
C: #include <stdio.h>
main(){
  float r=7.125;
  printf(" %9.3f\n",-r);
  printf(" %9.3f\n",r);
  printf(" %-9.3f\n",r);
  printf(" %09.3f\n",-r);
  printf(" %09.3f\n",r);
  printf(" %-09.3f\n",r);
  return 0;
}

Python: from math import pi, exp
r = exp(pi)-pi
print r
print "e=%e f=%f g=%g G=%G s=%s r=%r!"%(r,r,r,r,r,r)
print "e=%9.4e f=%9.4f g=%9.4g!"%(-r,-r,-r)
print "e=%9.4e f=%9.4f g=%9.4g!"%(r,r,r)
print "e=%-9.4e f=%-9.4f g=%-9.4g!"%(r,r,r)
print "e=%09.4e f=%09.4f g=%09.4g!"%(-r,-r,-r)
print "e=%09.4e f=%09.4f g=%09.4g!"%(r,r,r)
print "e=%-09.4e f=%-09.4f g=%-09.4g!"%(r,r,r)
Task: Formatted numeric output
Go: fmt.Printf("%09.3f", 7.125)

Java: public class Printing{
	public static void main(String[] args){
		double value = 7.125;
		System.out.printf("%09.3f",value); 
		System.out.println(String.format("%09.3f",value));
	}
}
Task: Formatted numeric output
Go: fmt.Printf("%09.3f", 7.125)

Python: from math import pi, exp
r = exp(pi)-pi
print r
print "e=%e f=%f g=%g G=%G s=%s r=%r!"%(r,r,r,r,r,r)
print "e=%9.4e f=%9.4f g=%9.4g!"%(-r,-r,-r)
print "e=%9.4e f=%9.4f g=%9.4g!"%(r,r,r)
print "e=%-9.4e f=%-9.4f g=%-9.4g!"%(r,r,r)
print "e=%09.4e f=%09.4f g=%09.4g!"%(-r,-r,-r)
print "e=%09.4e f=%09.4f g=%09.4g!"%(r,r,r)
print "e=%-09.4e f=%-09.4f g=%-09.4g!"%(r,r,r)
Task: Formatted numeric output
Go: fmt.Printf("%09.3f", 7.125)

VB: Option Explicit

Sub Main()
Debug.Print fFormat(13, 2, 1230.3333)
Debug.Print fFormat(2, 13, 1230.3333)
Debug.Print fFormat(10, 5, 0.3333)
Debug.Print fFormat(13, 2, 1230)
End Sub

Private Function fFormat(NbInt As Integer, NbDec As Integer, Nb As Double) As String



Dim u As String, v As String, i As Integer
   u = CStr(Nb)
   i = InStr(u, Application.DecimalSeparator)
   If i > 0 Then
      v = Mid(u, i + 1)
      u = Left(u, i - 1)
      fFormat = Right(String(NbInt, "0") & u, NbInt) & Application.DecimalSeparator & Left(v & String(NbDec, "0"), NbDec)
   Else
      fFormat = Right(String(NbInt, "0") & u, NbInt) & Application.DecimalSeparator & String(NbDec, "0")
   End If
End Function
Task: Formatted numeric output
C: #include <stdio.h>
main(){
  float r=7.125;
  printf(" %9.3f\n",-r);
  printf(" %9.3f\n",r);
  printf(" %-9.3f\n",r);
  printf(" %09.3f\n",-r);
  printf(" %09.3f\n",r);
  printf(" %-09.3f\n",r);
  return 0;
}

PHP: echo str_pad(7.125, 9, '0', STR_PAD_LEFT);
Task: Formatted numeric output
C#: class Program
    {


        static void Main(string[] args)
        {

            float myNumbers = 7.125F;
            
            string strnumber = Convert.ToString(myNumbers);
                       
            Console.WriteLine(strnumber.PadLeft(9, '0'));
           
            Console.ReadLine();
        }
        

             
       
    }

PHP: echo str_pad(7.125, 9, '0', STR_PAD_LEFT);
Task: Formatted numeric output
C++: #include <iostream>
#include <iomanip>

int main()
{
  std::cout << std::setfill('0') << std::setw(9) << std::fixed << std::setprecision(3) << 7.125 << std::endl;
  return 0;
}

PHP: echo str_pad(7.125, 9, '0', STR_PAD_LEFT);
Task: Formatted numeric output
Java: public class Printing{
	public static void main(String[] args){
		double value = 7.125;
		System.out.printf("%09.3f",value); 
		System.out.println(String.format("%09.3f",value));
	}
}

PHP: echo str_pad(7.125, 9, '0', STR_PAD_LEFT);
Task: Formatted numeric output
Python: from math import pi, exp
r = exp(pi)-pi
print r
print "e=%e f=%f g=%g G=%G s=%s r=%r!"%(r,r,r,r,r,r)
print "e=%9.4e f=%9.4f g=%9.4g!"%(-r,-r,-r)
print "e=%9.4e f=%9.4f g=%9.4g!"%(r,r,r)
print "e=%-9.4e f=%-9.4f g=%-9.4g!"%(r,r,r)
print "e=%09.4e f=%09.4f g=%09.4g!"%(-r,-r,-r)
print "e=%09.4e f=%09.4f g=%09.4g!"%(r,r,r)
print "e=%-09.4e f=%-09.4f g=%-09.4g!"%(r,r,r)

PHP: echo str_pad(7.125, 9, '0', STR_PAD_LEFT);
Task: Formatted numeric output
VB: Option Explicit

Sub Main()
Debug.Print fFormat(13, 2, 1230.3333)
Debug.Print fFormat(2, 13, 1230.3333)
Debug.Print fFormat(10, 5, 0.3333)
Debug.Print fFormat(13, 2, 1230)
End Sub

Private Function fFormat(NbInt As Integer, NbDec As Integer, Nb As Double) As String



Dim u As String, v As String, i As Integer
   u = CStr(Nb)
   i = InStr(u, Application.DecimalSeparator)
   If i > 0 Then
      v = Mid(u, i + 1)
      u = Left(u, i - 1)
      fFormat = Right(String(NbInt, "0") & u, NbInt) & Application.DecimalSeparator & Left(v & String(NbDec, "0"), NbDec)
   Else
      fFormat = Right(String(NbInt, "0") & u, NbInt) & Application.DecimalSeparator & String(NbDec, "0")
   End If
End Function

PHP: echo str_pad(7.125, 9, '0', STR_PAD_LEFT);
Task: Taxicab numbers
C++: #include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <sstream>
#include <vector>

template <typename T>
size_t indexOf(const std::vector<T> &v, const T &k) {
    auto it = std::find(v.cbegin(), v.cend(), k);

    if (it != v.cend()) {
        return it - v.cbegin();
    }
    return -1;
}

int main() {
    std::vector<size_t> cubes;

    auto dump = [&cubes](const std::string &title, const std::map<int, size_t> &items) {
        std::cout << title;
        for (auto &item : items) {
            std::cout << "\n" << std::setw(4) << item.first << " " << std::setw(10) << item.second;
            for (auto x : cubes) {
                auto y = item.second - x;
                if (y < x) {
                    break;
                }
                if (std::count(cubes.begin(), cubes.end(), y)) {
                    std::cout << " = " << std::setw(4) << indexOf(cubes, y) << "^3 + " << std::setw(3) << indexOf(cubes, x) << "^3";
                }
            }
        }
    };

    std::vector<size_t> sums;

    
    for (size_t i = 0; i < 1190; i++) {
        auto cube = i * i * i;
        cubes.push_back(cube);
        for (auto j : cubes) {
            sums.push_back(cube + j);
        }
    }
    std::sort(sums.begin(), sums.end());

    
    auto nm1 = sums[0];
    auto n = sums[1];
    int idx = 0;
    std::map<int, size_t> task;
    std::map<int, size_t> trips;

    auto it = sums.cbegin();
    auto end = sums.cend();
    it++;
    it++;

    while (it != end) {
        auto np1 = *it;

        if (nm1 == np1) {
            trips.emplace(idx, n);
        }
        if (nm1 != n && n == np1) {
            if (++idx <= 25 || idx >= 2000 == idx <= 2006) {
                task.emplace(idx, n);
            }
        }
        nm1 = n;
        n = np1;

        it++;
    }

    dump("First 25 Taxicab Numbers, the 2000th, plus the next half-dozen:", task);

    std::stringstream ss;
    ss << "\n\nFound " << trips.size() << " triple Taxicabs under 2007:";
    dump(ss.str(), trips);

    return 0;
}

Python: from collections import defaultdict
from itertools import product
from pprint import pprint as pp

cube2n = {x**3:x for x in range(1, 1201)}
sum2cubes = defaultdict(set)
for c1, c2 in product(cube2n, cube2n):
	if c1 >= c2: sum2cubes[c1 + c2].add((cube2n[c1], cube2n[c2]))
	
taxied = sorted((k, v) for k,v in sum2cubes.items() if len(v) >= 2)


for t in enumerate(taxied[:25], 1):
    pp(t)
print('...')    
for t in enumerate(taxied[2000-1:2000+6], 2000):
    pp(t)
Task: Taxicab numbers
C#: using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TaxicabNumber
{
    class Program
    {
        static void Main(string[] args)
        {
            IDictionary<long, IList<Tuple<int, int>>> taxicabNumbers = GetTaxicabNumbers(2006);
            PrintTaxicabNumbers(taxicabNumbers);
            Console.ReadKey();
        }

        private static IDictionary<long, IList<Tuple<int, int>>> GetTaxicabNumbers(int length)
        {
            SortedList<long, IList<Tuple<int, int>>> sumsOfTwoCubes = new SortedList<long, IList<Tuple<int, int>>>();

            for (int i = 1; i < int.MaxValue; i++)
            {
                for (int j = 1; j < int.MaxValue; j++)
                {
                    long sum = (long)(Math.Pow((double)i, 3) + Math.Pow((double)j, 3));

                    if (!sumsOfTwoCubes.ContainsKey(sum))
                    {
                        sumsOfTwoCubes.Add(sum, new List<Tuple<int, int>>());
                    }

                    sumsOfTwoCubes[sum].Add(new Tuple<int, int>(i, j));

                    if (j >= i)
                    {
                        break;
                    }
                }

                
                if (sumsOfTwoCubes.Count(t => t.Value.Count >= 2) >= length * 1.1)
                {
                    break;
                }
            }

            IDictionary<long, IList<Tuple<int, int>>> values = (from t in sumsOfTwoCubes where t.Value.Count >= 2 select t)
                .Take(2006)
                .ToDictionary(u => u.Key, u => u.Value);

            return values;
        }

        private static void PrintTaxicabNumbers(IDictionary<long, IList<Tuple<int, int>>> values)
        {
            int i = 1;

            foreach (long taxicabNumber in values.Keys)
            {
                StringBuilder output = new StringBuilder().AppendFormat("{0,10}\t{1,4}", i, taxicabNumber);

                foreach (Tuple<int, int> numbers in values[taxicabNumber])
                {
                    output.AppendFormat("\t= {0}^3 + {1}^3", numbers.Item1, numbers.Item2);
                }

                if (i <= 25 || (i >= 2000 && i <= 2006))
                {
                    Console.WriteLine(output.ToString());
                }

                i++;
            }
        }
    }
}

Python: from collections import defaultdict
from itertools import product
from pprint import pprint as pp

cube2n = {x**3:x for x in range(1, 1201)}
sum2cubes = defaultdict(set)
for c1, c2 in product(cube2n, cube2n):
	if c1 >= c2: sum2cubes[c1 + c2].add((cube2n[c1], cube2n[c2]))
	
taxied = sorted((k, v) for k,v in sum2cubes.items() if len(v) >= 2)


for t in enumerate(taxied[:25], 1):
    pp(t)
print('...')    
for t in enumerate(taxied[2000-1:2000+6], 2000):
    pp(t)