A180447 n appears 3n+1 times.
0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
Offset: 0
Examples
a(5) = floor((sqrt(24*5+1)+1)/6) = 2.
Links
- Kevin Ryde, Table of n, a(n) for n = 0..10000
Programs
-
Mathematica
f[n_] := Floor[(Sqrt[24 n + 1] + 1)/6]; Array[f, 105, 0] (* Robert G. Wilson v, Sep 10 2010 *)
-
PARI
a(n) = (sqrtint(24*n+1)+1)\6; \\ Kevin Ryde, Apr 21 2021
-
Python
l = [floor((sqrt(24*n+1)+1)/6) for n in range(0,101)]
-
Python
from math import isqrt def A180447(n): return (m:=isqrt((k:=n<<1)//3))+(k>m*(3*m+5)) # Chai Wah Wu, Nov 04 2024
Formula
a(n) = floor((sqrt(24n+1)+1)/6).
a(n) = m+1 if 2n>m*(3m+5) and a(n) = m otherwise where m = floor(sqrt(2n/3)). For n>0, a(n) = k+1 if 2n>=(k+1)(3k+2) and a(n) = k otherwise where k = floor(sqrt(2(n-1)/3)). - Chai Wah Wu, Nov 04 2024
Sum_{n>=1} (-1)^(n+1)/a(n) = log(2)/2 (= A016655 / 10). - Amiram Eldar, Jun 30 2025
Extensions
More terms from Robert G. Wilson v, Sep 10 2010