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.

Showing 1-2 of 2 results.

A080344 Partial sums of A023969.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 1, 2, 3, 3, 3, 3, 3, 4, 5, 6, 6, 6, 6, 6, 6, 7, 8, 9, 10, 10, 10, 10, 10, 10, 10, 11, 12, 13, 14, 15, 15, 15, 15, 15, 15, 15, 15, 16, 17, 18, 19, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 23, 24, 25, 26, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 29, 30, 31, 32, 33, 34, 35
Offset: 0

Views

Author

N. J. A. Sloane, Mar 20 2003

Keywords

Crossrefs

Programs

  • Magma
    [1/2*(n+1-Floor(Sqrt(n+1)+1/2)-Abs(n+1-(Floor(Sqrt(n+1)+1/2))^2)):n in [0..90]]; // Marius A. Burtea, May 09 2019
    
  • PARI
    f(n) = sqrtint(4*n)-2*sqrtint(n); \\ A023969
    a(n) = sum(k=0, n, f(k)); \\ Michel Marcus, May 10 2019
    
  • Python
    from math import isqrt
    def A080344(n): return n+1-(k:=(m:=isqrt(n+1))+int(n>=m*(m+1)))-abs(n+1-k**2)>>1 # Chai Wah Wu, Jun 05 2025

Formula

From Ridouane Oudra, May 11 2019: (Start)
a(n) = (1/2)*(n + 1 - t - abs(n + 1 - t^2)), where t = floor(sqrt(n+1) + 1/2).
a(n) = (1/2)*(n + 1 - A000194(n+1) - abs(n + 1 - A000194(n+1)^2)).
a(n) = (1/2)*(A056847(n+1) - A053188(n+1)). (End)

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
Showing 1-2 of 2 results.