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.

A214857 Number of triangular numbers in interval [0, n^2].

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 9, 10, 11, 13, 14, 16, 17, 18, 20, 21, 23, 24, 25, 27, 28, 30, 31, 33, 34, 35, 37, 38, 40, 41, 42, 44, 45, 47, 48, 50, 51, 52, 54, 55, 57, 58, 59, 61, 62, 64, 65, 66, 68, 69, 71, 72, 74, 75, 76, 78, 79, 81, 82, 83, 85, 86, 88, 89, 91, 92, 93, 95, 96, 98, 99, 100
Offset: 0

Views

Author

Philippe Deléham, Mar 09 2013

Keywords

Comments

Partial sums of A214856.

Examples

			0, 1, 3, 6 are in interval [0, 9], a(3) = 4.
0, 1, 3, 6, 10, 15 are in interval [0, 16], a(4) = 6.
		

Crossrefs

Programs

Formula

a(n) = floor((1 + sqrt(1+8*n^2))/2). - Ralf Stephan, Jan 30 2014

A378301 a(n) is the number of triangular numbers (A000217) in the interval [n^2, (n + 1)^2].

Original entry on oeis.org

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

Views

Author

Ctibor O. Zizka, Nov 22 2024

Keywords

Comments

After n=22, is the frequency of 1 always > 2? Are terms only 1 or 2? - Bill McEachen, Dec 10 2024
The distinct terms of this sequence are only 1 and 2. The asymptotic densities of the occurrences of 1 and 2 are 2-sqrt(2) = 0.585... and sqrt(2)-1 = 0.414..., respectively. The asymptotic mean of this sequence is sqrt(2). - Amiram Eldar, Dec 11 2024

Examples

			n = 0: in the interval [0, 1] are 2 triangular numbers {0, 1}, thus a(0) = 2.
n = 1: in the interval [1, 4] are 2 triangular numbers {1, 3}, thus a(1) = 2.
		

Crossrefs

Programs

  • Mathematica
    s[n_] := Floor[(Sqrt[8*n+1]-1)/2]; a[n_] := s[(n + 1)^2] - s[n^2 - 1]; a[0] = 2; Array[a, 100, 0] (* Amiram Eldar, Dec 09 2024 *)
  • PARI
    a(n) = sum(k=n^2, (n+1)^2, ispolygonal(k,3)); \\ Michel Marcus, Dec 09 2024
    
  • Python
    from math import isqrt
    def A378301(n): return -(isqrt(m:=n**2<<3)+1>>1)+(isqrt(m+(n+1<<4))+1>>1) # Chai Wah Wu, Dec 09 2024

Formula

a(n) = 2 for n from A001110.
a(n) = A003056((n+1)^2) - A003056(n^2-1) for n >= 1. - Amiram Eldar, Dec 09 2024
a(n) = A002024((n+1)^2+1) - A002024(n^2). - Chai Wah Wu, Dec 09 2024

Extensions

a(53) corrected by Michel Marcus, Dec 09 2024
Showing 1-2 of 2 results.