Jump to content

Taxicab numbers: Difference between revisions

Line 1,880:
 
=={{header|Mathematica}}==
<lang Mathematica>findTaxiNumbersfindTaxi[n_] := BlockSort[Keys[Select[Counts[Flatten[Table[x^3 + y^3, {datax, =1, <||>n}, {y, x, n}]]], GreaterThan[1]]]];
Do[AppendTo[data, x^3 + y^3 -> Lookup[data, x^3 + y^3, 0] + 1],
{x, 1, n},
{y, x, n}];
Sort[Keys[Select[data, # >= 2 &]]]
];
Take[findTaxiNumbers[100], 25]
found=findTaxiNumbers[1200][[2000 ;; 2005]]
Cookies help us deliver our services. By using our services, you agree to our use of cookies.