OFFSET
0,1
COMMENTS
LINKS
Wikipedia, Somos Constant
EXAMPLE
PROG
(Python)
from itertools import count, islice
from fractions import Fraction
import os
def A380372_gen():
S = []
for n in count(1):
yield from (m:=S+[0]*(n-1)+[1])
S += m
def bin_to_frac_interval(binary_repr):
lower_bound, last_bit_id = 0, 0
for i, bit in enumerate(binary_repr, start=1):
if bit:
lower_bound += Fraction(1, 2**i)
last_bit_id = i
upper_bound = lower_bound + Fraction(1, 2**last_bit_id)
return lower_bound, upper_bound
n_binary_terms = 400
diff_bin = islice(A380372_gen(), n_binary_terms)
lower, upper = bin_to_frac_interval(diff_bin)
lower, upper = str(int(lower*10**(n_binary_terms//3))), str(int(upper*10**(n_binary_terms//3)))
A380373 = os.path.commonprefix([lower, upper])
CROSSREFS
KEYWORD
nonn,cons
AUTHOR
Jwalin Bhatt, Jan 23 2025
STATUS
approved