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.

A073497 a(n) = n^2 - prime(n).

Original entry on oeis.org

-1, 1, 4, 9, 14, 23, 32, 45, 58, 71, 90, 107, 128, 153, 178, 203, 230, 263, 294, 329, 368, 405, 446, 487, 528, 575, 626, 677, 732, 787, 834, 893, 952, 1017, 1076, 1145, 1212, 1281, 1354, 1427, 1502, 1583, 1658, 1743, 1828, 1917, 1998, 2081, 2174, 2271, 2368
Offset: 1

Views

Author

Werner D. Sand, Aug 27 2002

Keywords

Comments

a(n) is never a perfect square for n>=5. [Proof: assume on the contrary n^2 - prime(n) = k^2, equivalent to (n+k)*(n-k) = prime(n). Since prime(n) cannot be the product of two nontrivial factors, this equation can only hold for k=n-1, i.e., prime(n)=2n-1. This contradicts the assumption and completes the proof.] - Alexander R. Povolotsky, Oct 01 2008

Programs

  • Magma
    [n^2 - NthPrime(n): n in [1..100] ]; // Vincenzo Librandi, Apr 12 2011
  • Mathematica
    Table[n^2 - Prime[n], {n, 1, 55}]
  • PARI
    for(n=1,51,print1(n*n-prime(n),","))
    

Extensions

More terms from Klaus Brockhaus and Robert G. Wilson v, Aug 28 2002