OFFSET
1,1
EXAMPLE
a(3) = 216 because the continued fraction of sqrt(216) has periodic part [14; 1, 2, 3, 2, 1, 28] and this is the least number with this property.
PROG
(Python)
from itertools import count
from sympy.ntheory.continued_fraction import continued_fraction_reduce
def A351139(n):
if n == 2:
return 14
for r in count(1):
if (k := continued_fraction_reduce([r, list(range(1, n+1))+list(range(n-1, 0, -1))+[2*r]])**2).is_integer:
return k # Chai Wah Wu, Feb 09 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Giorgos Kalogeropoulos, Feb 02 2022
STATUS
approved