cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A383898 a(n) is the smallest nonnegative integer k such that n + k and n*k are squares, or -1 if there is no such number.

This page as a plain text file.
%I A383898 #37 May 24 2025 10:35:24
%S A383898 0,2,-1,0,20,-1,-1,8,0,90,-1,-1,4212,-1,-1,0,272,18,-1,5,-1,-1,-1,-1,
%T A383898 0,650,-1,-1,142100,-1,-1,32,-1,-1,-1,0,1332,-1,-1,360,41984,-1,-1,-1,
%U A383898 180,-1,-1,-1,0,50,-1,117,1755572,-1,-1,-1,-1,568458,-1,-1,53872730964
%N A383898 a(n) is the smallest nonnegative integer k such that n + k and n*k are squares, or -1 if there is no such number.
%C A383898 a(m^2) = 0, for all positive integers m.
%C A383898 If m is not in A245226 then a(m) = -1. Indeed, if (u, v) is the smallest solution of the equation x^2 - m*y^2 = m, then m + m*v^2 = u^2 and m*(m*v^2) = (m*v)^2. Therefore, a(m) = m*v^2.
%C A383898 The sequence A383734 contains the numbers k such that 2 + k and 2*k are squares, where A383734(2) = a(2). Similarly, A382209(1) = a(10).
%C A383898 a(181) <=  223502910856088814900 = 181*1111225770^2. - _Michel Marcus_, May 24 2025
%H A383898 Michel Marcus, <a href="/A383898/b383898.txt">Table of n, a(n) for n = 1..180</a>
%e A383898 If n = 5, then 20 satisfies that 5 + 20 = 5^2 and 5*20 = 10^2, where 20 is the smallest integer greater than 5 with this property. So, a(5) = 20.
%o A383898 (PARI) isok(m) = if (issquare(4*m), 1, #qfbsolve(Qfb(1, 0, -m), m, 2)); \\ A245226
%o A383898 a(n) = if (!isok(n), return(-1)); my(k=0); while (!(issquare(n+k) && issquare(n*k)), k++); k; \\ _Michel Marcus_, May 21 2025
%o A383898 (PARI) isok(m) = if (issquare(4*m), 1, #qfbsolve(Qfb(1, 0, -m), m, 2)); \\ A245226
%o A383898 a(n) = if (!isok(n), return(-1)); my(x = sqrtint(n)); while (! issquare(n*(x^2 - n)), x++); x^2-n; \\ _Michel Marcus_, May 24 2025
%Y A383898 Cf. A382209, A383734, A245226.
%K A383898 sign
%O A383898 1,2
%A A383898 _Gonzalo Martínez_, May 15 2025