A112629 Erroneous duplicate of A110284.
9, 25, 49, 169, 225
Offset: 1
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.
[ n: n in [1..300] | IsPrime(n^2+n+1)] // Vincenzo Librandi, Nov 21 2010
Select[Range@ 216, PrimeQ[#^2 + # + 1] &] (* Michael De Vlieger, Mar 06 2017 *)
is(n)=isprime(n^2+n+1) \\ Charles R Greathouse IV, Jan 21 2014
[ a: n in [1..100] | IsPrime(a) where a is n^2+n+1 ]; // Wesley Ivan Hurt, Jun 16 2014
select(isprime, [j^2+j+1$j=1..200])[]; # Alois P. Heinz, Apr 20 2022
Select[Table[n^2+n+1, {n,250}], PrimeQ] (* Harvey P. Dale, Mar 23 2012 *)
list(lim)=select(n->isprime(n),vector((sqrt(4*lim-3)-1)\2,k,k^2+k+1)) \\ Charles R Greathouse IV, Jul 25 2011
from sympy import isprime print(list(filter(isprime, (n**2 + n + 1 for n in range(150))))) # Michael S. Branicky, Apr 20 2022
n=1 gives 1^2+1+1=3, which is prime and so not a term, and similarly for n=2,3; n=4 gives 21=3*7, which is a(1).
with(numtheory):for n from 0 to 200 do:x:=n^2+n+1: if type(x,prime)=false then print (x):else fi:od:
Select[Array[ #^2+#+1&,6!,2],!PrimeQ[ # ]&] (* Vladimir Joseph Stephan Orlovsky, Apr 07 2010 *)
isok(k) = (k>1) && !isprime(k) && issquare(4*k-3); \\ Michel Marcus, Apr 20 2022
(25*25 + 3)/4 = 157, 157 is prime, 25 is the 7th term of the sequence.
[n: n in [1..400 by 2] | IsPrime((n^2 + 3) div 4)]; // Vincenzo Librandi, Oct 06 2012
Select[Range[500], PrimeQ[(#^2 + 3)/4] &] (* Vincenzo Librandi, Oct 06 2012 *)
for(k=2,1e3,if(isprime(k^2+k+1),print1(2*k+1", "))) \\ Charles R Greathouse IV, Dec 28 2011
Lim=13000;f[{p_,q_}]:=p*q-p-q+2;Union[Select[f/@Subsets[Prime[Range[PrimePi[Lim]]], {2}],#James C. McMahon, Apr 20 2024 *)
Comments