login
A395625
a(n) = round(1/(b(n) - round(b(n)))), where b(n) = sqrt(k) + sqrt(m) + sqrt(p) with k = A395622(n) and positive nonsquare p < m < k minimizing the distance of b(n) from the nearest integer.
2
3, 10, 100, 458, 704, 54687, -65630, 211314, 269213, 949547, -3557326, 7118768, 43953137, -144740324, -496903629, -2621872032, -8321612088, -10478201880
OFFSET
1,1
COMMENTS
A395622 lists nonsquare values k for which {sqrt(k) + sqrt(m) + sqrt(p); 0 < p < m < k; m, p nonsquare} has smaller distance from the integers than for all smaller nonsquare k > m > p > 0. This sequence lists the inverse of that distance, rounded to the nearest integer, with minus sign whenever the closest sqrt(k) + sqrt(m) + sqrt(p) is to the left of the nearest integer.
EXAMPLE
The smallest triple of distinct positive nonsquare integers is (p, m, k) = (2, 3, 5), for which the sum of square roots is 5.38... at distance 0.38... from the nearest integer, so a(1) = round(1/0.38) = 3.
For (p, m, k) = (2, 5, 6), the sum of square roots is ~ 6.0998 at distance ~ 0.0998 from the nearest integer 6, so a(2) = round(1/0.0998) = 10.
A395621(2) = 5, the next larger nonsquare number k for which there exists a smaller positive nonsquare number m, namely 3), such that sqrt(5) + sqrt(3) = 3.968... is closer to the nearest integer than the previous sum sqrt(3)+sqrt(2); hence a(1) = round(1/(3.968... - 4)) = round(-1/0.03188...) = -31. The minus sign shows that sqrt(5) + sqrt(3) is to the left of the nearest integer, 4.
PROG
(PARI) A395625(n, k=A395622[n])={my(r=sqrt(k), b, d=oo); for(m=1, k-1, my(s=sqrt(m)+r); issquare(m)|| for(p=1, m-1, issquare(p)&& next; my(t=sqrt(p)+s); abs(t-round(t))<d && d=abs(t-round(b=t)))); 1\/(b-round(b))} \\ requires a predefined vector A395622 of initial values of that sequence; alternatively, A395622(n) can be otherwise specified as second (optional) argument, in which case the first argument (n) is ignored.
CROSSREFS
Cf. A395622, A395624 (the analog for A395621, sum of only two roots).
Sequence in context: A181079 A240512 A065924 * A013233 A013226 A013231
KEYWORD
sign,more
AUTHOR
M. F. Hasler, Jun 13 2026
STATUS
approved