login
A338284
a(n) is the smallest nonsquare m such that the second partial quotient in the continued fraction for sqrt(m) equals n.
1
7, 2, 23, 5, 47, 10, 79, 17, 119, 26, 167, 37, 223, 50, 287, 65, 359, 82, 439, 101, 527, 122, 623, 145, 727, 170, 839, 197, 959, 226, 1087, 257, 1223, 290, 1367, 325, 1519, 362, 1679, 401, 1847, 442, 2023, 485, 2207, 530, 2399, 577, 2599, 626, 2807, 677, 3023, 730
OFFSET
1,1
LINKS
FORMULA
For even n, a(n) = A013945(n) = A002522(n/2) = (n/2)^2 + 1.
For odd n, a(n) = A073577((n+1)/2) = n^2 + 4*n + 2.
O.g.f.: (7 + 2*x + 2*x^2 - x^3 - x^4 + x^5) / ((1-x)^3 * (1+x)^3).
EXAMPLE
a(3) = 23, since sqrt(23) = [4; 1, 3, ...] and m=23 is the smallest integer such that sqrt(m) has with second partial quotient equal 3.
MATHEMATICA
CoefficientList[Series[(7 + 2*x + 2*x^2 - x^3 - x^4 + x^5) / ((1-x)^3 * (1+x)^3), {x, 0, 20}], x] (* Georg Fischer, Aug 18 2021 *)
CROSSREFS
Interweaving of A073577 and A002522.
Cf. A013945 (first partial quotient = n).
Sequence in context: A371214 A213836 A340801 * A269168 A279943 A279999
KEYWORD
nonn,easy
AUTHOR
Max Alekseyev, Oct 20 2020
STATUS
approved