[go: up one dir, main page]

login
A180447
n appears 3n+1 times.
6
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,6
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
EXAMPLE
a(5) = floor((sqrt(24*5+1)+1)/6) = 2.
MATHEMATICA
f[n_] := Floor[(Sqrt[24 n + 1] + 1)/6]; Array[f, 105, 0] (* Robert G. Wilson v, Sep 10 2010 *)
PROG
(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
(PARI) a(n) = (sqrtint(24*n+1)+1)\6; \\ Kevin Ryde, Apr 21 2021
CROSSREFS
Cf. A000326 (indices of run starts), A180446.
Sequence in context: A329195 A204164 A257639 * A295866 A115338 A348522
KEYWORD
easy,nonn,changed
AUTHOR
William A. Tedeschi, Sep 07 2010
EXTENSIONS
More terms from Robert G. Wilson v, Sep 10 2010
STATUS
approved