All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 In pi at last (Posted on 2014-03-24)
0, 68, 483, 6716, _____...

 No Solution Yet Submitted by Math Man No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 solution | Comment 2 of 3 |

The following program takes a file with one million digits of pi, downloaded from the internet, with spaces and blank lines removed, to find the last occurrence of novel 2-digit, 3-digit, 4-digit and 5-digit sequences.

CLS
OPEN "MILPI.TXT" FOR BINARY AS #1
db\$ = "  "
FOR bg = 3 TO 2000
GET #1, bg, db\$
n = VAL(db\$)
'    PRINT n;
lcn = bg
dbs\$ = db\$
END IF
NEXT
PRINT dbs\$, lcn: PRINT hadct: PRINT
trip\$ = "   "
FOR bg = 3 TO 200000
GET #1, bg, trip\$
n = VAL(trip\$)
'    PRINT n;
dbs\$ = trip\$
lcn = bg
END IF
NEXT
PRINT : PRINT dbs\$, lcn: PRINT hadct: PRINT
FOR bg = 3 TO 200000
'    PRINT n;
lcn = bg
END IF
NEXT
PRINT : PRINT dbs\$; lcn: PRINT hadct
'FOR i = 1 TO 10000: IF had(i) = 0 THEN PRINT i;
': NEXT
quint\$ = "     "
OPEN "had.txt" FOR BINARY AS #10
FOR bg = 3 TO 999994
GET #1, bg, quint\$
n = VAL(quint\$)
h\$ = " "
IF n <> 0 THEN
GET #10, n, h\$
IF h\$ <> "x" THEN
'      PRINT n;
h\$ = "x"
PUT #10, n, h\$
lcn = bg
dbs\$ = quint\$
END IF
END IF
NEXT
PRINT : PRINT dbs\$, lcn: PRINT hadct

It finds

68             607
100

483            8555
1000

6716          99848
10000

36748          967161
99991

Meaning:

68 was the last of the possible 100 2-digit sequences to be found, and it was found at location 607 (counting the 3 and the decimal point).

483 was the last of the possible 1000 3-digit sequences; found at locaton 8555.

6716 was the last of the possible 10000 4-digit sequences; found at locaton 99848.

At the next spot we hoped to find the next item in the sequence. However, 36748 was the last of only 99991 5-digit sequences to be found. There are 9 more, so the next item in sequence is one of those.

I had no luck in downloading any of the Googlable expansions of pi beyond a million digits, but Sloane's OEIS has the sequence: A032510: 0, 68, 483, 6716, 33394, 569540, 1075656, 36432643, 172484538, 5918289042, 56377726040, ... .

The blank can be filled with 33394.

I see from another OEIS sequence that I'd have needed 1369565 digits of pi to get my answer. My position numbering is different from that sequence as I count from the beginning of the found digits and they count to the end.

Edited on March 24, 2014, 10:40 am
 Posted by Charlie on 2014-03-24 10:35:18

 Search: Search body:
Forums (0)