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.

A308981 Nonnegative integers k such that k^3 - 2*k^2 + k - 1 is not composite.

Original entry on oeis.org

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, 56, 61, 63, 65, 66, 70, 71, 72, 82, 83, 85, 90, 96, 98, 107, 108, 115, 120, 122, 126, 128, 133, 140, 141, 142, 145, 148, 156, 160, 162, 166, 173, 175, 180, 185, 191, 202, 205, 208, 213, 217, 220
Offset: 1

Views

Author

M. F. Hasler, Jul 04 2019

Keywords

Comments

Apart the three initial terms which lead to +/-1, all other terms lead to prime P(k) = k^3 - 2*k^2 + k - 1.
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.

Crossrefs

Cf. A014206.

Programs

  • Magma
    [0,1,2] cat  [n: n in [0..220] | IsPrime((n^2*(n-2)+n-1))]; // Vincenzo Librandi, Jul 19 2019
  • Mathematica
    Join[{0, 1, 2}, Select[Range[230], PrimeQ[((#^2 (# - 2) + # - 1))] &]] (* Vincenzo Librandi, Jul 19 2019 *)
  • PARI
    select( is(k)={k<3||isprime(k^2*(k-2)+k-1)}, [0..200])