OFFSET
0,3
COMMENTS
The PARI functions t1, t2 can be used to read a triangular array T(n,k) (n >= 0, 0 <= k <= floor(n/3)) by rows from left to right: n -> T(t1(n), t2(n)).
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..6900
Michael Somos, Sequences used for indexing triangular or square arrays
FORMULA
a(n) = floor(sqrt(6n+6)-3/2).
a(0)=0, then for n>=1 a(n)=1+a(n-1-floor(a(n-1)/3)). - Benoit Cloitre, May 08 2017
MATHEMATICA
Flatten[Table[c=1+Floor[n/3]; Table[n, {c}], {n, 0, 20}]] (* Harvey P. Dale, Nov 01 2013 *)
PROG
(PARI) a(n)=floor(sqrt(6*n+6)-3/2)
(PARI) t1(n)=floor(sqrt(6*n+6)-3/2) /* A073188 */
(PARI) t2(n)=(n-3*binomial(1+t1(n)\3, 2))%(t1(n)\3+1) /* A073189 */
(PARI) a(n)=if(n<1, 0, a(n-a(n-1)\3-1)+1) \\ Benoit Cloitre, May 08 2017
(Magma) [Floor(Sqrt(6*n+6)-3/2): n in [0..50]]; // G. C. Greubel, May 29 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Michael Somos, Jul 19 2002
STATUS
approved