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.

A319289 The x coordinates of the shell enumeration of N X N where N = {0, 1, 2, ...} (A319514).

Original entry on oeis.org

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

Views

Author

Peter Luschny, Sep 23 2018

Keywords

Comments

See A319514 for comments and references.

Crossrefs

Cf. A319514.

Programs

  • Julia
    function A319289(n)
        m = x = isqrt(n)
        y = n - x^2
        x <= y && ((x, y) = (2x - y, x))
        isodd(m) ? y : x
    end