login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A266417
a(1) = 1; for n > 1, if A192490(2n+1) = 1 [when 2n+1 is Ludic number] a(n) = 1 + 2*a(A266350(n)-1), otherwise a(n) = 2*a(n-A266350(n)).
4
1, 3, 7, 2, 15, 5, 6, 31, 14, 4, 11, 13, 30, 63, 10, 12, 62, 29, 28, 9, 23, 8, 27, 22, 26, 61, 60, 126, 20, 127, 24, 124, 21, 58, 25, 56, 18, 125, 46, 16, 59, 54, 44, 57, 19, 52, 122, 47, 120, 252, 40, 254, 17, 48, 248, 42, 55, 116, 45, 53, 50, 112, 123, 36, 121, 250, 92, 32, 118, 108, 253, 88, 114, 41, 38
OFFSET
1,2
FORMULA
a(1) = 1; for n > 1, if A192490(2*n + 1) = 1 [when 2n+1 is Ludic number] a(n) = 1 + 2*a(A266350(n)-1), otherwise a(n) = 2*a(n-A266350(n)).
As a composition of related permutations:
a(n) = A237427(A266637(n)).
PROG
(Scheme, with memoization-macro definec)
(definec (A266417 n) (cond ((<= n 1) n) ((zero? (A192490 (+ n n 1))) (* 2 (A266417 (- n (A266350 n))))) (else (+ 1 (* 2 (A266417 (+ -1 (A266350 n))))))))
CROSSREFS
Inverse: A266418.
Similar or related permutations: A237427, A266637.
Sequence in context: A222070 A163917 A377558 * A260433 A243343 A255565
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jan 28 2016
STATUS
approved