login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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)
(definec (A257797 n) (cond ((<= n 1) n) ((zero? (A010054 n)) (* 2 (A257797 (A083920 n)))) (else (+ 1 (* 2 (A257797 (+ -1 (A002024 n))))))))
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.
Sequence in context: A080997 A151942 A054582 * A220347 A099884 A191446
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 18 2015
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 7 00:25 EDT 2024. Contains 372298 sequences. (Running on oeis4.)