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.

A080343 a(n) = round(sqrt(2*n)) - floor(sqrt(2*n)).

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

N. J. A. Sloane, Mar 20 2003

Keywords

Crossrefs

Programs

  • Python
    from gmpy2 import isqrt_rem
    def A080343(n):
        i, j = isqrt_rem(2*n)
        return int(4*(j-i) >= 1) # Chai Wah Wu, Aug 16 2016

Formula

Runs are 0^1, 0^1, 0^2 1, 0^2 1, 0^3 1^2, 0^3 1^2, 0^4 1^3, 0^4 1^3, ...
a(n) = 1 iff n >= 4 and n is in the interval [t_k + 1, ..., t_k + floor(k/2)] for some k >= 2, where t_k = k*(k+1)/2 is a triangular number.
a(n) = A023969(2*n). - Michel Marcus, Aug 19 2016