%I #16 Jan 05 2022 08:41:32
%S 3,24,8,0,3,8,24,3,0,8,48,24,15,120,8,3,15,168,80,48,3,24,360,15,0,24,
%T 440,8,120,80,120,195,3,840,24,8,35,960,440,3,168,120,168,28560,8,48,
%U 1680,35,0,48,24,120,483,175560,8,3,24,528,212520,728,63,3024
%N a(n) is the smallest k such that k + 1 and n*k + 1 both are perfect squares, or 0 if no such number exists.
%C a(4) = 0 as when k+1 is a square, 4k+4 is also a square; hence 4k+1 cannot be a square for k > 0.
%H David Wasserman, <a href="/A084702/b084702.txt">Table of n, a(n) for n = 1..100</a>
%F a(i^2-1) is usually (i-1)^2-1. For 2 < i < 1000 there are 34 exceptions. The first four of these are a(11^2-1) = 3, a(23^2-1) = 8, a(39^2-1) = 15 and a(41^2-1) = 3. - _David Wasserman_, May 03 2007
%e a(5) = 3 as 3 + 1 = 4 and 3*5 + 1 = 16 both are squares.
%t r[n_, c_] := Reduce[i>1 && j>1 && k+1 == i^2 && n*k+1 == j^2, {i,j,k}, Integers] /. C[1] -> c // Simplify;
%t a[n_] := If[rn = r[n,0] || r[n,1] || r[n,2]; rn === False, 0, k /. Solve[rn] // Min];
%t Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 1, 100}] (* _Jean-François Alcover_, May 12 2017 *)
%Y Cf. A084703.
%K nonn
%O 1,1
%A _Amarnath Murthy_, Jun 08 2003
%E More terms from Donald Sampson (marsquo(AT)hotmail.com), Dec 04 2003
%E Corrected by _David Wasserman_, May 03 2007