login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A163234 Inverse permutation of A163233. 4
0, 1, 2, 4, 6, 3, 11, 7, 9, 13, 5, 8, 24, 18, 17, 12, 28, 21, 37, 29, 10, 15, 16, 22, 58, 48, 47, 38, 31, 39, 23, 30, 35, 43, 27, 34, 62, 52, 51, 42, 14, 19, 20, 26, 32, 25, 41, 33, 112, 98, 97, 84, 73, 85, 61, 72, 70, 59, 83, 71, 40, 49, 50, 60, 120, 105, 137, 121, 78 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

LINKS

A. Karttunen, Table of n, a(n) for n = 0..4095

Index entries for sequences that are permutations of the natural numbers

FORMULA

a(n) = A001477bi(A006068(A059905(n)),A006068(A059906(n))), where A001477bi(x,y) = (((x+y)^2)+x+(3y))/2.

PROG

(Scheme:) (define (A163234 n) (A001477bi (A006068 (A059905 n)) (A006068 (A059906 n))))

(define (A001477bi x y) (/ (+ (expt (+ x y) 2) x (* 3 y)) 2))

(Python)

def A(x, y): return (((x + y)**2) + x + 3*y)/2

def a006068(n):

    s=1

    while True:

        ns=n>>s

        if ns==0: break

        n=n^ns

        s<<=1

    return n

def a059905(n): return sum([(n>>2*i&1)<<i for i in range(int(len(bin(n)[2:])/2) + 1)])

def a059906(n):

    x=map(int, list(bin(n)[2:]))[::-1]

return sum([x[2*i + 1]*2**i for i in range(int(len(x)/2))])

def a(n): return A(a006068(a059905(n)), a006068(a059906(n)))

print [a(n) for n in range(101)] # Indranil Ghosh, Jun 25 2017

CROSSREFS

Inverse: A163233. a(n) = A163236(A057300(n)). Cf. A163236.

Sequence in context: A108236 A002849 A329492 * A072984 A317310 A231655

Adjacent sequences:  A163231 A163232 A163233 * A163235 A163236 A163237

KEYWORD

nonn

AUTHOR

Antti Karttunen, Jul 29 2009

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 July 9 22:38 EDT 2020. Contains 335547 sequences. (Running on oeis4.)