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.

A185725 Array associated with squares, by antidiagonals.

Original entry on oeis.org

1, 2, 3, 5, 4, 6, 10, 7, 8, 11, 17, 12, 9, 13, 18, 26, 19, 14, 15, 20, 27, 37, 28, 21, 16, 22, 29, 38, 50, 39, 30, 23, 24, 31, 40, 51, 65, 52, 41, 32, 25, 33, 42, 53, 66, 82, 67, 54, 43, 34, 35, 44, 55, 68, 83, 101, 84, 69, 56, 45, 36, 46, 57, 70, 85, 102, 122, 103, 86, 71, 58, 47, 48, 59, 72, 87, 104, 123, 145, 124, 105, 88, 73, 60, 49, 61, 74, 89, 106, 125, 146, 170, 147, 126, 107, 90, 75, 62, 63, 76, 91, 108, 127, 148, 171
Offset: 1

Views

Author

Clark Kimberling, Feb 01 2011

Keywords

Comments

Every positive integer occurs exactly once; hence, as a sequence, A185725 is a permutation of the positive integers. The square with corners T(0,0)=1 and T(n,n)=n^2 is occupied by the numbers 1,2,...,n^2.

Examples

			Northwest corner:
1...2...5...10...17
3...4...7...12...19
6...8...9...14...21
11..13..15..16...23
		

Crossrefs

Programs

  • Mathematica
    f[n_,k_]:=(k-1)^2+2*n-1/; n<=k;
    f[n_,k_]:=(n-1)^2+2*k/; n>k;
    TableForm[Table[f[n,k],{n,1,10},{k,1,15}]]
    Table[f[n-k+1,k],{n,14},{k,n,1,-1}]//Flatten

Formula

T(n,k)=(k-1)^2+2n-1 if n<=k; T(n,k)=(n-1)^2+2k if n>k.