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!)
A163234 Inverse permutation to A163233. 4

%I #16 Mar 18 2022 21:52:34

%S 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,

%T 47,38,31,39,23,30,35,43,27,34,62,52,51,42,14,19,20,26,32,25,41,33,

%U 112,98,97,84,73,85,61,72,70,59,83,71,40,49,50,60,120,105,137,121,78

%N Inverse permutation to A163233.

%H Antti Karttunen, <a href="/A163234/b163234.txt">Table of n, a(n) for n = 0..4095</a>

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>

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

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

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

%o (Python)

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

%o def a006068(n):

%o s=1

%o while True:

%o ns=n>>s

%o if ns==0: break

%o n=n^ns

%o s<<=1

%o return n

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

%o def a059906(n):

%o x=[int(k) for k in list(bin(n)[2:])][::-1]

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

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

%o print([a(n) for n in range(101)]) # _Indranil Ghosh_, Jun 25 2017

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

%K nonn

%O 0,3

%A _Antti Karttunen_, Jul 29 2009

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 April 24 04:14 EDT 2024. Contains 371918 sequences. (Running on oeis4.)