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.

A257797 Permutation of natural numbers: a(1) = 1, a(triangular(n)) = 1+(2*a(n-1)), a(nontriangular(n)) = 2*n, where triangular = A000217, nontriangular = A014132.

Original entry on oeis.org

1, 2, 3, 4, 6, 5, 8, 12, 10, 7, 16, 24, 20, 14, 9, 32, 48, 40, 28, 18, 13, 64, 96, 80, 56, 36, 26, 11, 128, 192, 160, 112, 72, 52, 22, 17, 256, 384, 320, 224, 144, 104, 44, 34, 25, 512, 768, 640, 448, 288, 208, 88, 68, 50, 21, 1024, 1536, 1280, 896, 576, 416, 176, 136, 100, 42, 15
Offset: 1

Views

Author

Antti Karttunen, May 18 2015

Keywords

Crossrefs

Inverse: A257798.
Cf. also a similar permutation A220347 from which this differs for the first time at n=15, where a(15) = 9, while A220347(15) = 11.
a(n) differs from A054582(n-1) for the first time at n=21, where a(21) = 13, while A054582(20) = 11.

Formula

a(1) = 1; for n > 1: if A010054(n) = 1 [when n is triangular], then a(n) = 1+(2*a(A002024(n)-1)), otherwise a(n) = 2*a(A083920(n)).