|
|
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.
|
|
3
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
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)).
|
|
PROG
|
(Scheme, with memoizing definec-macro)
|
|
CROSSREFS
|
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.
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|