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!)
A284120 Permutation of the positive integers: a(n) = A258746(A117120(n)) = A117120(A258746(n)) 2
1, 2, 3, 4, 5, 6, 7, 9, 8, 11, 10, 13, 12, 15, 14, 18, 19, 16, 17, 22, 23, 20, 21, 26, 27, 24, 25, 30, 31, 28, 29, 37, 36, 39, 38, 33, 32, 35, 34, 45, 44, 47, 46, 41, 40, 43, 42 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
The permutation is self-inverse. Except for fixed points 1, 2, 3, 4, 5, 6, 7 it consists completely of 2-cycles: (10,11), (12,13), (14,15), (16,18), (17,19), (20,22), (21,23), (24,26), (25,27), (28,30), (29,31), (32,37), (33,36), (34,39), (35,38), (45,40), ...
{A000027, A258746, A117120, a = A258746(A117120)} form a Klein 4-group.
LINKS
MATHEMATICA
A[n_]:= If[n<4, n, If[EvenQ[n], 2A[n/2] + 1, 2A[(n - 1)/2]]]; a[n_]:= If[n<4, n, If[OddQ[Floor[Log2[n]]], If[EvenQ[n], 2a[n/2], 2a[(n - 1)/2] + 1], If[EvenQ[n], 2a[n/2] + 1, 2a[(n - 1)/2]]]]; Table[a[A[n]], {n, 50}] (* Indranil Ghosh, Mar 21 2017 *)
PROG
(R)
maxrow <- 6 # by choice
a <- 1:7
for(m in 2:maxrow) for(k in 0:(2^m-1)) {
if(m%%2 == 0) {a[2^(m+1)+2*k ] <- 2*a[2^m+k]+1
a[2^(m+1)+2*k+1] <- 2*a[2^m+k] }
else {a[2^(m+1)+2*k ] <- 2*a[2^m+k]
a[2^(m+1)+2*k+1] <- 2*a[2^m+k]+1}
}
a
(PARI)
A(n) = if(n<4, n, if(n%2, 2*A(n\2), 2*A(n/2)+1));
a(n) = if(n<4, n, if(logint(n, 2)%2, if(n%2, 2*a(n\2) + 1, 2*a(n/2)), if(n%2, 2*a(n\2), 2*a(n/2) + 1)));
for(n=1, 50, print1(a(A(n)), ", ")) \\ Indranil Ghosh, Mar 21 2017, modified by Charles R Greathouse IV
CROSSREFS
Sequence in context: A294660 A180198 A180199 * A183081 A140595 A187098
KEYWORD
nonn
AUTHOR
Yosu Yurramendi, Mar 20 2017
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 April 25 01:35 EDT 2024. Contains 371964 sequences. (Running on oeis4.)