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 A308981 #19 Dec 23 2024 14:53:45 %S A308981 0,1,2,3,5,6,7,10,12,13,15,20,23,26,27,28,30,33,35,37,38,41,45,48,50, %T A308981 56,61,63,65,66,70,71,72,82,83,85,90,96,98,107,108,115,120,122,126, %U A308981 128,133,140,141,142,145,148,156,160,162,166,173,175,180,185,191,202,205,208,213,217,220 %N A308981 Nonnegative integers k such that k^3 - 2*k^2 + k - 1 is not composite. %C A308981 Apart the three initial terms which lead to +/-1, all other terms lead to prime P(k) = k^3 - 2*k^2 + k - 1. %C A308981 The polynomial Q = (((x^2-k)^2-k)^2-x-k)/(x^2 - x - k) of degree 6 has two factors of degree <= 3 when k is in A014206. This can only happen when the constant term of Q, which equals -P(k), is not prime. Therefore, A014206 is a subsequence of the complement of this sequence. %H A308981 R. Israel, in reply to T. Baruchel, <a href="https://web.archive.org/web/*/http://list.seqfan.eu/oldermail/seqfan/2019-July/018882.html">A014206 and computer algebra systems</a>, SeqFan list, July 4, 2019. %t A308981 Join[{0, 1, 2}, Select[Range[230], PrimeQ[((#^2 (# - 2) + # - 1))] &]] (* _Vincenzo Librandi_, Jul 19 2019 *) %o A308981 (PARI) select( is(k)={k<3||isprime(k^2*(k-2)+k-1)}, [0..200]) %o A308981 (Magma) [0,1,2] cat [n: n in [0..220] | IsPrime((n^2*(n-2)+n-1))]; // _Vincenzo Librandi_, Jul 19 2019 %Y A308981 Cf. A014206. %K A308981 nonn %O A308981 1,3 %A A308981 _M. F. Hasler_, Jul 04 2019