Problem:


Score : 300 points

Problem Statement

Let f(n) be the number of triples of integers (x,y,z) that satisfy both of the following conditions:

1 \leq x,y,z

x^2 + y^2 + z^2 + xy + yz + zx = n

Given an integer N, find each of f(1),f(2),f(3),\ldots,f(N).

Constraints

All values in input are integers.

1 \leq N \leq 10^4

Input

Input is given from Standard Input in the following format:

N

Output

Print N lines. The i-th line should contain the value f(i).

Sample Input 1

20

Sample Output 1

0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0

For n=6, only (1,1,1) satisfies both of the conditions. Thus, f(6) = 1.

For n=11, three triples, (1,1,2), (1,2,1), and (2,1,1), satisfy both of the conditions. Thus, f(6) = 3.

For n=17, three triples, (1,2,2), (2,1,2), and (2,2,1), satisfy both of the conditions. Thus, f(17) = 3.

For n=18, three triples, (1,1,3), (1,3,1), and (3,1,1), satisfy both of the conditions. Thus, f(18) = 3.



Sample input:
20


Sample output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0

Submission status: Wrong Answer

Solution code:
n = int(input())

a = [6, 11, 18, 27, 38, 51, 66, 83, 102, 123, 146, 171, 198, 227, 258, 291, 326, 363, 402, 443, 486, 531, 578, 627, 678, 731, 786, 843, 902, 963, 17, 25, 35, 47, 61, 77, 95, 115, 137, 161, 187, 215, 245, 277, 311, 347, 385, 425, 467, 511, 557, 605, 655, 707, 761, 817, 875, 935, 997, 34, 45, 58, 73, 90, 109, 130, 153, 178, 205, 234, 265, 298, 333, 370, 409, 450, 493, 538, 585, 634, 685, 738, 793, 850, 909, 970, 1033, 57, 71, 87, 105, 125, 147, 171, 197, 225, 255, 287, 321, 357, 395, 435, 477, 521, 567, 615, 665, 717, 771, 827, 885, 945, 1007, 1071, 86, 103, 122, 143, 166, 191, 218, 247, 278, 311, 346, 383, 422, 463, 506, 551, 598, 647, 698, 751, 806, 863, 922, 983, 1046, 1111, 121, 141, 163, 187, 213, 241, 271, 303, 337, 373, 411, 451, 493, 537, 583, 631, 681, 733, 787, 843, 901, 961, 1023, 1087, 1153, 162, 185, 210, 237, 266, 297, 330, 365, 402, 441, 482, 525, 570, 617, 666, 717, 770, 825, 882, 941, 1002, 1065, 1130, 1197, 209, 235, 263, 293, 325, 359, 395, 433, 473, 515, 559, 605, 653, 703, 755, 809, 865, 923, 983, 1045, 1109, 1175, 1243, 262, 291, 322, 355, 390, 427, 466, 507, 550, 595, 642, 691, 742, 795, 850, 907, 966, 1027, 1090, 1155, 1222, 1291, 321, 353, 387, 423, 461, 501, 543, 587, 633, 681, 731, 783, 837, 893, 951, 1011, 1073, 1137, 1203, 1271, 1341, 386, 421, 458, 497, 538, 581, 626, 673, 722, 773, 826, 881, 938, 997, 1058, 1121, 1186, 1253, 1322, 1393, 457, 495, 535, 577, 621, 667, 715, 765, 817, 871, 927, 985, 1045, 1107, 1171,     1237, 1305, 1375, 1447, 534, 575, 618, 663, 710, 759, 810, 863, 918, 975, 1034, 1095,     1158, 1223, 1290, 1359, 1430, 1503, 617, 661, 707, 755, 805, 857, 911, 967, 1025, 1085, 1147, 1211, 1277, 1345, 1415, 1487, 1561, 706, 753, 802, 853, 906, 961, 1018, 1077, 1138, 1201, 1266, 1333, 1402, 1473, 1546, 1621, 801, 851, 903, 957, 1013, 1071, 1131,     1193, 1257, 1323, 1391, 1461, 1533, 1607, 1683, 902, 955, 1010, 1067, 1126, 1187, 1250, 1315, 1382, 1451, 1522, 1595, 1670, 1747, 1009, 1065, 1123, 1183, 1245, 1309, 1375, 1443, 1513, 1585, 1659, 1735, 1813, 1122, 1181, 1242, 1305, 1370, 1437, 1506, 1577, 1650, 1725, 1802, 1881, 1241, 1303, 1367, 1433, 1501, 1571, 1643, 1717, 1793, 1871, 1951, 1366, 1431, 1498, 1567, 1638, 1711, 1786, 1863, 1942, 2023, 1497, 1565, 1635, 1707, 1781, 1857, 1935, 2015, 2097, 1634, 1705, 1778, 1853, 1930, 2009, 2090, 2173, 1777, 1851, 1927, 2005, 2085, 2167, 2251, 1926, 2003, 2082, 2163, 2246, 2331, 2081, 2161, 2243, 2327, 2413, 2242, 2325, 2410, 2497, 2409, 2495, 2583, 2582, 2671, 2761, 24, 33, 44, 57, 72, 89, 108, 129, 152, 177, 204, 233, 264, 297, 332, 369, 408, 449, 492, 537, 584, 633, 684, 737, 792, 849, 908, 969, 1032, 43, 55, 69, 85, 103, 123, 145, 169, 195, 223, 253, 285, 319, 355, 393, 433, 475, 519, 565, 613, 663, 715, 769, 825, 883, 943, 1005, 1069, 68, 83, 100, 119, 140, 163, 188, 215, 244, 275, 308, 343, 380, 419, 460, 503, 548, 595, 644, 695, 748, 803, 860, 919, 980, 1043, 1108, 99, 117, 137, 159, 183, 209,     237, 267, 299, 333, 369, 407, 447, 489, 533, 579, 627, 677, 729, 783, 839, 897, 957, 1019, 1083, 1149, 136, 157, 180, 205, 232, 261, 292, 325, 360, 397, 436, 477, 520, 565, 612, 661, 712, 765, 820, 877, 936, 997, 1060, 1125, 1192, 179, 203, 229, 257, 287, 319, 353, 389, 427, 467, 509, 553, 599, 647, 697, 749, 803, 859, 917, 977, 1039, 1103, 1169, 1237, 228, 255, 284, 315, 348, 383, 420, 459, 500, 543, 588, 635, 684, 735, 788, 843, 900, 959, 1020, 1083, 1148, 1215, 1284, 283, 313, 345, 379, 415, 453, 493, 535, 579, 625, 673, 723, 775, 829, 885, 943, 1003, 1065, 1129, 1195, 1263, 1333, 344, 377, 412, 449, 488, 529, 572, 617, 664, 713, 764, 817, 872, 929, 988, 1049, 1112, 1177, 1244, 1313, 1384, 411, 447, 485, 525, 567, 611, 657, 705, 755, 807, 861, 917, 975, 1035, 1097, 1161, 1227, 1295, 1365, 1437, 484, 523, 564, 607, 652, 699, 748, 799, 852, 907, 964, 1023, 1084, 1147, 1212, 1279, 1348, 1419, 1492, 563, 605, 649, 695, 743, 793, 845, 899, 955, 1013, 1073, 1135, 1199, 1265, 1333, 1403, 1475, 1549, 648, 693, 740, 789, 840, 893, 948, 1005, 1064, 1125, 1188, 1253, 1320, 1389, 1460, 1533, 1608, 739, 787, 837, 889, 943, 999, 1057, 1117, 1179, 1243, 1309, 1377, 1447, 1519, 1593, 1669, 836, 887, 940, 995, 1052, 1111, 1172, 1235, 1300, 1367, 1436, 1507, 1580, 1655, 1732, 939, 993, 1049, 1107, 1167, 1229, 1293, 1359, 1427, 1497, 1569, 1643, 1719, 1797, 1048, 1105, 1164, 1225, 1288, 1353, 1420, 1489, 1560, 1633, 1708, 1785, 1864, 1163, 1223, 1285, 1349, 1415, 1483, 1553, 1625, 1699, 1775, 1853, 1933, 1284, 1347, 1412, 1479, 1548, 1619, 1692, 1767, 1844, 1923, 2004, 1411, 1477, 1545, 1615, 1687, 1761, 1837, 1915, 1995, 2077, 1544, 1613, 1684, 1757, 1832, 1909, 1988, 2069, 2152, 1683, 1755, 1829, 1905, 1983, 2063, 2145, 2229, 1828, 1903, 1980, 2059, 2140, 2223, 2308, 1979, 2057, 2137, 2219, 2303, 2389, 2136, 2217, 2300, 2385, 2472, 2299, 2383, 2469, 2557, 2468, 2555, 2644, 2643, 2733, 2824, 54, 67, 82, 99, 118, 139, 162, 187, 214, 243, 274, 307, 342, 379, 418, 459, 502, 547, 594, 643, 694, 747, 802, 859, 918, 979, 1042, 1107, 81, 97, 115, 135, 157, 181, 207, 235, 265, 297, 331, 367, 405, 445, 487, 531, 577, 625, 675, 727, 781, 837, 895, 955, 1017, 1081, 1147, 114, 133, 154, 177, 202, 229, 258, 289, 322, 357, 394, 433, 474, 517, 562, 609, 658, 709, 762, 817, 874, 933, 994, 1057, 1122, 1189, 153, 175, 199, 225, 253, 283, 315, 349, 385, 423, 463, 505, 549, 595, 643, 693, 745, 799, 855, 913, 973, 1035, 1099, 1165, 1233, 198, 223, 250, 279, 310, 343, 378, 415, 454, 495, 538, 583, 630, 679, 730, 783, 838, 895, 954, 1015, 1078, 1143, 1210, 1279, 249, 277, 307, 339, 373, 409, 447, 487, 529, 573, 619, 667, 717, 769, 823, 879, 937, 997, 1059, 1123, 1189, 1257, 1327, 306, 337, 370, 405, 442, 481, 522, 565, 610, 657, 706, 757, 810, 865, 922, 981, 1042, 1105, 1170, 1237, 1306, 1377, 369, 403, 439, 477, 517, 559, 603, 649, 697, 747, 799, 853, 909, 967, 1027, 1089, 1153, 1219, 1287, 1357, 1429, 438, 475, 514, 555, 598, 643, 690, 739, 790, 843, 898, 955, 1014, 1075, 1138, 1203, 1270, 1339, 1410, 1483, 513, 553, 595, 639, 685, 733, 783, 835, 889, 945, 1003, 1063, 1125, 1189, 1255, 1323, 1393, 1465, 1539, 594, 637, 682, 729, 778, 829, 882, 937, 994, 1053, 1114, 1177, 1242, 1309, 1378, 1449, 1522, 1597, 681, 727, 775, 825, 877, 931, 987, 1045, 1105, 1167, 1231, 1297, 1365, 1435, 1507, 1581, 1657, 774, 823, 874, 927, 982, 1039, 1098, 1159, 1222, 1287, 1354, 1423, 1494, 1567, 1642, 1719, 873, 925, 979, 1035, 1093, 1153, 1215, 1279, 1345, 1413, 1483, 1555, 1629, 1705, 1783, 978, 1033, 1090, 1149, 1210, 1273, 1338, 1405, 1474, 1545, 1618, 1693, 1770, 1849, 1089, 1147, 1207, 1269, 1333, 1399, 1467, 1537, 1609, 1683, 1759, 1837, 1917, 1206, 1267, 1330, 1395, 1462, 1531, 1602, 1675, 1750, 1827, 1906, 1987, 1329, 1393, 1459, 1527, 1597, 1669, 1743, 1819, 1897, 1977, 2059, 1458, 1525, 1594, 1665, 1738, 1813, 1890, 1969, 2050, 2133, 1593, 1663, 1735, 1809, 1885, 1963, 2043, 2125, 2209, 1734, 1807, 1882, 1959, 2038, 2119, 2202, 2287, 1881, 1957, 2035, 2115, 2197, 2281, 2367, 2034, 2113, 2194, 2277, 2362, 2449, 2193, 2275, 2359, 2445, 2533, 2358, 2443, 2530, 2619, 2529, 2617, 2707, 2706, 2797, 2889, 96, 113, 132, 153, 176, 201, 228, 257, 288, 321, 356, 393, 432, 473, 516, 561, 608, 657, 708, 761, 816, 873, 932, 993, 1056, 1121, 1188, 131, 151, 173, 197, 223, 251, 281, 313, 347, 383, 421, 461, 503, 547, 593, 641, 691, 743, 797, 853, 911, 971, 1033, 1097, 1163, 1231, 172, 195, 220, 247, 276, 307, 340, 375, 412, 451, 492, 535, 580, 627, 676, 727, 780, 835, 892, 951, 1012, 1075, 1140, 1207, 1276, 219, 245, 273, 303, 335, 369, 405, 443, 483, 525, 569, 615, 663, 713, 765, 819, 875, 933, 993, 1055, 1119, 1185, 1253, 1323, 272, 301, 332, 365, 400, 437, 476, 517, 560, 605, 652, 701, 752, 805, 860, 917, 976, 1037, 1100, 1165, 1232, 1301, 1372, 331, 363, 397, 433, 471, 511, 553, 597, 643, 691, 741, 793, 847, 903, 961, 1021, 1083, 1147, 1213, 1281, 1351, 1423, 396, 431, 468, 507, 548, 591, 636, 683, 732, 783, 836, 891, 948, 1007, 1068, 1131, 1196, 1263, 1332, 1403, 1476, 467, 505, 545, 587, 631, 677, 725, 775, 827, 881, 937, 995, 1055, 1117, 1181, 1247, 1315, 1385, 1457, 1531, 544, 585, 628, 673, 720, 769, 820, 873, 928, 985, 1044, 1105, 1168, 1233, 1300, 1369, 1440, 1513, 1588, 627, 671, 717, 765, 815, 867, 921, 977, 1035, 1095, 1157, 1221, 1287, 1355, 1425, 1497, 1571, 1647, 716, 763, 812, 863, 916, 971, 1028, 1087, 1148, 1211, 1276, 1343, 1412, 1483, 1556, 1631, 1708, 811, 861, 913, 967, 1023, 1081, 1141, 1203, 1267, 1333, 1401, 1471, 1543, 1617, 1693, 1771, 912, 965, 1020, 1077, 1136, 1197, 1260, 1325, 1392, 1461, 1532, 1605, 1680, 1757, 1836, 1019, 1075, 1133, 1193, 1255, 1319, 1385, 1453, 1523, 1595, 1669, 1745, 1823, 1903, 1132, 1191, 1252, 1315, 1380, 1447, 1516, 1587, 1660, 1735, 1812, 1891, 1972, 1251, 1313, 1377, 1443, 1511, 1581, 1653, 1727, 1803, 1881, 1961, 2043, 1376, 1441, 1508, 1577, 1648, 1721, 1796, 1873, 1952, 2033, 2116, 1507, 1575, 1645, 1717, 1791, 1867, 1945, 2025, 2107, 2191, 1644, 1715, 1788, 1863, 1940, 2019, 2100, 2183, 2268, 1787, 1861, 1937, 2015, 2095, 2177, 2261, 2347, 1936, 2013, 2092, 2173, 2256, 2341, 2428, 2091, 2171, 2253, 2337, 2423, 2511, 2252, 2335, 2420, 2507, 2596, 2419, 2505, 2593, 2683, 2592, 2681, 2772, 2771, 2863, 2956, 150, 171, 194, 219, 246, 275, 306, 339, 374, 411, 450, 491, 534, 579, 626, 675, 726, 779, 834, 891, 950, 1011, 1074, 1139, 1206, 1275, 193, 217, 243, 271, 301, 333, 367, 403, 441, 481, 523, 567, 613, 661, 711, 763, 817, 873, 931, 991, 1053, 1117, 1183, 1251, 1321, 242, 269, 298, 329, 362, 397, 434, 473, 514, 557, 602, 649, 698, 749, 802, 857, 914, 973, 1034, 1097, 1162, 1229, 1298, 1369, 297, 327, 359, 393, 429, 467, 507, 549, 593, 639, 687, 737, 789, 843, 899, 957, 1017, 1079, 1143, 1209, 1277, 1347, 1419, 358, 391, 426, 463, 502, 543, 586, 631, 678, 727, 778, 831, 886, 943, 1002, 1063, 1126, 1191, 1258, 1327, 1398, 1471, 425, 461, 499, 539, 581, 625, 671, 719, 769, 821, 875, 931, 989, 1049, 1111, 1175, 1241, 1309, 1379, 1451, 1525, 498, 537, 578, 621, 666, 713, 762, 813, 866, 921, 978, 1037, 1098, 1161, 1226, 1293, 1362, 1433, 1506, 1581, 577, 619, 663, 709, 757, 807, 859, 913, 969, 1027, 1087, 1149, 1213, 1279, 1347, 1417, 1489, 1563, 1639, 662, 707, 754, 803, 854, 907, 962, 1019, 1078, 1139, 1202, 1267, 1334, 1403, 1474, 1547, 1622, 1699, 753, 801, 851, 903, 957, 1013, 1071, 1131, 1193, 1257, 1323, 1391, 1461, 1533, 1607, 1683, 1761, 850, 901, 954, 1009, 1066, 1125, 1186, 1249, 1314, 1381, 1450, 1521, 1594, 1669, 1746, 1825, 953, 1007, 1063, 1121, 1181, 1243, 1307, 1373, 1441, 1511, 1583, 1657, 1733, 1811, 1891, 1062, 1119, 1178, 1239, 1302, 1367, 1434, 1503, 1574, 1647, 1722, 1799, 1878, 1959, 1177, 1237, 1299, 1363, 1429, 1497, 1567, 1639, 1713, 1789, 1867, 1947, 2029, 1298, 1361, 1426, 1493, 1562, 1633, 1706, 1781, 1858, 1937, 2018, 2101, 1425, 1491, 1559, 1629, 1701, 1775, 1851, 1929, 2009, 2091, 2175, 1558, 1627, 1698, 1771, 1846, 1923, 2002, 2083, 2166, 2251, 1697, 1769, 1843, 1919, 1997, 2077, 2159, 2243, 2329, 1842, 1917, 1994, 2073, 2154, 2237, 2322, 2409, 1993, 2071, 2151, 2233, 2317, 2403, 2491, 2150, 2231, 2314, 2399, 2486, 2575, 2313, 2397, 2483, 2571, 2661, 2482, 2569, 2658, 2749, 2657, 2747, 2839, 2838, 2931, 3025, 216, 241, 268, 297, 328, 361, 396, 433, 472, 513, 556, 601, 648, 697, 748, 801, 856, 913, 972, 1033, 1096, 1161, 1228, 1297, 1368, 267, 295, 325, 357, 391, 427, 465, 505, 547, 591, 637, 685, 735, 787, 841, 897, 955, 1015, 1077, 1141, 1207, 1275, 1345, 1417, 324, 355, 388, 423, 460, 499, 540, 583, 628, 675, 724, 775, 828, 883, 940, 999, 1060, 1123, 1188, 1255, 1324, 1395, 1468, 387, 421, 457, 495, 535, 577, 621, 667, 715, 765, 817, 871, 927, 985, 1045, 1107, 1171, 1237, 1305, 1375, 1447, 1521, 456, 493, 532, 573, 616, 661, 708, 757, 808, 861, 916, 973, 1032, 1093, 1156, 1221, 1288, 1357, 1428, 1501, 1576, 531, 571, 613, 657, 703, 751, 801, 853, 907, 963, 1021, 1081, 1143, 1207, 1273, 1341, 1411, 1483, 1557, 1633, 612, 655, 700, 747, 796, 847, 900, 955, 1012, 1071, 1132, 1195, 1260, 1327, 1396, 1467, 1540, 1615, 1692, 699, 745, 793, 843, 895, 949, 1005, 1063, 1123, 1185, 1249, 1315, 1383, 1453, 1525, 1599, 1675, 1753, 792, 841, 892, 945, 1000, 1057, 1116, 1177, 1240, 1305, 1372, 1441, 1512, 1585, 1660, 1737, 1816, 891, 943, 997, 1053, 1111, 1171, 1233, 1297, 1363, 1431, 1501, 1573, 1647, 1723, 1801, 1881, 996, 1051, 1108, 1167, 1228, 1291, 1356, 1423, 1492, 1563, 1636, 1711, 1788, 1867, 1948, 1107, 1165, 1225, 1287, 1351, 1417, 1485, 1555, 1627, 1701, 1777, 1855, 1935, 2017, 1224, 1285, 1348, 1413, 1480, 1549, 1620, 1693, 1768, 1845, 1924, 2005, 2088, 1347, 1411, 1477, 1545, 1615, 1687, 1761, 1837, 1915, 1995, 2077, 2161, 1476, 1543, 1612, 1683, 1756, 1831, 1908, 1987, 2068, 2151, 2236, 1611, 1681, 1753, 1827, 1903, 1981, 2061, 2143, 2227, 2313, 1752, 1825, 1900, 1977, 2056, 2137, 2220, 2305, 2392, 1899, 1975, 2053, 2133, 2215, 2299, 2385, 2473, 2052, 2131, 2212, 2295, 2380, 2467, 2556, 2211, 2293, 2377, 2463, 2551, 2641, 2376, 2461, 2548, 2637, 2728, 2547, 2635, 2725, 2817, 2724, 2815, 2908, 2907, 3001, 3096, 294, 323, 354, 387, 422, 459, 498, 539, 582, 627, 674, 723, 774, 827, 882, 939, 998, 1059, 1122, 1187, 1254, 1323, 1394, 1467, 353, 385, 419, 455, 493, 533, 575, 619, 665, 713, 763, 815, 869, 925, 983, 1043, 1105, 1169, 1235, 1303, 1373, 1445, 1519, 418, 453, 490, 529, 570, 613, 658, 705, 754, 805, 858, 913, 970, 1029, 1090, 1153, 1218, 1285, 1354, 1425, 1498, 1573, 489, 527, 567, 609, 653, 699, 747, 797, 849, 903, 959, 1017, 1077, 1139, 1203, 1269, 1337, 1407, 1479, 1553, 1629, 566, 607, 650, 695, 742, 791, 842, 895, 950, 1007, 1066, 1127, 1190, 1255, 1322, 1391, 1462, 1535, 1610, 1687, 649, 693, 739, 787, 837, 889, 943, 999, 1057, 1117, 1179, 1243, 1309, 1377, 1447, 1519, 1593, 1669, 1747, 738, 785, 834, 885, 938, 993, 1050, 1109, 1170, 1233, 1298, 1365, 1434, 1505, 1578, 1653, 1730, 1809, 833, 883, 935, 989, 1045, 1103, 1163, 1225, 1289, 1355, 1423, 1493, 1565, 1639, 1715, 1793, 1873, 934, 987, 1042, 1099, 1158, 1219, 1282, 1347, 1414, 1483, 1554, 1627, 1702, 1779, 1858, 1939, 1041, 1097, 1155, 1215, 1277, 1341, 1407, 1475, 1545, 1617, 1691, 1767, 1845, 1925, 2007, 1154, 1213, 1274, 1337, 1402, 1469, 1538, 1609, 1682, 1757, 1834, 1913, 1994, 2077, 1273, 1335, 1399, 1465, 1533, 1603, 1675, 1749, 1825, 1903, 1983, 2065, 2149, 1398, 1463, 1530, 1599, 1670, 1743, 1818, 1895, 1974, 2055, 2138, 2223, 1529, 1597, 1667, 1739, 1813, 1889, 1967, 2047, 2129, 2213, 2299, 1666, 1737, 1810, 1885, 1962, 2041, 2122, 2205, 2290, 2377, 1809, 1883, 1959, 2037, 2117, 2199, 2283, 2369, 2457, 1958, 2035, 2114, 2195, 2278, 2363, 2450, 2539, 2113, 2193, 2275, 2359, 2445, 2533, 2623, 2274, 2357, 2442, 2529, 2618, 2709, 2441, 2527, 2615, 2705, 2797, 2614, 2703, 2794, 2887, 2793, 2885, 2979, 2978, 3073, 3169, 384, 417, 452, 489, 528, 569, 612, 657, 704, 753, 804, 857, 912, 969, 1028, 1089, 1152, 1217, 1284, 1353, 1424, 1497,     1572, 451, 487, 525, 565, 607, 651, 697, 745, 795, 847, 901, 957, 1015, 1075, 1137, 1201, 1267, 1335, 1405, 1477, 1551, 1627, 524, 563, 604, 647, 692, 739, 788, 839, 892, 947, 1004, 1063, 1124, 1187, 1252, 1319, 1388, 1459, 1532, 1607, 1684, 603, 645, 689, 735, 783, 833, 885, 939, 995, 1053, 1113, 1175, 1239, 1305, 1373, 1443, 1515, 1589, 1665, 1743, 688, 733, 780, 829, 880, 933, 988, 1045, 1104, 1165, 1228, 1293, 1360, 1429, 1500, 1573, 1648, 1725, 1804, 779, 827, 877, 929, 983, 1039, 1097, 1157, 1219, 1283, 1349, 1417, 1487, 1559, 1633, 1709, 1787, 1867, 876, 927, 980, 1035, 1092, 1151, 1212,     1275, 1340, 1407, 1476, 1547, 1620, 1695, 1772, 1851, 1932, 979, 1033, 1089, 1147, 1207, 1269, 1333, 1399, 1467, 1537, 1609, 1683, 1759, 1837, 1917, 1999, 1088, 1145, 1204, 1265, 1328, 1393, 1460, 1529, 1600, 1673, 1748, 1825, 1904, 1985, 2068, 1203, 1263, 1325, 1389, 1455, 1523, 1593, 1665, 1739, 1815, 1893, 1973, 2055, 2139, 1324, 1387, 1452, 1519, 1588, 1659, 1732, 1807, 1884, 1963, 2044, 2127, 2212, 1451, 1517, 1585, 1655, 1727, 1801, 1877, 1955, 2035, 2117, 2201, 2287, 1584, 1653, 1724, 1797, 1872, 1949, 2028, 2109, 2192, 2277, 2364, 1723, 1795, 1869, 1945, 2023, 2103, 2185, 2269, 2355, 2443, 1868, 1943, 2020, 2099, 2180, 2263, 2348, 2435, 2524, 2019, 2097, 2177, 2259, 2343, 2429, 2517, 2607, 2176, 2257, 2340, 2425, 2512, 2601, 2692, 2339, 2423, 2509, 2597, 2687, 2779, 2508, 2595, 2684, 2775, 2868, 2683, 2773, 2865, 2959, 2864, 2957, 3052, 3051, 3147, 3244, 486, 523, 562, 603, 646, 691, 738, 787, 838, 891, 946, 1003, 1062, 1123, 1186, 1251, 1318, 1387, 1458, 1531, 1606, 1683, 561, 601, 643, 687, 733, 781, 831, 883, 937, 993, 1051, 1111, 1173, 1237, 1303, 1371, 1441, 1513, 1587, 1663, 1741, 642, 685, 730, 777, 826, 877, 930, 985, 1042, 1101, 1162, 1225, 1290, 1357, 1426, 1497, 1570, 1645, 1722, 1801, 729, 775, 823, 873, 925, 979, 1035, 1093, 1153, 1215, 1279, 1345, 1413, 1483, 1555, 1629, 1705, 1783, 1863, 822, 871, 922, 975, 1030, 1087, 1146, 1207,     1270, 1335, 1402, 1471, 1542, 1615, 1690, 1767, 1846, 1927, 921, 973, 1027, 1083, 1141, 1201, 1263, 1327, 1393, 1461, 1531, 1603, 1677, 1753, 1831, 1911, 1993, 1026, 1081, 1138, 1197, 1258, 1321, 1386, 1453, 1522, 1593, 1666, 1741, 1818, 1897, 1978, 2061, 1137, 1195, 1255, 1317, 1381, 1447, 1515, 1585, 1657, 1731, 1807, 1885, 1965, 2047, 2131, 1254, 1315, 1378, 1443, 1510, 1579, 1650, 1723, 1798, 1875, 1954, 2035, 2118, 2203, 1377, 1441, 1507, 1575, 1645, 1717, 1791, 1867, 1945, 2025, 2107, 2191, 2277, 1506, 1573, 1642, 1713, 1786, 1861, 1938, 2017, 2098, 2181, 2266, 2353, 1641, 1711, 1783, 1857, 1933, 2011, 2091, 2173, 2257, 2343, 2431, 1782, 1855, 1930, 2007, 2086, 2167, 2250, 2335, 2422, 2511, 1929, 2005, 2083, 2163, 2245, 2329, 2415, 2503, 2593, 2082, 2161, 2242, 2325, 2410, 2497, 2586, 2677, 2241, 2323, 2407, 2493, 2581, 2671, 2763, 2406, 2491, 2578, 2667, 2758, 2851, 2577, 2665, 2755, 2847, 2941, 2754, 2845, 2938, 3033, 2937,
     3031, 3127, 3126, 3223, 3321, 600, 641, 684, 729, 776, 825, 876, 929, 984, 1041, 1100, 1161, 1224, 1289, 1356, 1425, 1496, 1569, 1644, 1721, 1800, 683, 727, 773, 821, 871,     923, 977, 1033, 1091, 1151, 1213, 1277, 1343, 1411, 1481, 1553, 1627, 1703, 1781, 1861, 772, 819, 868, 919, 972, 1027, 1084, 1143, 1204, 1267, 1332, 1399, 1468, 1539, 1612, 1687, 1764, 1843, 1924, 867, 917, 969, 1023, 1079, 1137, 1197, 1259, 1323, 1389, 1457, 1527, 1599, 1673, 1749, 1827, 1907, 1989, 968, 1021, 1076, 1133, 1192, 1253, 1316, 1381, 1448, 1517, 1588, 1661, 1736, 1813, 1892, 1973, 2056, 1075, 1131, 1189, 1249, 1311, 1375, 1441, 1509, 1579, 1651, 1725, 1801, 1879, 1959, 2041, 2125, 1188, 1247, 1308, 1371, 1436, 1503, 1572, 1643, 1716, 1791, 1868, 1947, 2028, 2111, 2196, 1307, 1369, 1433, 1499, 1567, 1637, 1709, 1783, 1859, 1937, 2017, 2099, 2183, 2269, 1432, 1497, 1564, 1633, 1704, 1777, 1852, 1929, 2008, 2089, 2172, 2257, 2344, 1563, 1631, 1701, 1773, 1847, 1923, 2001, 2081, 2163, 2247, 2333, 2421, 1700, 1771, 1844, 1919, 1996, 2075, 2156, 2239, 2324, 2411, 2500, 1843, 1917, 1993, 2071, 2151, 2233, 2317, 2403, 2491, 2581, 1992, 2069, 2148, 2229, 2312, 2397, 2484, 2573, 2664, 2147, 2227, 2309, 2393, 2479, 2567, 2657, 2749, 2308, 2391, 2476, 2563, 2652, 2743, 2836, 2475, 2561, 2649, 2739, 2831, 2925, 2648, 2737, 2828, 2921, 3016, 2827, 2919, 3013, 3109, 3012, 3107, 3204, 3203, 3301, 3400, 726, 771, 818, 867, 918, 971, 1026, 1083, 1142, 1203, 1266, 1331, 1398, 1467, 1538, 1611, 1686, 1763, 1842, 1923, 817, 865, 915, 967, 1021, 1077, 1135, 1195, 1257, 1321, 1387, 1455, 1525, 1597, 1671, 1747, 1825, 1905, 1987, 914, 965, 1018, 1073, 1130, 1189, 1250, 1313, 1378, 1445, 1514, 1585, 1658, 1733, 1810, 1889, 1970, 2053, 1017, 1071, 1127, 1185, 1245, 1307, 1371, 1437, 1505, 1575, 1647, 1721, 1797, 1875, 1955, 2037, 2121, 1126, 1183, 1242, 1303, 1366, 1431, 1498, 1567, 1638, 1711, 1786, 1863, 1942, 2023, 2106, 2191, 1241, 1301, 1363, 1427, 1493, 1561, 1631, 1703, 1777, 1853, 1931, 2011, 2093, 2177, 2263, 1362, 1425, 1490, 1557, 1626, 1697, 1770, 1845, 1922, 2001, 2082, 2165, 2250, 2337, 1489, 1555, 1623, 1693, 1765, 1839, 1915, 1993, 2073, 2155, 2239, 2325, 2413, 1622, 1691, 1762, 1835, 1910, 1987, 2066, 2147, 2230, 2315, 2402, 2491, 1761, 1833, 1907, 1983, 2061, 2141, 2223, 2307, 2393, 2481, 2571, 1906, 1981, 2058, 2137, 2218, 2301, 2386, 2473, 2562, 2653, 2057, 2135, 2215, 2297, 2381, 2467, 2555, 2645, 2737, 2214, 2295, 2378, 2463, 2550, 2639, 2730, 2823, 2377, 2461, 2547, 2635, 2725, 2817, 2911, 2546, 2633, 2722, 2813, 2906, 3001, 2721, 2811, 2903, 2997, 3093, 2902, 2995, 3090, 3187, 3089, 3185, 3283, 3282, 3381, 3481, 864, 913, 964, 1017, 1072,
     1129, 1188, 1249, 1312, 1377, 1444, 1513, 1584, 1657, 1732, 1809, 1888, 1969, 2052, 963, 1015, 1069, 1125, 1183, 1243, 1305, 1369, 1435, 1503, 1573, 1645, 1719, 1795, 1873, 1953, 2035, 2119, 1068, 1123, 1180, 1239, 1300, 1363, 1428, 1495, 1564, 1635, 1708, 1783, 1860, 1939, 2020, 2103, 2188, 1179, 1237, 1297, 1359, 1423, 1489, 1557, 1627, 1699, 1773, 1849, 1927, 2007, 2089, 2173, 2259, 1296, 1357, 1420, 1485, 1552, 1621, 1692, 1765, 1840, 1917, 1996, 2077, 2160, 2245, 2332, 1419, 1483, 1549, 1617, 1687, 1759, 1833, 1909, 1987, 2067, 2149, 2233, 2319, 2407, 1548, 1615, 1684, 1755, 1828, 1903, 1980, 2059, 2140, 2223, 2308, 2395, 2484, 1683, 1753, 1825, 1899, 1975, 2053, 2133, 2215, 2299, 2385, 2473, 2563, 1824, 1897, 1972, 2049, 2128, 2209, 2292, 2377, 2464, 2553, 2644, 1971, 2047, 2125, 2205, 2287, 2371, 2457, 2545, 2635, 2727, 2124, 2203, 2284, 2367, 2452, 2539, 2628, 2719, 2812, 2283, 2365, 2449, 2535, 2623, 2713, 2805, 2899, 2448, 2533, 2620, 2709, 2800, 2893, 2988, 2619, 2707, 2797, 2889, 2983, 3079, 2796, 2887, 2980, 3075, 3172, 2979, 3073, 3169, 3267, 3168, 3265, 3364, 3363, 3463, 3564, 1014, 1067, 1122, 1179, 1238, 1299, 1362, 1427, 1494, 1563, 1634, 1707, 1782, 1859, 1938, 2019, 2102, 2187, 1121, 1177, 1235, 1295, 1357, 1421, 1487, 1555, 1625, 1697, 1771, 1847, 1925, 2005, 2087, 2171, 2257, 1234, 1293, 1354, 1417, 1482, 1549, 1618, 1689, 1762, 1837, 1914, 1993, 2074, 2157, 2242, 2329, 1353, 1415, 1479, 1545, 1613, 1683, 1755, 1829, 1905, 1983, 2063, 2145, 2229, 2315, 2403, 1478, 1543, 1610, 1679, 1750, 1823, 1898, 1975, 2054, 2135, 2218, 2303, 2390, 2479, 1609, 1677, 1747, 1819, 1893, 1969, 2047, 2127, 2209, 2293, 2379, 2467, 2557, 1746, 1817, 1890, 1965, 2042, 2121, 2202, 2285, 2370, 2457, 2546, 2637, 1889, 1963, 2039, 2117, 2197, 2279, 2363, 2449, 2537, 2627, 2719, 2038, 2115, 2194, 2275, 2358, 2443, 2530, 2619, 2710, 2803, 2193, 2273, 2355, 2439, 2525, 2613, 2703, 2795, 2889, 2354, 2437, 2522, 2609, 2698, 2789, 2882, 2977, 2521, 2607, 2695, 2785, 2877, 2971, 3067, 2694, 2783, 2874, 2967, 3062, 3159, 2873, 2965, 3059, 3155, 3253, 3058, 3153, 3250, 3349, 3249, 3347, 3447, 3446, 3547, 3649, 1176, 1233, 1292, 1353, 1416, 1481, 1548, 1617, 1688, 1761, 1836, 1913, 1992, 2073, 2156, 2241, 2328, 1291, 1351, 1413, 1477, 1543, 1611, 1681, 1753, 1827, 1903, 1981, 2061, 2143, 2227, 2313, 2401, 1412, 1475, 1540, 1607, 1676, 1747, 1820, 1895, 1972, 2051, 2132, 2215, 2300, 2387, 2476, 1539, 1605, 1673, 1743, 1815, 1889, 1965, 2043, 2123, 2205, 2289, 2375, 2463, 2553, 1672, 1741, 1812, 1885, 1960, 2037, 2116, 2197, 2280, 2365, 2452, 2541, 2632, 1811, 1883, 1957, 2033, 2111, 2191, 2273, 2357, 2443, 2531, 2621, 2713, 1956, 2031, 2108, 2187, 2268, 2351, 2436, 2523, 2612, 2703, 2796, 2107, 2185, 2265, 2347, 2431, 2517, 2605, 2695, 2787, 2881, 2264, 2345, 2428, 2513, 2600, 2689, 2780, 2873, 2968, 2427, 2511, 2597, 2685, 2775, 2867, 2961, 3057, 2596, 2683, 2772, 2863, 2956, 3051, 3148, 2771, 2861, 2953, 3047, 3143, 3241, 2952, 3045, 3140, 3237, 3336, 3139, 3235, 3333, 3433, 3332, 3431, 3532, 3531, 3633, 3736, 1350, 1411, 1474, 1539, 1606, 1675, 1746, 1819, 1894, 1971, 2050, 2131, 2214, 2299, 2386, 2475, 1473, 1537, 1603, 1671, 1741, 1813, 1887, 1963, 2041, 2121, 2203, 2287, 2373, 2461, 2551, 1602, 1669, 1738, 1809, 1882, 1957, 2034, 2113, 2194, 2277, 2362, 2449, 2538, 2629, 1737, 1807, 1879, 1953, 2029, 2107, 2187, 2269, 2353, 2439, 2527, 2617, 2709, 1878, 1951, 2026, 2103, 2182, 2263, 2346, 2431, 2518, 2607, 2698, 2791, 2025, 2101, 2179, 2259, 2341, 2425, 2511, 2599, 2689, 2781, 2875, 2178, 2257, 2338, 2421, 2506, 2593, 2682, 2773, 2866, 2961, 2337, 2419, 2503, 2589, 2677, 2767, 2859, 2953, 3049, 2502, 2587, 2674, 2763, 2854, 2947, 3042, 3139, 2673, 2761, 2851, 2943, 3037, 3133, 3231, 2850, 2941, 3034, 3129, 3226, 3325, 3033, 3127, 3223, 3321, 3421, 3222, 3319, 3418, 3519, 3417, 3517, 3619, 3618, 3721, 3825, 1536, 1601, 1668, 1737, 1808, 1881, 1956, 2033, 2112, 2193, 2276, 2361, 2448, 2537, 2628, 1667, 1735, 1805, 1877, 1951, 2027, 2105, 2185, 2267, 2351, 2437, 2525, 2615, 2707, 1804, 1875, 1948, 2023, 2100, 2179, 2260, 2343, 2428, 2515, 2604, 2695, 2788, 1947, 2021, 2097, 2175, 2255, 2337, 2421, 2507, 2595, 2685, 2777, 2871, 2096, 2173, 2252, 2333, 2416, 2501, 2588, 2677, 2768, 2861, 2956, 2251, 2331, 2413, 2497, 2583, 2671, 2761, 2853, 2947, 3043, 2412, 2495, 2580, 2667, 2756, 2847, 2940, 3035, 3132, 2579, 2665, 2753, 2843, 2935, 3029, 3125, 3223, 2752, 2841, 2932, 3025, 3120, 3217, 3316, 2931, 3023, 3117, 3213, 3311, 3411, 3116, 3211, 3308, 3407, 3508, 3307, 3405, 3505, 3607, 3504, 3605, 3708, 3707, 3811, 3916, 1734, 1803, 1874, 1947, 2022, 2099, 2178, 2259, 2342, 2427, 2514, 2603, 2694, 2787, 1873, 1945, 2019, 2095, 2173, 2253, 2335, 2419, 2505, 2593, 2683, 2775, 2869, 2018, 2093, 2170, 2249, 2330, 2413, 2498, 2585, 2674, 2765, 2858, 2953, 2169, 2247, 2327, 2409, 2493, 2579, 2667, 2757, 2849, 2943, 3039, 2326, 2407, 2490, 2575, 2662, 2751, 2842, 2935, 3030, 3127, 2489, 2573, 2659, 2747, 2837, 2929, 3023, 3119, 3217, 2658, 2745, 2834, 2925, 3018, 3113, 3210, 3309, 2833, 2923, 3015, 3109, 3205, 3303, 3403, 3014, 3107, 3202, 3299, 3398, 3499, 3201, 3297, 3395, 3495, 3597, 3394, 3493, 3594, 3697, 3593, 3695, 3799, 3798, 3903, 4009, 1944, 2017, 2092, 2169, 2248, 2329, 2412, 2497, 2584, 2673, 2764, 2857, 2952, 2091, 2167, 2245, 2325, 2407, 2491, 2577, 2665, 2755, 2847, 2941, 3037, 2244, 2323, 2404, 2487, 2572, 2659, 2748, 2839, 2932, 3027, 3124, 2403, 2485, 2569, 2655, 2743, 2833, 2925, 3019, 3115, 3213, 2568, 2653, 2740, 2829, 2920, 3013, 3108, 3205, 3304, 2739, 2827, 2917, 3009, 3103, 3199, 3297, 3397, 2916, 3007, 3100, 3195, 3292, 3391, 3492, 3099, 3193, 3289, 3387, 3487, 3589, 3288, 3385, 3484, 3585, 3688, 3483, 3583, 3685, 3789, 3684, 3787, 3892, 3891, 3997, 4104, 2166, 2243, 2322, 2403, 2486, 2571, 2658, 2747, 2838, 2931, 3026, 3123, 2321, 2401, 2483, 2567, 2653, 2741, 2831, 2923, 3017, 3113, 3211, 2482, 2565, 2650, 2737, 2826, 2917, 3010, 3105, 3202, 3301, 2649, 2735, 2823, 2913, 3005, 3099, 3195, 3293, 3393, 2822, 2911, 3002, 3095, 3190, 3287, 3386, 3487, 3001, 3093, 3187, 3283, 3381, 3481, 3583, 3186, 3281, 3378, 3477, 3578, 3681, 3377, 3475, 3575, 3677, 3781, 3574, 3675, 3778, 3883, 3777, 3881, 3987, 3986, 4093, 4201, 2400, 2481, 2564, 2649, 2736, 2825, 2916, 3009, 3104, 3201, 3300, 2563, 2647, 2733, 2821, 2911, 3003, 3097, 3193, 3291, 3391, 2732, 2819, 2908, 2999, 3092, 3187, 3284, 3383, 3484, 2907, 2997, 3089, 3183, 3279, 3377, 3477, 3579, 3088, 3181, 3276, 3373, 3472, 3573, 3676, 3275, 3371, 3469, 3569, 3671, 3775, 3468, 3567, 3668, 3771, 3876, 3667, 3769, 3873, 3979, 3872, 3977, 4084, 4083, 4191, 4300, 2646, 2731, 2818, 2907, 2998, 3091, 3186, 3283, 3382, 3483, 2817, 2905, 2995, 3087, 3181, 3277, 3375, 3475, 3577, 2994, 3085, 3178, 3273, 3370, 3469, 3570, 3673, 3177, 3271, 3367, 3465, 3565, 3667, 3771, 3366, 3463, 3562, 3663, 3766, 3871, 3561, 3661, 3763, 3867, 3973, 3762, 3865, 3970, 4077, 3969, 4075, 4183, 4182, 4291, 4401, 2904, 2993, 3084, 3177, 3272, 3369, 3468, 3569, 3672, 3083, 3175, 3269, 3365, 3463, 3563, 3665, 3769, 3268, 3363, 3460, 3559, 3660, 3763, 3868, 3459, 3557, 3657, 3759, 3863, 3969, 3656, 3757, 3860, 3965, 4072, 3859, 3963, 4069, 4177, 4068, 4175, 4284, 4283, 4393, 4504, 3174, 3267, 3362, 3459, 3558, 3659, 3762, 3867, 3361, 3457, 3555, 3655, 3757, 3861, 3967, 3554, 3653, 3754, 3857, 3962, 4069, 3753, 3855, 3959, 4065, 4173, 3958, 4063, 4170, 4279, 4169, 4277, 4387, 4386, 4497, 4609, 3456, 3553, 3652, 3753, 3856, 3961, 4068, 3651, 3751, 3853, 3957, 4063, 4171, 3852, 3955, 4060, 4167, 4276, 4059, 4165, 4273, 4383, 4272, 4381, 4492, 4491, 4603, 4716, 3750, 3851, 3954, 4059, 4166, 4275, 3953, 4057, 4163, 4271, 4381, 4162, 4269, 4378, 4489, 4377, 4487, 4599, 4598, 4711, 4825, 4056, 4161, 4268, 4377, 4488, 4267, 4375, 4485, 4597, 4484, 4595, 4708, 4707, 4821, 4936, 4374, 4483, 4594, 4707, 4593, 4705, 4819, 4818, 4933, 5049, 4704, 4817, 4932, 4931, 5047, 5164, 5046, 5163, 5281, 5400]


