A130296 Triangle read by rows: T[i,1]=i, T[i,j]=1 for 1 < j <= i = 1,2,3,...
1, 2, 1, 3, 1, 1, 4, 1, 1, 1, 5, 1, 1, 1, 1, 6, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 1, 1, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 12, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 14, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1
Examples
First few rows of the triangle are: 1; 2, 1; 3, 1, 1; 4, 1, 1, 1; 5, 1, 1, 1, 1; ...
Programs
-
PARI
A130296(i,j)=if(j==1,i,j<=i) \\ The sequence should not be defined for j>i but it is used in several places as infinite square matrix with upper right part equal to zero. - M. F. Hasler, Aug 15 2015
-
Python
from math import isqrt def A130296(n): return comb((m:=isqrt(k:=n<<1))+(k>m*(m+1)),2)-comb((m2:=isqrt(k-2))+(k-2>m2*(m2+1)),2)+1 # Chai Wah Wu, Nov 09 2024
Comments