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.

A316776 a(n) is the number of integers 0 < k < n such that n^2 - k^2 is a semiprime.

Original entry on oeis.org

0, 0, 0, 1, 2, 1, 1, 3, 2, 2, 3, 3, 3, 2, 3, 2, 4, 5, 1, 4, 4, 3, 3, 5, 5, 4, 5, 4, 4, 6, 2, 5, 7, 2, 6, 6, 4, 5, 8, 4, 4, 8, 5, 5, 9, 5, 5, 8, 3, 6, 8, 5, 5, 8, 6, 8, 10, 7, 5, 13, 4, 6, 10, 3, 8, 9, 6, 5, 8, 7, 8, 12, 6, 5, 12, 4, 8, 12, 4, 9, 11, 5, 5, 13, 10, 6, 11, 7, 7, 14, 6, 9, 14, 6, 8, 11
Offset: 1

Views

Author

Arnauld Chevallier, Jul 12 2018

Keywords

Examples

			a(11) = 3 because 11^2 - 6^2 = 85, 11^2 - 8^2 = 57 and 11^2 - 10^2 = 21 are the only three semiprimes of the form 11^2 - k^2 with 0 < k < 11.
		

Crossrefs

Cf. A001358.

Programs

  • Mathematica
    a[n_] := Sum[Boole[ PrimeOmega[n^2 - k^2] == 2], {k, n-1}]; Array[a, 96] (* Giovanni Resta, Jul 13 2018 *)
  • PARI
    a(n) = sum(k=1, n-1, bigomega(n^2-k^2)==2); \\ Michel Marcus, Jul 12 2018