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.

A064789 Inverse permutation to A057028.

Original entry on oeis.org

1, 3, 2, 6, 4, 5, 10, 8, 7, 9, 15, 13, 11, 12, 14, 21, 19, 17, 16, 18, 20, 28, 26, 24, 22, 23, 25, 27, 36, 34, 32, 30, 29, 31, 33, 35, 45, 43, 41, 39, 37, 38, 40, 42, 44, 55, 53, 51, 49, 47, 46, 48, 50, 52, 54, 66, 64, 62, 60, 58, 56, 57, 59, 61, 63, 65, 78, 76, 74, 72, 70, 68
Offset: 1

Views

Author

N. J. A. Sloane, Oct 20 2001

Keywords

Examples

			If viewed as a regular triangle:
  1;
  3,  2;
  6,  4,  5;
 10,  8,  7,  9;
 15, 13, 11, 12, 14;
 21, 19, 17, 16, 18, 20;
 28, 26, 24, 22, 23, 25, 27;
 36, 34, 32, 30, 29, 31, 33, 35;
 45, 43, 41, 39, 37, 38, 40, 42, 44;
 55, 53, 51, 49, 47, 46, 48, 50, 52, 54;
 66, 64, 62, 60, 58, 56, 57, 59, 61, 63, 65;
 78, 76, 74, 72, 70, 68...
		

Programs

  • PARI
    a(n) = my(k=floor((sqrt(8*n)-1)/2)); my(m=2*(n-1)-k*(k+2)); k*(k+1)/2+abs(m)+(m<=0);
    for(n=1, 32,  print(n ", ", a(n))) \\ Gerhard Ramsebner, Nov 10 2024

Formula

a(n) = k*(k+1)/2 + abs(m) + [m<=0] where k=floor((sqrt(8*n)-1)/2), m=2*(n-1)-k*(k+2) and [] is the Iverson bracket. - Gerhard Ramsebner, Nov 10 2024

Extensions

More terms from David Wasserman, Aug 14 2002