def check(x, y, z, n):
    if n in a:
        return True
    return False


def asdasd(x, y, z):
    return x*x+y*y+z*z+x*y+y*z+z*x


for x in range(n):
    count = 0
    if x in a:
        print(a.count(x)*3)
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
N=int(input())
def sq(n):
    c=0
    A=[0 for j in range(n+1)]
    for i in range(n//2):
        p=(i+1)**2
        if p>n:
            for j in range(i**2,n+1):
                A[j]=i
            break
        else:
            for j in range(i**2,p):
                A[j]=i
    return A
A=sq(N)
print(A)
for n in range(1,N+1):
    c=0
    for x in range(1,A[n]):
        p=n-x**2
        if p<0:
            break
        else:
            for y in range(1,A[p]+1):
                q=n-x**2-y**2-x*y
                if q<0:
                    break
                else:
                    for z in range(1,A[q]+1):
                        if n==x**2+y**2+z**2+x*y+y*z+z*x:
                            c=c+1
    print(c)

Submission status: Wrong Answer

Solution code:
import math
N = int(input()) + 1
Nroot = int(math.pow(N,1/3)) + 1
for n in range(1,N):
    count = 0
    if n >= 6:
#        print(Nroot, int(math.pow(n,1/3))-1)
        for x in range(Nroot, int(math.pow(n,1/3))-1 , -1):
            for y in range(x,0,-1):
                if (x+2*y)**2 < n:
                    break
                for z in range(1,y+1):
#                    print((x + y + z)**2 - (x*y + y*z + z*x), n,x,y,z)
#                    print(x,y,z)
                    formula = (x + y + z)**2 - (x*y + y*z + z*x)
                    if formula == n:
                        if x == y and y == z:
                            count += 1
                        else:
                            count += 3
                        break

        print(count)
    else:
        print("0")