Peter de Rivaz has authored 2 sequences.
A159345
a(n) is the number of digits in the decimal expansion of Pi needed to contain a repeated n-digit substring.
Original entry on oeis.org
3, 22, 63, 135, 555, 1301, 4607, 15441, 33852, 240488, 694409, 857993, 5563724, 9289707, 28048931, 129440103, 262527982, 1982424660, 8858170624, 17601613331
Offset: 1
We need 3 digits (141) to find the first digit to repeat (the repeated digit is 1).
We need 22 digits (1415926535897932384626) to find the first 2 digit repeat (the repeated 2-digit substring is 26).
A197123
a(n) is the first n-digit substring to repeat in the decimal expansion of Pi.
Original entry on oeis.org
1, 26, 592, 582, 60943, 949129, 8530614, 52637962, 201890888, 4392366484, 89879780761, 756130190263, 3186120489507, 18220874234996, 276854551127715, 8230687217052243, 93415455347042966, 13724950651727463, 1350168131352524443, 84756845106452435773, 585270898631522188621, 2761994111668451704865, 64722721994615606186022, 307680366924568801265656
Offset: 1
For n=2 the a(2)=26 solution is because if we look at all the 2-digit substrings 14,41,15,59,92,26,... of the decimal expansion of Pi=3.1415926535897932384626 we find that the first 2-digit substring to appear twice is 26.
From _Bobby Jacobs_, Dec 24 2016: (Start)
1 appears at positions 1 and 3.
26 appears at positions 6 and 21.
592 appears at positions 4 and 61.
0582 appears at positions 50 and 132.
60943 appears at positions 397 and 551.
949129 appears at positions 496 and 1296.
8530614 appears at positions 4167 and 4601.
... (End)
-
# download https://stuff.mit.edu/afs/sipb/contrib/pi/pi-billion.txt, then
# with open('pi-billion.txt', 'r') as f: digits_of_pi = f.readline()
from sympy import S; digits_of_pi = str(S.Pi.n(3*10**5)) # alternatively
def a(n):
global digits_of_pi
seen = set()
for i in range(2, len(digits_of_pi)-n):
ss = digits_of_pi[i:i+n]
if ss in seen: return int(ss)
seen.add(ss)
for n in range(1, 11):
print(a(n), end=", ") # Michael S. Branicky, Jan 26 2021
Comments