cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A269252 #53 May 28 2025 20:13:48
%S A269252 -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,
%T A269252 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,
%U A269252 2,2,2,1,2,5,2,1,5,1,6,3,2,6,3,1,8,6,14,1,3
%N 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.
%C A269252 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.
%C A269252 Every positive term belongs to A005097.
%C A269252 For detailed theory, see [Hone]. - _L. Edson Jeffery_, Feb 09 2018
%H A269252 C. K. Caldwell, Top Twenty page, <a href="https://t5k.org/top20/page.php?id=47">Lehmer number</a>
%H A269252 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 A269252 Wikipedia, <a href="http://en.wikipedia.org/wiki/Lehmer_number">Lehmer number</a>
%F A269252 If n is prime then a(n+1) = 1.
%e A269252 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).
%e A269252 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).
%t A269252 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 *)
%o A269252 (Magma) 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;
%Y A269252 Cf. A005097, A269251, A269253, A269254, A299045 (array used to compute this sequence).
%Y A269252 Cf. A294099, A298675, A298677, A298878, A299071, A285992, A299107, A299109, A088165, A117522, A299100, A299101, A113501.
%K A269252 sign
%O A269252 1,5
%A A269252 _Arkadiusz Wesolowski_, Jul 09 2016