This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A145342 #36 Apr 09 2019 05:10:08 %S A145342 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, %T A145342 22,30,20,28,24,32,33,49,41,57,37,53,45,61,35,51,43,59,39,55,47,63,34, %U A145342 50,42,58,38,54,46,62,36,52,44,60,40,56,48,64,65,97,81,113,73,105,89 %N A145342 a(n) = (A145341(n) + 1)/2. %C A145342 This sequence is a permutation of the positive integers. It is its own inverse permutation. %C A145342 Fixed points of the permutation are the terms of A044051. - _Ivan Neretin_, Oct 31 2015 %C A145342 From _Yosu Yurramendi_, Feb 04 2019: (Start) %C A145342 If the terms (n > 0) are written as an array (left-aligned fashion) with rows of length 2^m, m = 0,1,2,3,... %C A145342 1; %C A145342 2, 3; %C A145342 4, 5, 7, 6; %C A145342 8, 9, 13, 11, 15, 10, 14, 12; %C A145342 16, 17, 25, 21, 29, 19, 27, 23, 31, 18, 26, 22, 30, 20, 28, 24; %C A145342 32, 33, 49, 41, 57, 37, 53, 45, 61, 35, 51, 43, 59, 39, 55, 47, 63, 34, ... %C A145342 then the following relationship can be observed: %C A145342 a(1) = 1, a(2) = 2, a(3) = 3, %C A145342 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 %C A145342 (End) %H A145342 Ivan Neretin, <a href="/A145342/b145342.txt">Table of n, a(n) for n = 1..8192</a> %H A145342 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %t A145342 Table[(FromDigits[Reverse[IntegerDigits[2n-1, 2]], 2] +1)/2, {n, 71}] (* _Ivan Neretin_, Oct 31 2015 *) %o A145342 (R) %o A145342 nmax <- 10^3 # by choice %o A145342 b <- vector() %o A145342 for (o in seq(1,nmax,2)){ %o A145342 w <- which(as.numeric(intToBits(o))==1) %o A145342 b <- c(b, sum(2^(max(w)-w))) %o A145342 } %o A145342 a <- (b+1)/2 %o A145342 a[1:71] %o A145342 # _Yosu Yurramendi_, Feb 04 2019 %o A145342 (PARI) a(n) = (1+fromdigits(Vecrev(binary(2*n-1)), 2))/2; \\ _Michel Marcus_, Feb 04 2019 %Y A145342 Cf. A044051, A145341. %K A145342 base,nonn %O A145342 1,2 %A A145342 _Leroy Quet_, Oct 08 2008 %E A145342 More terms from _R. J. Mathar_ and _Ray Chandler_, Oct 10 2008