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.

A185180 Enumeration table T(n,k) by antidiagonals. The order of the list is symmetrical movement from center to edges diagonal.

This page as a plain text file.
%I A185180 #35 Feb 16 2025 08:33:13
%S A185180 1,2,3,5,4,6,9,7,8,10,14,12,11,13,15,20,18,16,17,19,21,27,25,23,22,24,
%T A185180 26,28,35,33,31,29,30,32,34,36,44,42,40,38,37,39,41,43,45,54,52,50,48,
%U A185180 46,47,49,51,53,55,65,63,61,59,57,56,58,60,62,64,66,77,75
%N A185180 Enumeration table T(n,k) by antidiagonals. The order of the list is symmetrical movement from center to edges diagonal.
%C A185180 The natural numbers are grouped in chunks of 1, 2, 3, 4,... as (1), (2,3), (4,5,6), (7,8,9,10), etc and each group fills a diagonal in the table. The smallest number in a group is in A000124, the largest in A000217. Numbers in a group are placed on free spots as close as possible to the middle of the diagonal, given preference to the smaller row numbers in the table if there is a draw.
%C A185180 The resulting array is apparently a transposed version of A064789 (if this was also written as an array).
%C A185180 The order of the list table T(n,k):
%C A185180 if n is odd:
%C A185180 T (floor(n+1)/2,floor(n+1)/2), T(floor(n+1)/2-1,floor(n+1)/2+1), T(floor(n+1)/2+1,floor(n+1)/2-1),...T(1,n), T(n,1)
%C A185180 if n is even:
%C A185180 T(floor(n+1)/2-1,floor(n+1)/2+1), T(floor(n+1)/2+1,floor(n+1)/2-1),...T(1,n), T(n,1).
%C A185180 Permutation of the natural numbers.
%C A185180 a(n) is a pairing function: a function that reversibly maps Z^{+} x Z^{+} onto Z^{+}, where Z^{+} is the set of integer positive numbers.
%H A185180 Boris Putievskiy, <a href="/A185180/b185180.txt">Rows n = 1..140 of triangle, flattened</a>
%H A185180 Boris Putievskiy, <a href="http://arxiv.org/abs/1212.2732">Transformations Integer Sequences And Pairing Functions</a>, arXiv:1212.2732 [math.CO], 2012.
%H A185180 Eric W. Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PairingFunction.html">Pairing functions</a>
%H A185180 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A185180 a(n) = (i*(i+1) + (j-1)*(j+2*i-4))/2, if j<=i, a(n)=(i*(i+1) + (j-1)*(j+2*i-4))/2 +2*(j-i)-1, if j>i, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor[(-1+sqrt(8*n-7))/2].
%e A185180 The start of the sequence as table:
%e A185180   1....2....5....9...14...20...27 ...
%e A185180   3....4....7...12...18...25...33 ...
%e A185180   6....8...11...16...23...31...40 ...
%e A185180   10..13...17...22...29...38...48 ...
%e A185180   15..19...24...30...37...46...57 ...
%e A185180   21..26...32...39...47...56...67 ...
%e A185180   28..34...41...49...58...68...79 ...
%e A185180   ...
%e A185180 The start of the sequence as triangle array read by rows:
%e A185180   1;
%e A185180   2,   3;
%e A185180   5,   4,  6;
%e A185180   9,   7,  8, 10;
%e A185180   14, 12, 11, 13, 15;
%e A185180   20, 18, 16, 17, 19, 21;
%e A185180   27, 25, 23, 22, 24, 26, 28;
%e A185180 . . .
%e A185180 Row number k (k > 1) of the triangle contains a permutation of the set of k numbers from (k^2-k+2)/2, (k^2-k+2)/2 + 1 ,...up to (k^2+k-2)/2 + 1, namely (k^2+k-2)/2, (k^2+k-2)/2 -2,...,(k^2-k+2)/2, (k^2-k+2)/2 + 2,..., (k^2+k-2)/2-1, (k^2+k-2)/2+1.
%t A185180 a[n_] := Module[{i, j, t}, i = n - t(t+1)/2; j = (t^2 + 3t + 4)/2 - n; t = Floor[(-1 + Sqrt[8n - 7])/2]; If[j <= i, (i(i+1) + (j-1)(j + 2i - 4))/2, (i(i+1) + (j-1)(j + 2i - 4))/2 + 2(j-i) - 1]];
%t A185180 Array[a, 68] (* _Jean-François Alcover_, Nov 21 2018, from Python *)
%o A185180 (Python)
%o A185180 t=int((math.sqrt(8*n-7) - 1)/ 2)
%o A185180 i=n-t*(t+1)/2
%o A185180 j=(t*t+3*t+4)/2-n
%o A185180 if j<=i:
%o A185180    m=(i*(i+1) + (j-1)*(j+2*i-4))/2
%o A185180 else:
%o A185180    m=(i*(i+1) + (j-1)*(j+2*i-4))/2 +2*(j-i)-1
%Y A185180 Cf. A056011, A056023, A057027, A057028, A064578, A194981, A194982, A188568.
%K A185180 nonn,tabl
%O A185180 1,2
%A A185180 _Boris Putievskiy_, Dec 26 2012