Sunday, October 10, 2004

Substrings of decimal expansions

Consider the first occurrence of a substring in the decimal expansions of all fraction a/b with 2<=b and and 1<=a<b, with fractions first sorted by b then by a, that is, 1/2, 1/3, 2/3, 1/4, 2/4, 3/4, ... For example, the substring "435" first occurs in the expansion of 14/39=.35897435897. Among three digit substrings, the last to occur are 999: 999/1000 = 0.999... (001,499): 1/501 = .0019960079840319361277445109780439121756487025948103792415169660678642714570858283433133732534930139720558882235528942115768463073852295409181636726546906187624750499... and then 998 (499/500), 002 (1/334), 997 (333/334), 249 (3/253), 667 (4/253), 003 (1/251), 498 (1/251), 501 (1/251), 749 (1/251), 332 (83/250), 996 (249/250), 799 (163/204), 334 (1/203), 399 (1/203), 599 (121/202), 199 (1/201), 004 (1/201), 665 (133/200), 995 (199/200). The last few interesting ones where the substring doesn't occur immediately after the decimal point are 499 as given above, and 249: 3/253 = .0118577075098814229249 667: 4/253 = .01581027667 (501,498,749): 1/251 = .00398406374501992031872509960159362549800796812749 (334,399): 1/203 = .0049261083743842364532019704433497536945812807881773399 Another interesting one: 197: 7/71 = .09859154929577464788732394366197 Complete 2 digit results. The number in parentheses is the number of digits after the decimal point the substring occurs. 00:1/2(2), 01:1/51(1), 02:1/34(1), 03:1/26(1), 04:1/21(1), 05:1/17(1), 06:1/15(1), 07:1/13(1), 08:1/12(1), 09:1/11(1), 10:1/10(1), 11:1/9(1), 12:1/8(1), 13:2/15(1), 14:1/7(1), 15:2/13(1), 16:1/6(1), 17:1/17(12), 18:2/11(1), 19:1/21(5), 20:1/5(1), 21:3/14(1), 22:2/9(1), 23:1/13(5), 24:6/25(1), 25:1/4(1), 26:4/15(1), 27:3/11(1), 28:1/7(3), 29:1/17(8), 30:3/10(1), 31:5/16(1), 32:8/25(1), 33:1/3(1), 34:1/23(3), 35:5/14(1), 36:4/11(1), 37:3/8(1), 38:2/13(3), 39:1/23(19), 40:2/5(1), 41:5/12(1), 42:1/7(2), 43:7/16(1), 44:4/9(1), 45:5/11(1), 46:2/13(5), 47:1/17(15), 48:12/25(1), 49:1/51(15), 50:1/2(1), 51:5/27(3), 52:1/17(7), 53:2/13(2), 54:5/11(2), 55:5/9(1), 56:9/16(1), 57:1/7(5), 58:7/12(1), 59:13/22(1), 60:3/5(1), 61:2/13(6), 62:5/8(1), 63:4/11(2), 64:9/14(1), 65:13/20(1), 66:2/3(1), 67:19/28(1), 68:11/16(1), 69:1/13(3), 70:7/10(1), 71:1/7(6), 72:3/11(2), 73:11/15(1), 74:2/27(2), 75:3/4(1), 76:1/13(2), 77:7/9(1), 78:11/14(1), 79:19/24(1), 80:4/5(1), 81:2/11(2), 82:1/17(4), 83:5/6(1), 84:2/13(4), 85:1/7(4), 86:13/15(1), 87:7/8(1), 88:8/9(1), 89:1/19(9), 90:9/10(1), 91:11/12(1), 92:1/13(4), 93:14/15(1), 94:1/17(9), 95:19/20(1), 96:24/25(1), 97:33/34(1), 98:49/50(1), 99:99/100(1) perl -nwae 'next if /no/;print "",($F[1]-1)*($F[3]-1), " $_"' r2 | sort -n

No comments :