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”).
%I #21 Nov 24 2024 01:53:21
%S 0,0,0,1,0,1,0,1,2,0,1,2,0,1,2,3,0,1,2,3,0,1,2,3,4,0,1,2,3,4,0,1,2,3,
%T 4,5,0,1,2,3,4,5,0,1,2,3,4,5,6,0,1,2,3,4,5,6,0,1,2,3,4,5,6,7,0,1,2,3,
%U 4,5,6,7,0,1,2,3,4,5,6,7,8,0,1,2,3,4,5,6,7,8,0,1,2,3,4,5,6,7,8,9,0,1
%N Integers 0..n then 0..n then 0..n+1 then 0..n+1 etc.
%C Second column in the monotonic justified array of all positive generalized Fibonacci sequences (A160271). see also A199474. - _Casey Mongoven_, Nov 06 2011
%C Can also be seen as an irregular triangle with duplicated rows of A002262. - _Reinhard Zumkeller_, Jul 14 2015
%H Reinhard Zumkeller, <a href="/A055087/b055087.txt">Rows n = 0..120 of triangle, flattened</a>
%H Michael Somos, <a href="/A073189/a073189.txt">Sequences used for indexing triangular or square arrays</a>
%e 0; 0; 0,1; 0,1; 0,1,2; 0,1,2; 0,1,2,3; 0,1,2,3; ...
%t With[{nn=10},Flatten[Table[{Range[0,n],Range[0,n]},{n,0,nn}]]] (* _Harvey P. Dale_, May 30 2015 *)
%o (PARI) {a(n) = (1 + 4*n - sqr( floor( sqrt( 1 + 4*n)))) \ 4}
%o (Haskell)
%o import Data.List (transpose)
%o a055087 n k = a055087_tabf !! n !! k
%o a055087_row n = a055087_tabf !! n
%o a055087_tabf = concat $ transpose [a002262_tabl, a002262_tabl]
%o a055087_list = concat a055087_tabf
%o -- _Reinhard Zumkeller_, Jul 14 2015
%Y Cf. A002262.
%K nonn,easy,tabf
%O 0,9
%A _Michael Somos_, Jun 13 2000