cp's OEIS Frontend

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.

A127648 Triangle read by rows: row n consists of n zeros followed by n+1.

This page as a plain text file.
%I A127648 #56 Jun 09 2025 21:07:44
%S A127648 1,0,2,0,0,3,0,0,0,4,0,0,0,0,5,0,0,0,0,0,6,0,0,0,0,0,0,7,0,0,0,0,0,0,
%T A127648 0,8,0,0,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,11,0,
%U A127648 0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15
%N A127648 Triangle read by rows: row n consists of n zeros followed by n+1.
%C A127648 Alternatively, a(n) = k if n+1 is the k-th triangular number and 0 otherwise.
%C A127648 Triangle T(n,k), 0<=k<=n, read by rows, given by (0,0,0,0,0,0,0,0,0,0,...) DELTA (2,-1/2,1/2,0,0,0,0,0,0,0,...) where DELTA is the operator defined in A084938. - _Philippe Deléham_, Oct 27 2011
%H A127648 Antti Karttunen, <a href="/A127648/b127648.txt">Rows n = 0..360 of the triangle, flattened</a> (Rows n = 0..100 from G. C. Greubel)
%F A127648 Infinite lower triangular matrix with (1, 2, 3, ...) in the main diagonal and the rest zeros.
%F A127648 This sequence * A007318 (Pascal's Triangle) = A003506.
%F A127648 A007318 * this sequence = A103406.
%F A127648 G.f.: 1/(x*y-1)^2. - _R. J. Mathar_, Aug 11 2015
%F A127648 a(n) = (1/2) (round(sqrt(4 + 2 n)) - round(sqrt(2 + 2 n))) (-1 + round(sqrt(2 + 2 n)) + round(sqrt(4 + 2 n))). - _Brian Tenneson_, Jan 27 2017
%F A127648 From _G. C. Greubel_, Mar 13 2024: (Start)
%F A127648 T(n, n) = n+1.
%F A127648 Sum_{k=0..n} T(n, k) = n+1.
%F A127648 Sum_{k=0..n} (-1)^k*T(n, k) = (-1)^n*(n+1).
%F A127648 Sum_{k=0..floor(n/2)} T(n-k, k) = A142150(n+2).
%F A127648 Sum_{k=0..floor(n/2)} (-1)^k*T(n-k, k) = (-1)^floor(n/2)*A142150(n+2). (End)
%e A127648 First few rows of the triangle:
%e A127648   1;
%e A127648   0, 2;
%e A127648   0, 0, 3;
%e A127648   0, 0, 0, 4;
%e A127648   0, 0, 0, 0, 5;
%e A127648   0, 0, 0, 0, 0, 6;
%e A127648   0, 0, 0, 0, 0, 0, 7;
%e A127648   ...
%p A127648 A127648 := proc(n)
%p A127648     for i from 0 do
%p A127648         if A000217(i) = n+1 then
%p A127648             return i ;
%p A127648         elif A000217(i) >n then
%p A127648             return 0 ;
%p A127648         end if;
%p A127648     end do;
%p A127648 end proc: # _R. J. Mathar_, Apr 23 2013
%t A127648 Flatten[Table[{n,Table[0,{n}]},{n,15}]] (* _Harvey P. Dale_, Jul 27 2011 *)
%o A127648 (Haskell)
%o A127648 a127648 n k = a127648_tabl !! n !! k
%o A127648 a127648_row n = a127648_tabl !! n
%o A127648 a127648_tabl = map reverse $ iterate (\(x:xs) -> x + 1 : 0 : xs) [1]
%o A127648 a127648_list = concat a127648_tabl
%o A127648 -- _Reinhard Zumkeller_, Jul 13 2013
%o A127648 (Python)
%o A127648 for i in range(1,15):
%o A127648     print(i, end=", ")
%o A127648     for j in range(i):
%o A127648         print("0", end=", ") # _Mohammad Saleh Dinparvar_, May 11 2020
%o A127648 (Python)
%o A127648 from math import isqrt
%o A127648 from sympy.ntheory.primetest import is_square
%o A127648 def A127648(n): return (m:=isqrt(k:=n<<1))+(k>m*(m+1)) if is_square((n<<3)+1) else 0 # _Chai Wah Wu_, Jun 09 2025
%o A127648 (Magma) [k eq n select n+1 else 0: k in [0..n], n in [0..20]]; // _G. C. Greubel_, Mar 12 2024
%o A127648 (SageMath)
%o A127648 def A127648(n): return (sqrt(9+8*n)-1)//2 if ((sqrt(9+8*n)-3)/2).is_integer() else 0
%o A127648 [A127648(n) for n in range(153)] # _G. C. Greubel_, Mar 12 2024
%o A127648 (PARI) A127648(n) = if(ispolygonal(1+n,3), (sqrtint(1+((1+n)*8))-1)/2, 0); \\ _Antti Karttunen_, Jan 19 2025
%Y A127648 Cf. A003506, A007318, A084938, A010054, A103406, A142150.
%K A127648 nonn,easy,tabl
%O A127648 0,3
%A A127648 _Gary W. Adamson_, Jan 22 2007