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 A257690 #8 May 10 2015 10:59:52 %S A257690 1,2,3,4,6,8,5,12,7,16,10,24,11,14,15,32,20,48,22,28,9,30,64,40,23,96, %T A257690 44,56,18,60,13,128,31,80,46,192,19,88,112,36,120,26,47,256,62,160,92, %U A257690 384,21,38,27,176,224,72,240,52,94,512,124,320,184,768,29,42,76,54,63,352,39,448,144,480,95,104,43,188,1024,248,55 %N A257690 Permutation of natural numbers: a(1) = 1, a(lucky(n)) = (2*a(n))-1, a(unlucky(n)) = 2*n, where lucky(n) = n-th lucky number A000959, unlucky(n) = n-th unlucky number A050505. %H A257690 Antti Karttunen, <a href="/A257690/b257690.txt">Table of n, a(n) for n = 1..10000</a> %H A257690 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A257690 a(1) = 1; for n > 1: if A145649(n) = 1 [i.e., if n is lucky], then a(n) = (2*a(A109497(n)))-1, otherwise a(n) = 2*a(n-A109497(n)). [Where A109497(n) gives the number of lucky numbers <= n.] %o A257690 (Scheme, with memoizing definec-macro) %o A257690 (definec (A257690 n) (cond ((= 1 n) n) ((= 1 (A145649 n)) (+ -1 (* 2 (A257690 (A109497 n))))) (else (* 2 (A257690 (- n (A109497 n))))))) %Y A257690 Inverse permutation: A183089. %Y A257690 Cf. A005408, A005843, A000959, A050505, A109497, A145649. %Y A257690 Cf. also A257725 (similar permutation with a slightly different definition, resulting the first differing term at n=13, where a(13) = 11, while A257725(13) = 9). %Y A257690 Cf. also A257735 - A257738. %K A257690 nonn %O A257690 1,2 %A A257690 _Antti Karttunen_, May 09 2015