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.

A127899 Transform related to the harmonic series.

This page as a plain text file.
%I A127899 #35 Jun 09 2025 01:05:47
%S A127899 1,-2,2,0,-3,3,0,0,-4,4,0,0,0,-5,5,0,0,0,0,-6,6,0,0,0,0,0,-7,7,0,0,0,
%T A127899 0,0,0,-8,8,0,0,0,0,0,0,0,-9,9,0,0,0,0,0,0,0,0,-10,10,0,0,0,0,0,0,0,0,
%U A127899 0,-11,11,0,0,0,0,0,0,0,0,0,0,-12,12
%N A127899 Transform related to the harmonic series.
%C A127899 This transform is the inverse of a triangle in which each row has n terms of the harmonic series; i.e., the inverse of: 1; 1, 1/2; 1, 1/2, 1/3; ...
%C A127899 Eigensequence of the unsigned triangle = A002467 starting (1, 4, 15, 76, 455, ...). - _Gary W. Adamson_, Dec 29 2008
%C A127899 Table T(n,k) read by antidiagonals. T(1,1)=1, T(n,1) = n (for n>1), T(n,2) = -n, T(n,k) = 0, k > 2. - _Boris Putievskiy_, Jan 17 2013
%H A127899 Reinhard Zumkeller, <a href="/A127899/b127899.txt">Rows n = 1..100 of triangle, flattened</a>
%H A127899 Boris Putievskiy, <a href="http://arxiv.org/abs/1212.2732">Transformations [of] Integer Sequences And Pairing Functions</a> arXiv:1212.2732 [math.CO], 2012.
%F A127899 Triangle, a(1) = 1; by rows, (n-2) zeros followed by -n, n.
%F A127899 From _Boris Putievskiy_, Jan 17 2013: (Start)
%F A127899 a(n) = floor((A002260(n)+2)/(A003056(n)+2))*(A003056(n)+1)*(-1)^(A002260(n)+A003056(n)+1),  n>0.
%F A127899 a(n) = floor((i+2)/(t+2))*(t+1)*(-1)^(i+t+1), where i=n-t*(t+1)/2, t=floor((-1+sqrt(8*n-7))/2). (End)
%F A127899 a(n) = floor(-1/2*A002024(n)^2 + A002024(n+1)^2-1/2*A002024(n+1) + 1/2*A002024(n+2) - 1/2*A002024(n+2)^2). - _Brian Tenneson_, Feb 10 2017
%e A127899 First few rows of the triangle are:
%e A127899 1;
%e A127899 -2, 2;
%e A127899 0, -3, 3;
%e A127899 0, 0, -4, 4;
%e A127899 0, 0, 0, -5, 5;
%e A127899 0, 0, 0, 0, -6, 6;
%e A127899 0, 0, 0, 0, 0, -7, 7;
%e A127899 ...
%e A127899 From _Boris Putievskiy_, Jan 17 2013: (Start)
%e A127899 The start of the sequence as table:
%e A127899 1..-1..0..0..0..0..0...
%e A127899 1..-2..0..0..0..0..0...
%e A127899 2..-3..0..0..0..0..0...
%e A127899 3..-4..0..0..0..0..0...
%e A127899 4..-5..0..0..0..0..0...
%e A127899 5..-6..0..0..0..0..0...
%e A127899 6..-7..0..0..0..0..0...
%e A127899 ...
%e A127899 The start of the sequence as triangle array read by rows:
%e A127899 1;
%e A127899 -1,1;
%e A127899 0,-2,2;
%e A127899 0,0,-3,3;
%e A127899 0,0,0,-4,4;
%e A127899 0,0,0,0,-5,5;
%e A127899 0,0,0,0,0,-6,6;
%e A127899 0,0,0,0,0,0,-7,7;
%e A127899 ...
%e A127899 Row number r (r>4) contains (r-2) times '0', then '-r' and 'r'. (End)
%p A127899 A127899 := proc(n,k)
%p A127899     if k = n then
%p A127899         n;
%p A127899     elif k = n-1 then
%p A127899         -n;
%p A127899     else
%p A127899         0;
%p A127899     end if;
%p A127899 end proc:
%p A127899 seq(seq( A127899(n,k),k=1..n),n=1..13) ; # _R. J. Mathar_, Jul 19 2024
%t A127899 Table[Module[{t = Floor[(-1 + Sqrt[8 n - 7])/2], i}, i = n - t (t + 1)/2; Floor[(i + 2)/(t + 2)] (t + 1) (-1)^(i + t + 1)], {n, 78}] (* or *)
%t A127899 Table[If[n == 1, {n}, ConstantArray[0, n - 2]~Join~{-n, n}], {n, 12}] // Flatten (* _Michael De Vlieger_, Feb 11 2017 *)
%o A127899 (Haskell)
%o A127899 a127899 n k = a127899_tabl !! (n-1) !! (k-1)
%o A127899 a127899_row n = a127899_tabl !! (n-1)
%o A127899 a127899_tabl = map reverse ([1] : xss) where
%o A127899    xss = iterate (\(u : v : ws) -> u + 1 : v - 1 : ws ++ [0]) [2, -2]
%o A127899 -- _Reinhard Zumkeller_, Nov 14 2014
%o A127899 (Python)
%o A127899 from math import isqrt
%o A127899 def A127899(n): return -(isqrt(n<<3)+1>>1)**2+(m:=isqrt(n+1<<3)+1>>1)*((m<<1)-1)+(k:=isqrt(n+2<<3)+1>>1)*(1-k)>>1 # _Chai Wah Wu_, Jun 08 2025
%Y A127899 Cf. A002467.
%K A127899 tabl,sign,easy
%O A127899 1,2
%A A127899 _Gary W. Adamson_, Feb 04 2007