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.

Showing 1-5 of 5 results.

A268934 Permutation of nonnegative integers: a(0) = 0, for n >= 1, a(n) = 1 + A268832(A268718(n)-1).

Original entry on oeis.org

0, 1, 3, 2, 7, 6, 4, 5, 19, 11, 14, 12, 8, 10, 13, 9, 27, 35, 38, 36, 32, 34, 37, 33, 20, 22, 17, 21, 31, 15, 18, 16, 43, 51, 54, 52, 48, 50, 53, 49, 68, 70, 65, 69, 47, 63, 66, 64, 28, 30, 25, 29, 55, 23, 26, 24, 67, 59, 62, 60, 56, 58, 61, 57, 75, 83, 86, 84, 80, 82, 85, 81, 100, 102, 97, 101, 79, 95, 98, 96, 124
Offset: 0

Views

Author

Antti Karttunen, Feb 16 2016

Keywords

Comments

The seventh "shifted power" of A268718.

Crossrefs

Inverse: A268933.
Row 7 of A268830.

Programs

Formula

a(0) = 0, for n >= 1, a(n) = 1 + A268832(A268718(n)-1).

A268718 Permutation of natural numbers: a(0) = 0, a(n) = 1 + A003188(A006068(n)-1), where A003188 is binary Gray code and A006068 is its inverse.

Original entry on oeis.org

0, 1, 4, 2, 6, 8, 3, 7, 10, 12, 15, 11, 5, 13, 16, 14, 18, 20, 23, 19, 29, 21, 24, 22, 9, 25, 28, 26, 30, 32, 27, 31, 34, 36, 39, 35, 45, 37, 40, 38, 57, 41, 44, 42, 46, 48, 43, 47, 17, 49, 52, 50, 54, 56, 51, 55, 58, 60, 63, 59, 53, 61, 64, 62, 66, 68, 71, 67, 77, 69, 72, 70, 89, 73, 76, 74, 78, 80, 75, 79, 113, 81
Offset: 0

Views

Author

Antti Karttunen, Feb 12 2016

Keywords

Crossrefs

Inverse: A268717.
Row 1 of array A268830.
Cf. A092246 (fixed points).
Cf. A268818 ("square" of this permutation).
Cf. A268822 ("shifted square"), A268824 ("shifted cube") and also A268826, A268828 and A268832 (higher "shifted powers").

