login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A268711 Permutation of natural numbers: a(1) = 1, a(A268677(n)) = 2*a(n), a(A268678(n+1)) = 1+(2*a(n)). 3
1, 2, 3, 5, 7, 4, 11, 15, 6, 10, 9, 14, 8, 22, 23, 31, 30, 13, 21, 19, 12, 29, 17, 20, 18, 45, 47, 28, 16, 44, 63, 61, 46, 27, 62, 43, 39, 60, 26, 25, 59, 35, 42, 38, 24, 58, 41, 37, 34, 91, 40, 95, 57, 36, 90, 33, 89, 94, 127, 123, 56, 32, 88, 93, 55, 125, 126, 122, 87, 79, 92, 121, 54, 53, 51, 124, 86, 78, 120 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

Antti Karttunen, Table of n, a(n) for n = 1..16384

Index entries for sequences that are permutations of the natural numbers

FORMULA

a(1) = 1, for n > 1: if A268680(n) = A268680(n-1) [when n is in A268677] a(n) = 2*a(n-A268680(n)), otherwise [when n is in A268678] a(n) = 1 + 2*a(A268680(n)-1).

PROG

(Scheme, with memoization-macro definec)

(definec (A268711 n) (cond ((= 1 n) n) ((zero? (- (A268680 n) (A268680 (- n 1)))) (* 2 (A268711 (- n (A268680 n))))) (else (+ 1 (* 2 (A268711 (- (A268680 n) 1)))))))

CROSSREFS

Inverse: A268712.

Cf. A268677, A268678, A268680.

Sequence in context: A273665 A212646 A103866 * A191439 A191723 A292874

Adjacent sequences:  A268708 A268709 A268710 * A268712 A268713 A268714

KEYWORD

nonn

AUTHOR

Antti Karttunen, Feb 11 2016

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 12:04 EDT 2019. Contains 322456 sequences. (Running on oeis4.)