|
|
A257726
|
|
a(0)=0; a(2n) = unlucky(a(n)), a(2n+1) = lucky(a(n)+1), where lucky = A000959, unlucky = A050505.
|
|
10
|
|
|
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, 22, 67, 20, 63, 45, 163, 16, 37, 29, 93, 27, 79, 66, 273, 24, 73, 57, 223, 47, 171, 146, 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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
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:
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 22 67 20 63 45 163
etc.
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.
|
|
LINKS
|
|
|
FORMULA
|
a(0)=0; after which, a(2n) = A050505(a(n)), a(2n+1) = A000959(a(n)+1).
As a composition of other permutations. For all n >= 1:
|
|
PROG
|
(Scheme, with memoizing definec-macro)
|
|
CROSSREFS
|
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).
|
|
KEYWORD
|
nonn,tabf
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|