Programs

  • Mathematica
    {0}~Join~Table[1 + BitXor[#, Floor[#/2]] &[BitXor @@ Table[Floor[n/2^m], {m, 0, Floor[Log[2, n]]}] - 1], {n, 81}] (* Michael De Vlieger, Feb 29 2016, after Jean-François Alcover at A006068 and Robert G. Wilson v at A003188 *)
  • PARI
    a003188(n)=bitxor(n, n>>1);
    a006068(n)= {
        my( s=1, ns );
        while ( 1,
            ns = n >> s;
            if ( 0==ns, break() );
            n = bitxor(n, ns);
            s <<= 1;
        );
        return (n);
    } \\ by Joerg Arndt
    a(n)=if(n==0, 0, 1 + a003188(a006068(n) - 1)); \\ Indranil Ghosh, Jun 07 2017
    
  • Python
    def a003188(n): return n^(n>>1)
    def a006068(n):
        s=1
        while True:
            ns=n>>s
            if ns==0: break
            n=n^ns
            s<<=1
        return n
    def a(n): return 0 if n==0 else 1 + a003188(a006068(n) - 1) # Indranil Ghosh, Jun 07 2017
  • Scheme
    (define (A268718 n) (if (zero? n) n (A105081 (A006068 n))))
    

Formula

a(0) = 0, and for n >= 1, a(n) = A105081(A006068(n)) = 1 + A003188(A006068(n)-1).
Other identities. For all n >= 1:
a(A128309(n)) = A128309(n)+2. [Maps any even odious number to that number + 2.]
From Alan Michael Gómez Calderón, May 29 2025: (Start)
a(n) - 1 = A268717(n+1) XOR (A171977(n)+1) for n >= 1;
a(2*n-1) - 1 = (2-A010060(n-1)) XOR (A166519(n-1)-1) for n >= 1;
a(2*n) - 1 = (a(2*(n+1)-1)-1) XOR 2^A277822(n) for n >= 1. (End)

A268830 Square array A(r,c): A(0,c) = c, A(r,0) = 0, A(r>=1,c>=1) = 1+A(r-1,A268718(c)-1) = 1 + A(r-1, A003188(A006068(c)-1)), read by descending antidiagonals.

Original entry on oeis.org

0, 1, 0, 2, 1, 0, 3, 4, 1, 0, 4, 2, 3, 1, 0, 5, 6, 2, 3, 1, 0, 6, 8, 9, 2, 3, 1, 0, 7, 3, 8, 9, 2, 3, 1, 0, 8, 7, 5, 5, 6, 2, 3, 1, 0, 9, 10, 4, 4, 7, 8, 2, 3, 1, 0, 10, 12, 13, 6, 4, 6, 7, 2, 3, 1, 0, 11, 15, 12, 13, 5, 4, 6, 7, 2, 3, 1, 0, 12, 11, 17, 17, 18, 5, 4, 6, 7, 2, 3, 1, 0, 13, 5, 16, 16, 19, 20, 5, 4, 6, 7, 2, 3, 1, 0, 14, 13, 7, 18, 16, 18, 19, 5, 4, 6, 7, 2, 3, 1, 0
Offset: 0

Views

Author

Antti Karttunen, Feb 14 2016

Keywords

Examples

			The top left [0 .. 16] x [0 .. 19] section of the array:
0, 1, 2, 3, 4, 5, 6, 7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
0, 1, 4, 2, 6, 8, 3, 7, 10, 12, 15, 11,  5, 13, 16, 14, 18, 20, 23, 19
0, 1, 3, 2, 9, 8, 5, 4, 13, 12, 17, 16,  7,  6, 15, 14, 21, 20, 25, 24
0, 1, 3, 2, 9, 5, 4, 6, 13, 17, 16, 18, 10,  8, 15,  7, 21, 25, 24, 26
0, 1, 3, 2, 6, 7, 4, 5, 18, 19, 16, 17, 10, 11,  8,  9, 26, 27, 24, 25
0, 1, 3, 2, 8, 6, 4, 5, 20, 18,  9, 17,  7, 11, 10, 12, 28, 26, 33, 25
0, 1, 3, 2, 7, 6, 4, 5, 19, 18, 11, 10,  9,  8, 13, 12, 27, 26, 35, 34
0, 1, 3, 2, 7, 6, 4, 5, 19, 11, 14, 12,  8, 10, 13,  9, 27, 35, 38, 36
0, 1, 3, 2, 7, 6, 4, 5, 12, 13, 14, 15,  8,  9, 10, 11, 36, 37, 38, 39
0, 1, 3, 2, 7, 6, 4, 5, 14, 16, 11, 15,  8,  9, 12, 10, 38, 40, 35, 39
0, 1, 3, 2, 7, 6, 4, 5, 17, 16, 13, 12,  8,  9, 11, 10, 41, 40, 37, 36
0, 1, 3, 2, 7, 6, 4, 5, 17, 13, 12, 14,  8,  9, 11, 10, 41, 37, 36, 38
0, 1, 3, 2, 7, 6, 4, 5, 14, 15, 12, 13,  8,  9, 11, 10, 38, 39, 36, 37
0, 1, 3, 2, 7, 6, 4, 5, 16, 14, 12, 13,  8,  9, 11, 10, 40, 38, 21, 37
0, 1, 3, 2, 7, 6, 4, 5, 15, 14, 12, 13,  8,  9, 11, 10, 39, 38, 23, 22
0, 1, 3, 2, 7, 6, 4, 5, 15, 14, 12, 13,  8,  9, 11, 10, 39, 23, 26, 24
0, 1, 3, 2, 7, 6, 4, 5, 15, 14, 12, 13,  8,  9, 11, 10, 24, 25, 26, 27
		

Crossrefs

Inverses of these permutations can be found in table A268820.
Row 0: A001477, Row 1: A268718, Row 2: A268822, Row 3: A268824, Row 4: A268826, Row 5: A268828, Row 6: A268832, Row 7: A268934.
Rows converge towards A006068.

Programs

  • Python
    def a003188(n): return n^(n>>1)
    def a006068(n):
        s=1
        while True:
            ns=n>>s
            if ns==0: break
            n=n^ns
            s<<=1
        return n
    def a278618(n): return 0 if n==0 else 1 + a003188(a006068(n) - 1)
    def A(r, c): return c if r==0 else 0 if c==0 else 1 + A(r - 1, a278618(c) - 1)
    for r in range(21): print([A(c, r - c) for c in range(r + 1)]) # Indranil Ghosh, Jun 07 2017
  • Scheme
    (define (A268830 n) (A268830bi (A002262 n) (A025581 n))) ;; o=0: Square array of shifted powers of A268718.
    (define (A268830bi row col) (cond ((zero? row) col) ((zero? col) 0) (else (+ 1 (A268830bi (- row 1) (- (A268718 col) 1))))))
    (define (A268830bi row col) (cond ((zero? row) col) ((zero? col) 0) (else (+ 1 (A268830bi (- row 1) (A003188 (+ -1 (A006068 col))))))))
    

A268828 Permutation of nonnegative integers: a(0) = 0, a(n) = 1 + A268826(A268718(n)-1).

Original entry on oeis.org

0, 1, 3, 2, 8, 6, 4, 5, 20, 18, 9, 17, 7, 11, 10, 12, 28, 26, 33, 25, 31, 35, 34, 36, 19, 15, 14, 16, 32, 30, 13, 29, 44, 42, 49, 41, 47, 51, 50, 52, 67, 63, 62, 64, 48, 46, 61, 45, 27, 23, 22, 24, 56, 54, 21, 53, 68, 66, 57, 65, 55, 59, 58, 60, 76, 74, 81, 73, 79, 83, 82, 84, 99, 95, 94, 96, 80, 78, 93, 77, 123, 119, 118, 120, 88, 86
Offset: 0

Views

Author

Antti Karttunen, Feb 14 2016

Keywords

Comments

The "fifth shifted power" of permutation A268718.

Crossrefs

Inverse: A268827.
Row 5 of array A268830.

Programs

Formula

a(0) = 0, and for n >= 1, a(n) = 1 + A268826(A268718(n)-1).

A268831 Permutation of nonnegative integers: a(0) = 0, a(n) = A268717(1+A268827(n-1)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 14 2016

Keywords

Comments

The sixth "shifted power" of A268717.

Crossrefs

Inverse: A268832.
Row 6 of A268820.

Programs

Formula

a(0) = 0, for n >= 1, a(n) = A268717(1+A268827(n-1)).
Showing 1-5 of 5 results.