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.

A213195 Second inverse function (of columns) for pairing function A211377.

This page as a plain text file.
%I A213195 #24 Feb 16 2025 08:33:17
%S A213195 1,3,2,1,2,1,5,4,3,4,3,2,1,2,1,7,6,5,6,5,4,3,4,3,2,1,2,1,9,8,7,8,7,6,
%T A213195 5,6,5,4,3,4,3,2,1,2,1,11,10,9,10,9,8,7,8,7,6,5,6,5,4,3,4,3,2,1,2,1,
%U A213195 13,12,11,12,11,10,9,10,9,8,7,8,7,6,5,6,5,4,3,4,3,2,1,2,1
%N A213195 Second inverse function (of columns) for pairing function A211377.
%H A213195 Boris Putievskiy, <a href="/A213195/b213195.txt">Rows n = 1..140 of triangle, flattened</a>
%H A213195 Boris Putievskiy, <a href="http://arxiv.org/abs/1212.2732">Transformations [of] Integer Sequences And Pairing Functions</a> arXiv:1212.2732 [math.CO], 2012.
%H A213195 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PairingFunction.html">Pairing functions</a>
%H A213195 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A213195 See Python program.
%e A213195 The start of the sequence as triangle array read by rows:
%e A213195   1;
%e A213195   3,2;
%e A213195   1,2,1;
%e A213195   5,4,3,4;
%e A213195   3,2,1,2,1;
%e A213195   7,6,5,6,5,4;
%e A213195   3,4,3,2,1,2,1;
%e A213195   . . .
%e A213195 The start of the sequence as array read by rows, the length of row r is 4*r-3.
%e A213195 First 2*r-2 numbers are from the row number 2*r-2 of above triangle array.
%e A213195 Last  2*r-1 numbers are from the row number 2*r-1 of above triangle array.
%e A213195   1;
%e A213195   3,2,1,2,1;
%e A213195   5,4,3,4,3,2,1,2,1;
%e A213195   7,6,5,6,5,4,3,4,3,2,1,2,1;
%e A213195   ...
%e A213195 Row number r is 2*r-1, 2*r-2, 2*r-3, 2*r-2, {row number r-1}.
%o A213195 (Python)
%o A213195 t=int((math.sqrt(8*n-7) - 1)/ 2)
%o A213195 i=n-t*(t+1)/2
%o A213195 j=(t*t+3*t+4)/2-n
%o A213195 result=((1+(-1)**i)*((1+(-1)**j)*2*int((j+2)/4)-(-1+(-1)**j)*(2*int((i+4)/4)+2*int(j/2)))-(-1+(-1)**i)*((1+(-1)**j)*(1+2*int(i/4)+2*int(j/2))-(-1+(-1)**j)*(1+2*int(j/4))))/4
%Y A213195 Cf. A211377.
%K A213195 nonn,tabl
%O A213195 1,2
%A A213195 _Boris Putievskiy_, Mar 01 2013