cp's OEIS Frontend

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.

A257726 a(0)=0; a(2n) = unlucky(a(n)), a(2n+1) = lucky(a(n)+1), where lucky = A000959, unlucky = A050505.

This page as a plain text file.
%I A257726 #25 Sep 13 2015 05:10:41
%S A257726 0,1,2,3,4,7,5,9,6,13,11,25,8,15,14,33,10,21,19,51,17,43,35,115,12,31,
%T A257726 22,67,20,63,45,163,16,37,29,93,27,79,66,273,24,73,57,223,47,171,146,
%U A257726 723,18,49,42,151,30,99,88,385,28,87,83,349,59,235,203,1093,23,69,50,193,40,135,119,559,38,129,102,475,86,367,335,1983,34,111
%N A257726 a(0)=0; a(2n) = unlucky(a(n)), a(2n+1) = lucky(a(n)+1), where lucky = A000959, unlucky = A050505.
%C A257726 This sequence can be represented as a binary tree. Each left hand child is produced as A050505(n), and each right hand child as A000959(1+n), when a parent contains n >= 1:
%C A257726                                     0
%C A257726                                     |
%C A257726                  ...................1...................
%C A257726                 2                                       3
%C A257726       4......../ \........7                   5......../ \........9
%C A257726      / \                 / \                 / \                 / \
%C A257726     /   \               /   \               /   \               /   \
%C A257726    /     \             /     \             /     \             /     \
%C A257726   6       13         11       25          8       15         14       33
%C A257726 10 21   19  51     17  43   35  115     12 31   22  67     20  63   45  163
%C A257726 etc.
%C A257726 Because all lucky numbers are odd, it means that even terms can only occur in even positions (together with odd unlucky numbers, for each one of which there is a separate infinite cycle), while terms in odd positions are all odd.
%H A257726 Antti Karttunen, <a href="/A257726/b257726.txt">Table of n, a(n) for n = 0..512</a>
%H A257726 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A257726 a(0)=0; after which, a(2n) = A050505(a(n)), a(2n+1) = A000959(a(n)+1).
%F A257726 As a composition of other permutations. For all n >= 1:
%F A257726 a(n) = A257731(A246378(n)).
%F A257726 a(n) = A257733(A237126(n)).
%F A257726 a(n) = A257801(A257728(n)).
%o A257726 (Scheme, with memoizing definec-macro)
%o A257726 (definec (A257726 n) (cond ((zero? n) n) ((even? n) (A050505 (A257726 (/ n 2)))) (else (A000959 (+ 1 (A257726 (/ (- n 1) 2)))))))
%Y A257726 Inverse: A257725.
%Y A257726 Cf. A000959, A050505, A005408, A005843.
%Y A257726 Related or similar permutations: A237126, A246378, A257728, A257731, A257733, A257801.
%Y A257726 Cf. also A183089 (another similar permutation, but with a slightly different definition, resulting the first differing term at n=9, where a(9) = 13, while A183089(9) = 21).
%Y A257726 Cf. also A257735 - A257738.
%K A257726 nonn,tabf
%O A257726 0,3
%A A257726 _Antti Karttunen_, May 06 2015