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.

A086520 Number of integers strictly greater than (n-sqrt(n))/2 and strictly less than (n+sqrt(n))/2.

Original entry on oeis.org

0, 0, 1, 2, 1, 2, 3, 2, 3, 2, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 9, 8, 9, 8, 9, 8, 9, 8, 9, 8, 9, 8, 9, 8, 9, 8, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10
Offset: 0

Views

Author

Jeff S. Pratt (jpratt(AT)pas.rochester.edu), Sep 10 2003

Keywords

Comments

This sequence occurs in quantum mechanics, in the context of counting certain kinds of inseparable states in an n-qubit model.

Examples

			a(16) = 3 because there are three integers between 6 and 10.
		

Programs

  • Maple
    a:= n-> max(0, ceil((n+sqrt(n))/2)-1-floor((n-sqrt(n))/2)):
    seq(a(n), n=0..120);  # Alois P. Heinz, Apr 02 2014
  • Mathematica
    a[n_] := If[IntegerQ[Sqrt[n]], Sum[1, {m, Ceiling[(n - Sqrt[n])/2] + 1, Floor[(n + Sqrt[n])/2] - 1}], Sum[1, {m, Ceiling[(n - Sqrt[n])/2], Floor[(n + Sqrt[n])/2]}]]

Extensions

a(0)-a(1) prepended by Alois P. Heinz, Apr 02 2014