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.

A234027 Self-inverse permutation of nonnegative integers, A054429-conjugate of blue code: a(n) = A054429(A193231(A054429(n))).

Original entry on oeis.org

0, 1, 3, 2, 4, 5, 7, 6, 15, 14, 12, 13, 10, 11, 9, 8, 22, 23, 21, 20, 19, 18, 16, 17, 25, 24, 26, 27, 28, 29, 31, 30, 53, 52, 54, 55, 48, 49, 51, 50, 58, 59, 57, 56, 63, 62, 60, 61, 36, 37, 39, 38, 33, 32, 34, 35, 43, 42, 40, 41, 46, 47, 45, 44, 64, 65, 67, 66
Offset: 0

Views

Author

Antti Karttunen, Dec 28 2013

Keywords

Crossrefs

Programs

  • Python
    def a065621(n): return n^(2*(n - (n&-n)))
    def a048724(n): return n^(2*n)
    def a054429(n): return 1 if n==1 else 2*a054429(int(n/2)) + 1 - n%2
    def a193231(n):
        if n<2: return n
        if n%2==0: return a048724(a193231(n/2))
        else: return a065621(1 + a193231((n - 1)/2))
    def a(n): return n if n<2 else a054429(a193231(a054429(n))) # Indranil Ghosh, Jun 05 2017
  • Scheme
    (define (A234027 n) (A054429 (A193231 (A054429 n))))
    

Formula

a(n) = A054429(A193231(A054429(n))).
a(n) = A234025(A054429(n)).
a(n) = A054429(A234026(n)).
a(n) = A059894(A234024(A059894(n))).