Python 3.3 vs. MSDOS Basic

Ian Kelly ian.g.kelly at gmail.com
Wed Feb 20 02:04:53 CET 2013


On Tue, Feb 19, 2013 at 5:23 PM, Alexander Blinne <news at blinne.net> wrote:
> If changed into
>
> signed int n;
>
> there is a veeery long, perhaps infinite loop.

Yes, infinite.  Here's the first such sequence encountered with a
signed 32-bit int.

[113383, 340150, 170075, 510226, 255113, 765340, 382670, 191335,
574006, 287003, 861010, 430505, 1291516, 645758, 322879, 968638,
484319, 1452958, 726479, 2179438, 1089719, 3269158, 1634579, 4903738,
2451869, 7355608, 3677804, 1838902, 919451, 2758354, 1379177, 4137532,
2068766, 1034383, 3103150, 1551575, 4654726, 2327363, 6982090,
3491045, 10473136, 5236568, 2618284, 1309142, 654571, 1963714, 981857,
2945572, 1472786, 736393, 2209180, 1104590, 552295, 1656886, 828443,
2485330, 1242665, 3727996, 1863998, 931999, 2795998, 1397999, 4193998,
2096999, 6290998, 3145499, 9436498, 4718249, 14154748, 7077374,
3538687, 10616062, 5308031, 15924094, 7962047, 23886142, 11943071,
35829214, 17914607, 53743822, 26871911, 80615734, 40307867, 120923602,
60461801, 181385404, 90692702, 45346351, 136039054, 68019527,
204058582, 102029291, 306087874, 153043937, 459131812, 229565906,
114782953, 344348860, 172174430, 86087215, 258261646, 129130823,
387392470, 193696235, 581088706, 290544353, 871633060, 435816530,
217908265, 653724796, 326862398, 163431199, 490293598, 245146799,
735440398, 367720199, 1103160598, 551580299, 1654740898, 827370449,
-1812855948, -906427974, -453213987, -1359641960, -679820980,
-339910490, -169955245, -509865734, -254932867, -764798600,
-382399300, -191199650, -95599825, -286799474, -143399737, -430199210,
-215099605, -645298814, -322649407, -967948220, -483974110,
-241987055, -725961164, -362980582, -181490291, -544470872,
-272235436, -136117718, -68058859, -204176576, -102088288, -51044144,
-25522072, -12761036, -6380518, -3190259, -9570776, -4785388,
-2392694, -1196347, -3589040, -1794520, -897260, -448630, -224315,
-672944, -336472, -168236, -84118, -42059, -126176, -63088, -31544,
-15772, -7886, -3943, -11828, -5914, -2957, -8870, -4435, -13304,
-6652, -3326, -1663, -4988, -2494, -1247, -3740, -1870, -935, -2804,
-1402, -701, -2102, -1051, -3152, -1576, -788, -394, -197, -590, -295,
-884, -442, -221, -662, -331, -992, -496, -248, -124, -62, -31, -92,
-46, -23, -68, -34, -17, -50, -25, -74, -37, -110, -55, -164, -82,
-41, -122, -61, -182, -91, -272, -136, -68, ...]



More information about the Python-list mailing list