OFFSET
1,1
COMMENTS
LINKS
M. F. Hasler, Table of n, a(n) for n = 1..1000
FORMULA
EXAMPLE
a( (2k)^2 ) <= k since (2k)^2(k^2-1)+1 = (2k^2-1)^2 (but k=1 is excluded since with k^2-1=0 this would be a trivial solution for any n).
MAPLE
A130280:=proc(n) local x, y, z; if n=1 then return 2 fi; isolve(n*(x^2-1)+1=y^2, z); select(has, `union`(%), x); map(rhs, %); simplify(eval(%, z=1) union eval(%, z=0)) minus {-1, 1}; if %={} then 0 else (min@op@map)(abs, %) fi end;
MATHEMATICA
$MaxExtraPrecision = 100;
r[n_, c_] := Reduce[k > 1 && j > 1 && n*(k^2 - 1) + 1 == j^2, {j, k}, Integers] /. C[1] -> c // Simplify;
a[n_] := If[rn = r[n, 0] || r[n, 1] || r[n, 2]; rn === False, 0, k /. {ToRules[rn]} // Min];
Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 1, 800}] (* Jean-François Alcover, May 12 2017 *)
PROG
(PARI) {A130280(n, L=10^15)=if(issquare(n), L=2+sqrtint(n>>2)); for( k=2, L, if( issquare(n*(k^2-1)+1), return(k)))}
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
M. F. Hasler, May 20 2007, May 25 2007
STATUS
approved