ハーディ・ラマヌジャン数(Python, C)

ある4桁の自然数は、2つの数の立方体(三乗)の和として表す方法が2通りある最小の数である。

def Pra_13():
	List = []
	for i in xrange(1, 22):
		for j in xrange(i, 22):
			total = i **3 +  j ** 3
			if total in List:
				return total
				break
			else:
				List.append(total)
		
#include <stdio.h>
#include <math.h>

main(){
	int d = 441; int i, j, k, total;
	int dict[d];
	int count = 0;
	for(i = 1 ; i <= 21; i++){
		for( j = i; j <= 21; j++){
		 	total = pow(i, 3) + pow(j, 3);
			for( k = 0; k <= count - 1; k++){
				if (dict[k] == total){
					printf("%d\n", total);
				}
			}
			dict[k] = total;
			count += 1;
		}
	}	
}