A220104 k appears k*(k+1) times.
1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 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, 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
Offset: 1
Keywords
Examples
For n = 21 the solution is found as the following: c(21) = 3, e(21) = 1, and finally a(21) = 4.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Programs
-
Haskell
a220104 n = a220104_list !! (n-1) a220104_list = concatMap (\x -> take (a002378 x) $ repeat x) [1..] -- Reinhard Zumkeller, Jan 01 2013
-
Mathematica
Flatten[Array[Table[#,#(#+1)]&,6]] (* Paolo Xausa, Dec 10 2023 *)
-
Python
from sympy import integer_nthroot def A220104(n): return (m:=integer_nthroot(k:=3*n, 3)[0])+(k>m*(m+1)*(m+2)) # Chai Wah Wu, Nov 14 2024
Formula
For c(n) = floor((3*n)^(1/3)), e(n) = n - (c(n)*(c(n)+1)*(c(n)+2))/3, explicit formula is a(n) = c(n) + sgn(abs(e(n)) + e(n)).
a(n) = floor(t + 1/(3*t)), where t = (3*(n - 1))^(1/3), for n > 1. - Ridouane Oudra, Oct 30 2023
Comments