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!)
A145342 a(n) = (A145341(n) + 1)/2. 3
1, 2, 3, 4, 5, 7, 6, 8, 9, 13, 11, 15, 10, 14, 12, 16, 17, 25, 21, 29, 19, 27, 23, 31, 18, 26, 22, 30, 20, 28, 24, 32, 33, 49, 41, 57, 37, 53, 45, 61, 35, 51, 43, 59, 39, 55, 47, 63, 34, 50, 42, 58, 38, 54, 46, 62, 36, 52, 44, 60, 40, 56, 48, 64, 65, 97, 81, 113, 73, 105, 89 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
This sequence is a permutation of the positive integers. It is its own inverse permutation.
Fixed points of the permutation are the terms of A044051. - Ivan Neretin, Oct 31 2015
From Yosu Yurramendi, Feb 04 2019: (Start)
If the terms (n > 0) are written as an array (left-aligned fashion) with rows of length 2^m, m = 0,1,2,3,...
1;
2, 3;
4, 5, 7, 6;
8, 9, 13, 11, 15, 10, 14, 12;
16, 17, 25, 21, 29, 19, 27, 23, 31, 18, 26, 22, 30, 20, 28, 24;
32, 33, 49, 41, 57, 37, 53, 45, 61, 35, 51, 43, 59, 39, 55, 47, 63, 34, ...
then the following relationship can be observed:
a(1) = 1, a(2) = 2, a(3) = 3,
for m > 0, a(2^(m+1)) = 2*a(2^m), a(2^m + 1) = a(2^m) + 1, a(2^(m+1)+ 2^m) = 2*a(2^(m+1)) - 1, for 0 < k < 2^m, a(2^(m+1)+ k) = 2*a(2^m + k) - 1, a(2^(m+1)+ 2^m + k) = a(2^(m+1) + k) + 1
(End)
LINKS
MATHEMATICA
Table[(FromDigits[Reverse[IntegerDigits[2n-1, 2]], 2] +1)/2, {n, 71}] (* Ivan Neretin, Oct 31 2015 *)
PROG
(R)
nmax <- 10^3 # by choice
b <- vector()
for (o in seq(1, nmax, 2)){
w <- which(as.numeric(intToBits(o))==1)
b <- c(b, sum(2^(max(w)-w)))
}
a <- (b+1)/2
a[1:71]
# Yosu Yurramendi, Feb 04 2019
(PARI) a(n) = (1+fromdigits(Vecrev(binary(2*n-1)), 2))/2; \\ Michel Marcus, Feb 04 2019
CROSSREFS
Sequence in context: A269392 A166277 A344009 * A248918 A318936 A088750
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Oct 08 2008
EXTENSIONS
More terms from R. J. Mathar and Ray Chandler, Oct 10 2008
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 19 14:10 EDT 2024. Contains 371792 sequences. (Running on oeis4.)