The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A269252 Define a sequence by s(k) = n*s(k-1) - s(k-2), with s(0) = 1, s(1) = n - 1. a(n) is the smallest index k such that s(k) is prime, or -1 if no such k exists. 5
-1, -1, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 3, 1, 3, 2, 2, 1, 14, 1, 2, 2, 3, 1, 2, 5, 2, 36, 2, 1, 2, 1, 15, -1, 6, 2, 3, 1, 2, 2, 6, 1, 3, 1, 2, 2, 2, 1, 2, 3, 2, -1, 3, 1, 2, 2, 2, 6, 3, 1, 2, 1, 30, 3, 2, 2, 2, 1, 2, 5, 2, 1, 5, 1, 6, 3, 2, 6, 3, 1, 8, 6, 14, 1, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,5
COMMENTS
For n >= 2, positive integer k yielding the smallest prime of the form (x^y + 1/x^y)/(x + 1/x), where x = (sqrt(n+2) +/- sqrt(n-2))/2 and y = 2*k + 1, or -1 if no such k exists.
Every positive term belongs to A005097.
For detailed theory, see [Hone]. - L. Edson Jeffery, Feb 09 2018
LINKS
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) = 1.
EXAMPLE
Let b(k) be the recursive sequence defined by the initial conditions b(0) = 1, b(1) = 10, and the recursive equation b(k) = 11*b(k-1) - b(k-2). a(11) = 2 because b(2) = 109 is the smallest prime in b(k).
Let c(k) be the recursive sequence defined by the initial conditions c(0) = 1, c(1) = 12, and the recursive equation c(k) = 13*c(k-1) - c(k-2). a(13) = 3 because c(3) = 2003 is the smallest prime in c(k).
MATHEMATICA
s[k_, m_] := s[k, m] = Which[k == 0, 1, k == 1, 1 + m, True, m s[k - 1, m] - s[k - 2, m]]; Table[SelectFirst[Range[120], PrimeQ@ Abs@ s[#, -n] &] /. k_ /; MissingQ@ k -> -1, {n, 85}] (* Michael De Vlieger, Feb 03 2018 *)
PROG
lst:=[]; for n in [1..85] do if n in [1, 2, 34, 52] then Append(~lst, -1); else a:=1; c:=1; t:=0; repeat b:=n*a-c; c:=a; a:=b; t+:=1; until IsPrime(a); Append(~lst, t); end if; end for; lst;
CROSSREFS
Cf. A005097, A269251, A269253, A269254, A299045 (array used to compute this sequence).
Sequence in context: A062362 A330437 A338648 * A291150 A292375 A361702
KEYWORD
sign
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 23 07:08 EDT 2024. Contains 372760 sequences. (Running on oeis4.)