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.

A209279 First inverse function (numbers of rows) for pairing function A185180.

This page as a plain text file.
%I A209279 #45 Feb 16 2025 08:33:16
%S A209279 1,1,2,2,1,3,2,3,1,4,3,2,4,1,5,3,4,2,5,1,6,4,3,5,2,6,1,7,4,5,3,6,2,7,
%T A209279 1,8,5,4,6,3,7,2,8,1,9,5,6,4,7,3,8,2,9,1,10,6,5,7,4,8,3,9,2,10,1,11,6,
%U A209279 7,5,8,4,9,3,10,2,11,1,12,7,6,8,5,9,4,10,3,11,2,12,1,13
%N A209279 First inverse function (numbers of rows) for pairing function A185180.
%C A209279 The triangle equals A158946 with the first column removed. - _Georg Fischer_, Jul 26 2023
%H A209279 Boris Putievskiy, <a href="/A209279/b209279.txt">Rows n = 1..140 of triangle, flattened</a>
%H A209279 Boris Putievskiy, <a href="http://arxiv.org/abs/1212.2732">Transformations Integer Sequences And Pairing Functions</a>, arXiv:1212.2732 [math.CO], 2012.
%H A209279 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PairingFunction.html">Pairing functions</a>
%F A209279 a(n) = floor((A003056(n)+2)/2)+ floor(A002260(n)/2)*(-1)^(A002260(n)+A003056(n)+1).
%F A209279 a(n) = |A128180(n)|.
%F A209279 a(n) = floor((t+2)/2) + floor(i/2)*(-1)^(i+t+1), where t=floor((-1+sqrt(8*n-7))/2), i=n-t*(t+1)/2.
%F A209279 T(r,2s)=s, T(r,2s-1)= r+s-1.(When read as table T(r,s) by antidiagonals.)
%F A209279 T(n,k) = ceiling((n + (-1)^(n-k)*k)/2) = (n+k)/2 if n-k even, otherwise (n-k+1)/2. - _M. F. Hasler_, May 30 2020
%e A209279 The start of the sequence as table T(r,s) r,s >0 read by antidiagonals:
%e A209279   1...1...2...2...3...3...4...4...
%e A209279   2...1...3...2...4...3...5...4...
%e A209279   3...1...4...2...5...3...6...4...
%e A209279   4...1...5...2...6...3...7...4...
%e A209279   5...1...6...2...7...3...8...4...
%e A209279   6...1...7...2...8...3...9...4...
%e A209279   7...1...8...2...9...3..10...4...
%e A209279   ...
%e A209279 The start of the sequence as triangle array read by rows:
%e A209279   1;
%e A209279   1, 2;
%e A209279   2, 1, 3;
%e A209279   2, 3, 1, 4;
%e A209279   3, 2, 4, 1, 5;
%e A209279   3, 4, 2, 5, 1, 6;
%e A209279   4, 3, 5, 2, 6, 1, 7;
%e A209279   4, 5, 3, 6, 2, 7, 1, 8;
%e A209279   ...
%e A209279 Row number r contains permutation numbers form 1 to r.
%e A209279 If r is odd (r+1)/2, (r+1)/2-1, (r+1)/2+1,...r-1, 1, r.
%e A209279 If r is even r/2, r/2+1, r/2-1, ... r-1, 1, r.
%t A209279 T[n_, k_] := Abs[(2*k - 1 + (-1)^(n - k)*(2*n + 1))/4];
%t A209279 Table[T[n, k], {n, 1, 15}, {k, 1, n}] // Flatten (* _Jean-François Alcover_, Jun 14 2018, after _Andrew Howroyd_ *)
%o A209279 (PARI) T(n, k)=abs((2*k-1+(-1)^(n-k)*(2*n+1))/4) \\ _Andrew Howroyd_, Dec 31 2017
%o A209279 (Python) # Edited by _M. F. Hasler_, May 30 2020
%o A209279 def a(n):
%o A209279    t = int((math.sqrt(8*n-7) - 1)/2);
%o A209279    i = n-t*(t+1)/2;
%o A209279    return int(t/2)+1+int(i/2)*(-1)**(i+t+1)
%Y A209279 Cf. A158946, A185180, A128180, A092542, A092543, A209278.
%K A209279 nonn,tabl
%O A209279 1,3
%A A209279 _Boris Putievskiy_, Jan 15 2013
%E A209279 Data corrected by _Andrew Howroyd_, Dec 31 2017