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.
we define the next term of the sequence to be the maximal element in the set S := {P(x) : x is an integer, 0 < x < p, and P(x) is a prime number}. The first term of the present sequence is p=3.
%I A280717 #35 Feb 22 2023 06:05:35 %S A280717 3,7,43,1693,2864557,8205572225569,67331415548799635795058613, %T A280717 4533519519805137360312930667312809111343819483374997, %U A280717 20552799236454203238557860425684304712780972342513397945121797314302926172950212696842909492430773376197 %N A280717 Given a prime number p, let b = -p and c = p^2. Assuming that the polynomial P(x) := x^2+b*x+c takes at least one prime value for some positive integer x<p, we define the next term of the sequence to be the maximal element in the set S := {P(x) : x is an integer, 0 < x < p, and P(x) is a prime number}. The first term of the present sequence is p=3. %C A280717 The next term is only defined if the set S above is not empty. %C A280717 Conjecture: the sequence is well defined. %C A280717 a(13) has 1654 digits. If S is not empty, then its maximal element is P(x) where x is the least positive integer x <= p/2 such that P(x) is prime. - _Chai Wah Wu_, Jan 09 2017 %H A280717 Chai Wah Wu, <a href="/A280717/b280717.txt">Table of n, a(n) for n = 1..12</a> %e A280717 a(2) = 7, since 7 = max S_3, where S_3 = {x^2-3x+9 : x is an integer with 0<x<2, and x^2-3x+9 is a prime number}. Clearly, S_3={7}, thus a(2)=7. Now we explain why a(3)=43. We have 43 = max S_7. S_7 := {x^2-7x+49 : x is an integer, 0 <x<7, and x^2-7x+49 is a prime number}. By computations S_7 = {37,43}. Thus a(3) = max S_7 = 43. We explain also why a(4) = 1693. One has 1693 = max S_43, where S_43 = {x^2-43x+43^2 : x is an integer, 0 <x < 43, and x^2-43x+43^2 is a prime number}. By computations S_43 = {1399,1429,1459,1543,1597,1627,1693}. Thus a(3) = max S_43 = 1693. %p A280717 with(numtheory): %p A280717 xa := proc(aa) local P,x,a,a2,mi,mm; a:= aa; a2 := a^2; mi := 0; for x from 1 to a-1 do P := x^2-a*x+a2; if isprime(P) then mi := max(P,mi); fi; od;; mi; end; %p A280717 F := proc(n) option remember if n=1 then return(3); fi; if n=2 then xa(3); else xa(F(n-1)); fi; end; %t A280717 P[p_, x_] := x^2 - p x + p^2; %t A280717 A280717[1] = 3; %t A280717 A280717[n_] := A280717[n] = P[A280717[n - 1], NestWhile[# - 1 &, A280717[n - 1] - 1, # > A280717[n - 1]/2 && ! PrimeQ@P[A280717[n - 1], #] &]]; %t A280717 A280717 /@ Range[5] (* _Davin Park_, Feb 06 2017 *) %o A280717 (Python) %o A280717 from __future__ import division %o A280717 from sympy import isprime %o A280717 A280717_list, n = [3], 3 %o A280717 for _ in range(10): %o A280717 for i in range(1,n//2+1): %o A280717 j = i**2+n*(n-i) %o A280717 if isprime(j): %o A280717 n = j %o A280717 A280717_list.append(n) %o A280717 break # _Chai Wah Wu_, Jan 09 2017 %K A280717 nonn,hard %O A280717 1,1 %A A280717 _Luis H. Gallardo_, Jan 07 2017 %E A280717 a(5) corrected and a(6)-a(9) added by _Chai Wah Wu_, Jan 09 2017