login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A351139
a(n) is the least k such that the continued fraction for sqrt(k) has periodic part [r, 1, 2, ..., n-1, n, n-1, ..., 1, 2r] for some positive integer r.
1
3, 14, 216, 25185, 23287359, 1953082923, 81112983931776, 6667182474680388, 699567746120736710880, 855784807474766398870755, 51592564054278677032777194015, 1474855822717073602911008555048040, 23175672095781915301598668218548941215, 474577479777785868138090462593743556930231
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
Cf. A013646.
Sequence in context: A288555 A288563 A081383 * A001320 A133028 A144985
KEYWORD
nonn
AUTHOR
STATUS
approved