OFFSET
1,2
COMMENTS
Observation (checked up to a(52)): a(n) = A266257(n) for n >= 2.
Conjectures in formula section hold for 2<=n<=300. - Chai Wah Wu, Oct 05 2023
FORMULA
Conjectures (see also A266257): (Start)
a(1) = 1, a(n) = ((n + 1)^2 - (-1)^n*(n - 1))/2 for n >= 2.
a(1) = 1, a(2) = 4, a(3) = 9, a(4) = 11, a(5) = 20, a(6) = 22, a(n) = a(n - 1) + 2*a(n - 2) - 2*a(n - 3) - a(n - 4) + a(n - 5) for n >= 7.
G.f.: (1 + x + 3*x^3 - x^4)/((1 - x)^3*(1 + x)^2). (End)
EXAMPLE
a(1) = 1 since the equation x^2 = 0 belonging to A365876(1) has the integer solution 0. 1 is the 1st term that includes at least one equation with at least one integer solution.
a(2) = 4 since the equation 2*x^2 + x - 1 = 0 belonging to A365876(4) has the integer solution -1. 4 is the 2nd term that includes at least one equation with at least one integer solution.
a(3) = 9 since the equation -x^2 + 4*x - 1 = 0 belonging to A365876(9) has the integer solution 2. 9 is the 3rd term that includes at least one equation with at least one integer solution.
a(4) = 11 since the equation 3*x^2 + 4*x - 4 = 0 belonging to A365876(11) has the integer solution -2. 11 is the 4th term that includes at least one equation with at least one integer solution.
MAPLE
A365892 := proc(n_A365876) local u, v, a, min, x_1, x_2; u := n_A365876; v := 0; a := false; min := true; while min = true do if u <> 0 and gcd(u, v) = 1 then x_1 := 1/2*(-v + sqrt(v^2 + 4*v*u))/u; x_2 := 1/2*(-v - sqrt(v^2 + 4*v*u))/u; if x_1 = floor(x_1) or x_2 = floor(x_2) then a := true; end if; end if; u := u - 2; v := 1/2*n_A365876 - 1/2*abs(u); if u < -1/9*n_A365876 then min := false; end if; end do; if a = true then return n_A365876; end if; end proc; seq(A365892(n_A365876), n_A365876 = 1 .. 1486);
PROG
(Python)
from math import gcd
from itertools import count, islice
from sympy import integer_nthroot
def A365892_gen(startvalue=1): # generator of terms >= startvalue
for n in count(max(startvalue, 1)):
if n == 1:
yield 1
else:
for v in range(1, n+1>>1):
u = n-(v<<1)
if gcd(u, v)==1:
v2, u2, a = v*v, v*(u<<2), u<<1
if v2+u2 >= 0:
d, r = integer_nthroot(v2+u2, 2)
if r and not ((d+v)%a and (d-v)%a):
yield n
break
if v2-u2 >= 0:
d, r = integer_nthroot(v2-u2, 2)
if r and not ((d+v)%a and (d-v)%a):
yield n
break
CROSSREFS
KEYWORD
nonn
AUTHOR
Felix Huber, Sep 22 2023
STATUS
approved