|
|
A257725
|
|
Permutation of natural numbers: a(0) = 0, a(lucky(n)) = 1 + 2*a(n-1), a(unlucky(n)) = 2*a(n), where lucky(n) = n-th lucky number A000959, unlucky(n) = n-th unlucky number A050505.
|
|
9
|
|
|
0, 1, 2, 3, 4, 6, 8, 5, 12, 7, 16, 10, 24, 9, 14, 13, 32, 20, 48, 18, 28, 17, 26, 64, 40, 11, 96, 36, 56, 34, 52, 25, 128, 15, 80, 22, 192, 33, 72, 112, 68, 104, 50, 21, 256, 30, 160, 44, 384, 49, 66, 19, 144, 224, 136, 208, 100, 42, 512, 60, 320, 88, 768, 29, 98, 132, 38, 27, 288, 65, 448, 272, 416, 41, 200, 97, 84, 1024, 120, 37
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
In other words, after a(0) = 0, if n is the k-th lucky number [i.e., n = A000959(k)], a(n) = 1 + 2*a(k-1); otherwise, when n is the k-th unlucky number [i.e., n = A050505(k)], a(n) = 2*a(k).
Because all lucky numbers are odd, it means that odd numbers occur in odd positions only (together with some even numbers, for each one of which there is a separate infinite cycle), while the even positions contain only even numbers.
|
|
LINKS
|
|
|
FORMULA
|
a(0) = 0; for n >= 1: if A145649(n) = 1 [i.e., if n is lucky], then a(n) = 1+(2*a(A109497(n)-1)), otherwise a(n) = 2*a(n-A109497(n)). [Where A109497(n) gives the number of lucky numbers <= n.]
As a composition of other permutations. For all n >= 1:
|
|
PROG
|
(Scheme, with memoizing definec-macro)
|
|
CROSSREFS
|
Cf. also A257690 (another similar permutation, but with a slightly different definition, resulting the first differing term at n=13, where a(13) = 9, while A257690(13) = 11).
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|