login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

n appears 1+[n/3] times.
1

%I #26 Sep 08 2022 08:45:06

%S 0,1,2,3,3,4,4,5,5,6,6,6,7,7,7,8,8,8,9,9,9,9,10,10,10,10,11,11,11,11,

%T 12,12,12,12,12,13,13,13,13,13,14,14,14,14,14,15,15,15,15,15,15,16,16,

%U 16,16,16,16,17,17,17,17,17,17,18,18,18,18,18,18,18,19,19,19,19,19,19

%N n appears 1+[n/3] times.

%C 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)).

%C a(A001840(k) + j) = A001840(k), 0<=j < A008620(k). - _Reinhard Zumkeller_, Aug 01 2002

%H Vincenzo Librandi, <a href="/A073188/b073188.txt">Table of n, a(n) for n = 0..6900</a>

%H Michael Somos, <a href="/A073189/a073189.txt">Sequences used for indexing triangular or square arrays</a>

%F a(n) = floor(sqrt(6n+6)-3/2).

%F a(0)=0, then for n>=1 a(n)=1+a(n-1-floor(a(n-1)/3)). - _Benoit Cloitre_, May 08 2017

%t Flatten[Table[c=1+Floor[n/3];Table[n,{c}],{n,0,20}]] (* _Harvey P. Dale_, Nov 01 2013 *)

%o (PARI) a(n)=floor(sqrt(6*n+6)-3/2)

%o (PARI) t1(n)=floor(sqrt(6*n+6)-3/2) /* A073188 */

%o (PARI) t2(n)=(n-3*binomial(1+t1(n)\3,2))%(t1(n)\3+1) /* A073189 */

%o (PARI) a(n)=if(n<1,0,a(n-a(n-1)\3-1)+1) \\ _Benoit Cloitre_, May 08 2017

%o (Magma) [Floor(Sqrt(6*n+6)-3/2): n in [0..50]]; // _G. C. Greubel_, May 29 2018

%Y Cf. A073189.

%K nonn

%O 0,3

%A _Michael Somos_, Jul 19 2002