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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A243071 Permutation of nonnegative integers: a(1) = 0, a(2) = 1, a(2n) = 2*a(n), a(2n+1) = 1 + 2*a(A064989(2n+1)). 46
0, 1, 3, 2, 7, 6, 15, 4, 5, 14, 31, 12, 63, 30, 13, 8, 127, 10, 255, 28, 29, 62, 511, 24, 11, 126, 9, 60, 1023, 26, 2047, 16, 61, 254, 27, 20, 4095, 510, 125, 56, 8191, 58, 16383, 124, 25, 1022, 32767, 48, 23, 22, 253, 252, 65535, 18, 59, 120, 509, 2046, 131071 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

Note the indexing: the domain starts from 1, while the range includes also zero.

See also the comments at A163511, which is the inverse permutation to this one.

LINKS

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

Index entries for sequences that are permutations of the natural numbers

FORMULA

a(1) = 0, a(2) = 1, a(2n) = 2*a(n), a(2n+1) = 1 + 2*a(A064989(2n+1)).

For n >= 1, a(A000040(n)) = A000225(n).

For n >= 1, a(2n+1) = 1 + 2*a(A064216(n+1)).

PROG

(Scheme, with memoizing definec-macro from Antti Karttunen's IntSeq-library)

(definec (A243071 n) (cond ((<= n 2) (- n 1)) ((even? n) (* 2 (A243071 (/ n 2)))) (else (+ 1 (* 2 (A243071 (A064989 n)))))))

(Python)

from sympy import factorint, prevprime

from operator import mul

def a064989(n):

    f=factorint(n)

    return 1 if n==1 else reduce(mul, [1 if i==2 else prevprime(i)**f[i] for i in f])

def a(n): return n - 1 if n<3 else 2*a(n/2) if n%2==0 else 1 + 2*a(a064989(n))

print [a(n) for n in xrange(1, 101)] # Indranil Ghosh, Jun 15 2017

CROSSREFS

Inverse: A163511.

Cf. A000040, A000225, A064989, A064216.

Sequence in context: A056481 A269386 A252756 * A286556 A243354 A321184

Adjacent sequences:  A243068 A243069 A243070 * A243072 A243073 A243074

KEYWORD

nonn

AUTHOR

Antti Karttunen, Jun 20 2014

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 February 15 22:28 EST 2019. Contains 320138 sequences. (Running on oeis4.)