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-6 of 6 results.

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

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 14 2016

Keywords

Comments

The "fourth shifted power" of permutation A268718.

Crossrefs

Inverse: A268825.
Row 4 of array A268830.

Programs

Formula

a(0) = 0, and for n >= 1, a(n) = 1 + A268824(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)

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

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 14 2016

Keywords

Comments

The "third shifted power" of permutation A268717.

Crossrefs

Inverse: A268824.
Row 3 of array A268820.

Programs

Formula

a(0), for n >= 1, a(n) = A268717(1 + A268821(n-1)).
a(0) = 0, a(1) = 1, and for n > 1, a(n) = A268717(1 + A268717(1 + A268717(n-2))).
For n >= 3, a(n) = A003188(3+A006068(n-3)). - Antti Karttunen, Mar 11 2024

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))))))))
    

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

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 14 2016

Keywords

Comments

The "shifted square" of permutation A268718.

Crossrefs

Inverse: A268821.
Row 2 of array A268830.

Programs

Formula

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

A268673 a(0) = 0; a(1) = 1; for n > 1, a(n) = 1 + 4*A092246(n-1).

Original entry on oeis.org

0, 1, 5, 29, 45, 53, 77, 85, 101, 125, 141, 149, 165, 189, 197, 221, 237, 245, 269, 277, 293, 317, 325, 349, 365, 373, 389, 413, 429, 437, 461, 469, 485, 509, 525, 533, 549, 573, 581, 605, 621, 629, 645, 669, 685, 693, 717, 725, 741, 765, 773, 797, 813, 821, 845, 853, 869, 893, 909, 917, 933, 957, 965, 989, 1005
Offset: 0

Views

Author

Antti Karttunen, Feb 19 2016

Keywords

Comments

Seems to be also the fixed points of permutations A268823 and A268824.

Crossrefs

Cf. also A092246, A268717.
Many (but not all) terms of A013710 seem to be included.

Programs

  • Mathematica
    Join[{0, 1}, 1 + 4 Select[Range[1, 251, 2], OddQ[Total[IntegerDigits[#, 2]]]&]] (* Jean-François Alcover, Mar 15 2016 *)
  • Python
    def A268673(n): return (((m:=n-2)<<4)+(13 if m.bit_count()&1 else 5)) if n>1 else n # Chai Wah Wu, Mar 03 2023
  • Scheme
    (define (A268673 n) (if (<= n 1) n (+ 1 (* 4 (A092246 (- n 1))))))
    

Formula

a(0) = 0; a(1) = 1; for n > 1, a(n) = 1 + 4*A092246(n-1).
Showing 1-6 of 6 results.