This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A048151 #22 Apr 09 2025 14:13:36 %S A048151 0,1,0,1,2,0,1,2,3,0,1,2,3,4,0,1,2,3,4,5,0,1,2,3,4,5,6,0,1,2,3,4,5,6, %T A048151 7,0,1,2,3,4,5,6,7,8,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,10,0,1,2, %U A048151 3,4,5,6,7,8,9,10,11,0,1,2,3,4,5,6,7,8,9,10,11,12,0 %N A048151 Triangular array T read by rows: T(n,k)=k mod n, for k=1,2,...,n, n=1,2,... %F A048151 G.f.: x^2*y/((1 - x)*(1 - x*y)^2). - _Stefano Spezia_, Feb 21 2024 %e A048151 Triangle begins: %e A048151 0; %e A048151 1, 0; %e A048151 1, 2, 0; %e A048151 1, 2, 3, 0; %e A048151 1, 2, 3, 4, 0; %e A048151 ... %t A048151 Flatten[Table[Mod[k,n],{n,15},{k,n}]] (* _Harvey P. Dale_, Mar 21 2012 *) %o A048151 (Python) %o A048151 from math import isqrt, comb %o A048151 def A048151(n): return n-comb((m:=isqrt(k:=n+1<<1))+(k>m*(m+1)),2) # _Chai Wah Wu_, Apr 09 2025 %Y A048151 As a sequence, essentially same as A002262. %K A048151 nonn,tabl %O A048151 1,5 %A A048151 _Clark Kimberling_