OFFSET
1,1
COMMENTS
a(n) and n have the same parity.
If k is a term in A058529, gcd(k, a(k)) does not necessarily equal 1. For example, k = 217, 289, 343, 497, 529, 553, 679, 889, 961, 1127, ...
Conjecture: if gcd(k, a(k)) = 1, then k is a term in A058529.
Proof: if k is not in A058529, then k either is even or has a prime factor p == 3, 5 (mod 8). If k is even, then a(k) is also even, so 2 divides gcd(k, a(k)). If k has a prime factor p == 3, 5 (mod 8), then 2*m^2 == j^2 (mod p), 2^((p-1)/2)*m^(p-1) == -m^(p-1) == j^(p-1) (mod p), so m and j must both be multiples of p. As a result, p divides gcd(k, a(k)). - Jianing Song, Feb 09 2019
FORMULA
a(n) = sqrt((n^2 + A289398(n)^2)/2).
For positive integer k, a(2*k^2 - 1) = 2*k^2 + 2*k + 1.
a(n) <= 5*n.
a(k*n) = k*a(n) for all k not in A058529. - Jianing Song, Feb 15 2019
EXAMPLE
a(1) = 5 because 1^2, 5^2 and 7^2 are an arithmetic progression.
MATHEMATICA
Array[Block[{m = # + 2}, While[! IntegerQ@ Sqrt[2 m^2 - #^2], m += 2]; m] &, 58] (* Michael De Vlieger, Feb 15 2019 *)
PROG
(PARI) a(n) = {m=n+2; while(issquare(2*m^2-n^2)==0, m=m+2); m; }
CROSSREFS
KEYWORD
nonn
AUTHOR
Jinyuan Wang, Feb 08 2019
STATUS
approved