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.
%I A269251 #53 Apr 03 2023 10:36:13 %S A269251 -1,-1,2,3,19,5,41,7,71,89,109,11,2003,13,3121,239,271,17, %T A269251 729962708557509701,19,419,461,11593,23,599,11356201,701, %U A269251 11546481261621528160662473705515857458665002781273993,811,29,929 %N A269251 a(n) = smallest prime in the sequence s(k) = n*s(k-1) - s(k-2), with s(0) = 1, s(1) = n - 1 (or a(n) = -1 if no such prime exists). %C A269251 For n >= 2, 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. %C A269251 If a(34) > 0 then a(34) > 10^1000. - _Robert Israel_, Feb 06 2018 %C A269251 For detailed theory, see [Hone]. - _L. Edson Jeffery_, Feb 09 2018 %C A269251 Values of n where a(n) might need more than 1000 digits: 34, 52, 123, 254, 275, 285, 322, 371, 401, 413, 437, 460, 508, 518, 535, 540, 629, 643, 653, 691, 723, 724, 753, 797, 837, 843, 876, 881, 898, 913, 960, 970, 981, 986, 987, ... - _Jean-François Alcover_, Mar 01 2018 %H A269251 C. K. Caldwell, Top Twenty page, <a href="https://t5k.org/top20/page.php?id=47">Lehmer number</a> %H A269251 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 A269251 Wikipedia, <a href="http://en.wikipedia.org/wiki/Lehmer_number">Lehmer number</a> %F A269251 If n is prime then a(n+1) = n. %p A269251 f:= proc(n) local a,b,t; %p A269251 a:= 1; b:= n-1; %p A269251 do %p A269251 if isprime(b) then return b fi; %p A269251 t:= n*b-a; %p A269251 a:= b; %p A269251 b:= t; %p A269251 od %p A269251 end proc: %p A269251 f(1):= -1: f(2):= -1: %p A269251 map(f, [$1..33]); # _Robert Israel_, Feb 06 2018 %t A269251 max = 10^1000; a[1] = a[2] = -1; 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, s[k] <= max, k++, If[PrimeQ[s[k]], Return[s[k]]]]] /. Null -> -1; Table[a[n], {n, 1, 33}] (* _Jean-François Alcover_, Mar 01 2018 *) %o A269251 (Magma) lst:=[]; for n in [1..31] do if n le 2 then Append(~lst, 0); else a:=1; c:=1; repeat b:=n*a-c; c:=a; a:=b; until IsPrime(a); Append(~lst, a); end if; end for; lst; %Y A269251 Cf. A269252, A269253, A269254. %Y A269251 Cf. A294099, A298675, A298677, A298878, A299045, A299071, A285992, A299107, A299109, A088165, A117522, A299100, A299101, A113501. %K A269251 sign %O A269251 1,3 %A A269251 _Arkadiusz Wesolowski_, Jul 09 2016 %E A269251 Changed the value for the exceptional case from 0 to -1 for consistency with other sequences. - _N. J. A. Sloane_, Jan 19 2018