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!)
A269254 To find a(n), define a sequence by s(k) = n*s(k-1) - s(k-2), with s(0) = 1, s(1) = n + 1; then a(n) is the smallest index k such that s(k) is prime, or -1 if no such k exists. 17

%I #115 Apr 03 2023 10:36:13

%S 1,1,2,1,2,1,-1,2,2,1,2,1,2,-1,2,1,3,1,2,2,2,1,-1,2,6,2,3,1,3,1,2,9,9,

%T -1,2,1,6,2,2,1,2,1,5,2,2,1,-1,2,5,2,9,1,2,2,2,2,6,1,2,1,14,-1,5,2,2,

%U 1,5,2,3,1,6,1,8,3,6,2,3,1,-1,3,18,1,2,3,2,2,3,1,2,9,3,5,2,2,96,1,3,-1,5,1,2,1,2,15,14,1,44,1,3,-1

%N To find a(n), define a sequence by s(k) = n*s(k-1) - s(k-2), with s(0) = 1, s(1) = n + 1; then a(n) is the smallest index k such that s(k) is prime, or -1 if no such k exists.

%C The s(k) sequences can be viewed in A294099, where they appear as rows. - _Peter Munn_, Aug 31 2020

%C For n >= 3, a(n) is that 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.

%C Every positive term belongs to A005097.

%C 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. For the other -1 terms below 100, see the theorem below and the Klee link - _N. J. A. Sloane_, Oct 20 2017 and Oct 22 2017

%C Theorem (Brad Klee): For all n > 2, a(n^2 - 2) = -1. See Klee link for a proof. - _L. Edson Jeffery_, Oct 22 2017

%C Theorem (Based on work of Hans Havermann, L. Edson Jeffery, Brad Klee, Don Reble, Bob Selcoe, and N. J. A. Sloane) a(110) = -1. [For proof see link. - _N. J. A. Sloane_, Oct 23 2017]

%C From _Bob Selcoe_, Oct 24 2017, edited by _N. J. A. Sloane_, Oct 27 2017: (Start)

%C Suppose n = m^2 - 2, where m >= 3, and let j = m-2, with j >= 1.

%C For this value of n, the sequence s(k) satisfies s(k) = (c(k) + d(k))*(c(k) - d(k)), where c(0) = 1, d(0) = 0; and for k >= 1: c(k) = (j+2)*c(k-1) - d(k-1), and d(k) = c(k-1). So (as Brad Klee already proved) a(n) = -1 .

%C We have s(0) = 1 and s(1) = n+1 = j^2 + 4j + 3. In general, the coefficients of s(k) when expanded in powers of j are given by the (4k+2)-th row of A011973 (the triangle of coefficients of Fibonacci polynomials) in reverse order. For example, s(2) = j^4 + 8j^3 + 21j^2 + 20j + 5, s(3) = j^6 + 12j^5 + 55j^4 + 120j^3 + 126j^2 + 56j + 7, etc.

%C Perhaps the above comments could be generalized to apply to a(110) or to other n for which a(n) = -1?

%C (End)

%C For detailed theory, see [Hone]. - _L. Edson Jeffery_, Feb 09 2018

%H Hans Havermann, <a href="/A269254/b269254.txt">Table of n, a(n) for n = 1..946</a>

%H Hans Havermann, <a href="http://chesswanks.com/seq/a269254.txt">Table of n, a(n) for n = 1..10000</a>

%H C. K. Caldwell, Top Twenty page, <a href="https://t5k.org/top20/page.php?id=47">Lehmer number</a>

%H Andrew N. W. Hone, et al., <a href="https://arxiv.org/abs/1802.01793">On a family of sequences related to Chebyshev polynomials</a>, arXiv:1802.01793 [math.NT], 2018.

%H Brad Klee, <a href="http://list.seqfan.eu/oldermail/seqfan/2017-October/018016.html">Proof for A269254</a>, Sequence Fans Mailing List, October 2017.

%H N. J. A. Sloane et al., <a href="/A269254/a269254.txt">Proof that a(110) = -1</a>

%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Lehmer_number">Lehmer number</a>.

%F If n is prime then a(n-1) = 1.

%e Let b(k) be the recursive sequence defined by the initial conditions b(0) = 1, b(1) = 16, and the recursive equation b(k) = 15*b(k-1) - b(k-2). a(15) = 2 because b(2) = 239 is the smallest prime in b(k).

%e Let c(k) be the recursive sequence defined by the initial conditions c(0) = 1, c(1) = 18, and the recursive equation c(k) = 17*c(k-1) - c(k-2). a(17) = 3 because c(3) = 5167 is the smallest prime in c(k).

%t kmax = 100;

%t a[1] = a[2] = 1;

%t a[n_ /; IntegerQ[Sqrt[n+2]]] = -1;

%t a[n_] := Module[{s}, s[0] = 1; s[1] = n+1; s[k_] := s[k] = n s[k-1] - s[k-2]; For[k=1, k <= kmax, k++, If[PrimeQ[s[k]], Return[k]]]; Print["For n = ", n, ", k = ", k, " exceeds the limit kmax = ", kmax]; -1];

%t Array[a, 110] (* _Jean-François Alcover_, Aug 05 2018 *)

%o (Magma) lst:=[]; for n in [1..85] do if n gt 2 and IsSquare(n+2) then Append(~lst, -1); else a:=n+1; c:=1; t:=1; if IsPrime(a) then Append(~lst, t); else repeat b:=n*a-c; c:=a; a:=b; t+:=1; until IsPrime(a); Append(~lst, t); end if; end if; end for; lst;

%o (PARI)

%o allocatemem(2^30);

%o default(primelimit,(2^31)+(2^30));

%o s(n,k) = if(0==k,1,if(1==k,(1+n),((n*s(n,k-1)) - s(n,k-2))));

%o A269254(n) = { my(k=1); if((n>2)&&issquare(2+n),-1,while(!isprime(s(n,k)),k++);(k)); }; \\ _Antti Karttunen_, Oct 20 2017

%Y Cf. A005097, A011973, A269251, A269252, A269253.

%Y Cf. A294099 (array used to compute this sequence).

%Y Cf. A285992, A299107, A299109, A088165, A117522, A299100, A299101, A113501, A298675, A298677, A298878, A299045, A299071.

%K sign

%O 1,3

%A _Arkadiusz Wesolowski_, Jul 09 2016

%E a(86)-a(94) from _Antti Karttunen_, Oct 20 2017

%E a(95)-a(109) appended by _L. Edson Jeffery_, Oct 22 2017

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 April 19 17:49 EDT 2024. Contains 371797 sequences. (Running on oeis4.)