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.

A056140 a(n) = n^2 - previousprime(n)*nextprime(n), for n>2.

Original entry on oeis.org

-1, 1, 4, 1, -6, -13, 4, 23, 30, 1, -18, -25, 4, 35, 42, 1, -30, -37, 4, 47, -22, -91, -42, 9, 62, 117, 128, 1, -112, -123, -58, 9, 78, 149, 98, -73, 4, 83, 90, 1, -78, -85, 4, 95, -70, -187, -90, 9, 110, 213, 36, -211, -102, 9, 122, 237, 248, 1, -232, -243
Offset: 3

Views

Author

Henry Bottomley, Jun 15 2000

Keywords

Comments

a(n) is never 0.

Examples

			a(3)=3^2-2*5=-1, a(4)=4^2-3*5=1.
		

Crossrefs

Programs

  • Mathematica
    Table[n^2-NextPrime[n]NextPrime[n,-1],{n,3,80}] (* Harvey P. Dale, Aug 22 2011 *)
  • PARI
    a(n) = n^2 - precprime(n-1)*nextprime(n+1); \\ Michel Marcus, Mar 22 2020

Formula

a(n) = n^2-A007917(n-1)*A007918(n+1) = A000290(n)-A013638(n).

Extensions

More terms from Harvey P. Dale, Aug 22 2011