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 A051340 #53 Jun 22 2025 09:40:17 %S A051340 1,1,2,1,1,3,1,1,1,4,1,1,1,1,5,1,1,1,1,1,6,1,1,1,1,1,1,7,1,1,1,1,1,1, %T A051340 1,8,1,1,1,1,1,1,1,1,9,1,1,1,1,1,1,1,1,1,10,1,1,1,1,1,1,1,1,1,1,11,1, %U A051340 1,1,1,1,1,1,1,1,1,1,12,1,1,1,1,1,1,1,1,1,1,1,1,13 %N A051340 A simple 2-dimensional array, read by antidiagonals: T[i,j] = 1 for j>0, T[i,0] = i+1; i,j = 0,1,2,3,... %C A051340 Warning: contributions from Kimberling refer to an alternate version indexed by 1 instead of 0. Other contributors (Adamson in A125026/A130301/A130295) refer to this considering the upper right triangle set to zero, T[i,j]=0 for j>i. - _M. F. Hasler_, Aug 15 2015 %C A051340 From _Clark Kimberling_, Feb 05 2011: (Start) %C A051340 A member of the accumulation chain: %C A051340 ... < A051340 < A141419 < A185874 < A185875 < A185876 < ... %C A051340 (See A144112 for the definition of accumulation array.) %C A051340 In the m-th accumulation array of A051340, %C A051340 row_1 = C(m,1) and column_1 = C(1,m+1), for m>=0. (End) %H A051340 G. C. Greubel, <a href="/A051340/b051340.txt">Antidiagonals n = 0..100, flattened</a> %H A051340 Johann Cigler, <a href="https://arxiv.org/abs/1611.05252">Some elementary observations on Narayana polynomials and related topics</a>, arXiv:1611.05252 [math.CO], 2016. See p. 24. %H A051340 A. V. Mikhalev and A. A. Nechaev, <a href="http://dx.doi.org/10.1007/BF00047168">Linear recurring sequences over modules</a>, Acta Applic. Math., 42 (1996), 161-202. %F A051340 For n>0, a(n(n+3)/2)=n+1, and if k is not of the form n*(n+3)/2, then a(k)=1. - _Benoit Cloitre_, Oct 31 2002, corrected by _M. F. Hasler_, Aug 15 2015 %F A051340 T(n,0) = n+1 and T(n,k) = 1 if k >= 0, for n >= 0. - _Clark Kimberling_, Feb 05 2011 %e A051340 Northwest corner: %e A051340 1...1...1...1...1...1...1 %e A051340 2...1...1...1...1...1...1 %e A051340 3...1...1...1...1...1...1 %e A051340 4...1...1...1...1...1...1 %e A051340 5...1...1...1...1...1...1 %e A051340 6...1...1...1...1...1...1 %e A051340 The Mathematica code shows that the weight array of this array (i.e., the array of which this array is the accumulation array), has northwest corner %e A051340 1....0...0...0...0...0...0 %e A051340 1...-1...0...0...0...0...0 %e A051340 1...-1...0...0...0...0...0 %e A051340 1...-1...0...0...0...0...0 %e A051340 1...-1...0...0...0...0...0. - _Clark Kimberling_, Feb 05 2011 %p A051340 A051340 := proc(n, k) if k=0 then n+1; else 1; end if; end proc: # _R. J. Mathar_, Jul 16 2015 %t A051340 (* This program generates A051340, then its accumulation array A141419, then its weight array described under Example. *) %t A051340 f[n_,0]:=0; f[0,k_]:=0; (* needed for the weight array *) %t A051340 f[n_,1]:=n; f[n_,k_]:=1/;k>1; %t A051340 TableForm[Table[f[n,k],{n,1,10},{k,1,15}]] (* A051340 *) %t A051340 Table[f[n-k+1,k],{n,14},{k,n,1,-1}]//Flatten %t A051340 s[n_,k_]:=Sum[f[i,j],{i,1,n},{j,1,k}]; (* accumulation array of {f(n,k)} *) %t A051340 TableForm[Table[s[n,k],{n,1,10},{k,1,15}]] (* A141419 *) %t A051340 Table[s[n-k+1,k],{n,14},{k,n,1,-1}]//Flatten %t A051340 w[m_,n_]:=f[m,n]+f[m-1,n-1]-f[m,n-1]-f[m-1,n]/;Or[m>0,n>0]; %t A051340 TableForm[Table[w[n,k],{n,1,10},{k,1,15}]] (* weight array *) %t A051340 Table[w[n-k+1,k],{n,14},{k,n,1,-1}]//Flatten (* _Clark Kimberling_, Feb 05 2011 *) %t A051340 f[n_] := Join[ Table[1, {n - 1}], {n}]; Array[ f, 14] // Flatten (* _Robert G. Wilson v_, Mar 04 2012 *) %t A051340 Table[PadLeft[{n},n,1],{n,15}]//Flatten (* _Harvey P. Dale_, Jun 17 2025 *) %o A051340 (Magma) [k eq n select n+1 else 1: k in [0..n], n in [0..15]]; // _G. C. Greubel_, Mar 18 2023 %o A051340 (SageMath) %o A051340 def A051340(n,k): return n+1 if (k==n) else 1 %o A051340 flatten([[A051340(n,k) for k in range(n+1)] for n in range(16)]) # _G. C. Greubel_, Mar 18 2023 %o A051340 (Python) %o A051340 from math import comb, isqrt %o A051340 def A051340(n): %o A051340 a = (m:=isqrt(k:=n+2<<1))+(k>m*(m+1)) %o A051340 return 1 if n-comb(a,2)+1 else a-1 # _Chai Wah Wu_, Jun 21 2025 %Y A051340 Cf. A144112, A141419, A185874, A185875, A185876. %K A051340 easy,nice,nonn,tabl %O A051340 0,3 %A A051340 _N. J. A. Sloane_ %E A051340 Edited by _M. F. Hasler_, Aug 15 2015