998995 are the first six matching digits of #Phi and #Pi. The #Python script I call Phip_Matrix. Is there a pattern?
import decimal
# Set the precision very high to accommodate the calculation
decimal.getcontext().prec = 110
# Calculate Pi and Phi using the decimal module
PI = decimal.Decimal('3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679')
PHI = (decimal.Decimal(1) + decimal.Decimal(5).sqrt()) / 2
# Number of decimal digits to compare
num_digits = 50
# Convert both numbers to strings and extract the fractional part
pi_str = str(PI)[2:2 + num_digits] # Skip "3."
phi_str = str(PHI)[2:2 + num_digits] # Skip "1."
# ANSI escape codes for colors
YELLOW = "\033[93m"
RESET = "\033[0m"
# Print the results with alignment and highlight shared digits in yellow
print(f"{'Decimal of φ (phi)':<30}")
print(f"{'-' * num_digits}")
for i in range(0, num_digits, 10):
phi_segment = ''.join(
f"{YELLOW}{phi_str[i + j]}{RESET}" if phi_str[i + j] == pi_str[i + j] else f"{phi_str[i + j]}"
for j in range(min(10, num_digits - i))
)
print(f"{phi_segment:<30}")
print(f"\n{'Decimal of π (pi)':<30}")
print(f"{'-' * num_digits}")
for i in range(0, num_digits, 10):
pi_segment = ''.join(
f"{YELLOW}{pi_str[i + j]}{RESET}" if pi_str[i + j] == phi_str[i + j] else f"{pi_str[i + j]}"
for j in range(min(10, num_digits - i))
)
print(f"{pi_segment:<30}")
# Compare the decimal strings
if pi_str == phi_str:
print("\nThe decimal representations of π and φ are the same up to the specified number of digits.")
else:
print("\nThe decimal representations of π and φ differ.")