OFFSET
1,1
COMMENTS
For n >= 3, smallest prime of the form (x^y - 1/x^y)/(x - 1/x), where x = (sqrt(n+2) +/- sqrt(n-2))/2 and y is an odd positive integer, or -1 if no such prime exists.
When n=7, the sequence {s(k)} is A033890, which is Fibonacci(4i+2), and since x|y <=> F_x|F_y, and 2i+1|4i+2, A033890 is never prime, and so a(7) = -1. What is the proof for the other entries that are -1? Answer: See the Comments in A269254. - N. J. A. Sloane, Oct 22 2017
For detailed theory, see [Hone]. - L. Edson Jeffery, Feb 09 2018
LINKS
Hans Havermann, Table of n, a(n) for n = 1..300
C. K. Caldwell, Top Twenty page, Lehmer number
Andrew N. W. Hone, et al., On a family of sequences related to Chebyshev polynomials, arXiv:1802.01793 [math.NT], 2018.
Wikipedia, Lehmer number
FORMULA
If n is prime then a(n-1) = n.
MATHEMATICA
terms = 172;
kmax = 120;
a[n_] := Module[{s, k}, s[k_] := s[k] = n s[k-1] - s[k-2]; s[0] = 1; s[1] = n+1; For[k = 1, k <= kmax, k++, If[PrimeQ[s[k]], Return[s[k]]]]];
Array[a, terms] /. Null -> -1 (* Jean-François Alcover, Aug 30 2018 *)
PROG
(Magma) lst:=[]; for n in [1..49] do if n gt 2 and IsSquare(n+2) then Append(~lst, -1); else a:=n+1; c:=1; if IsPrime(a) then Append(~lst, a); else repeat b:=n*a-c; c:=a; a:=b; until IsPrime(a); Append(~lst, a); end if; end if; end for; lst;
CROSSREFS
KEYWORD
sign
AUTHOR
Arkadiusz Wesolowski, Jul 09 2016
STATUS
approved