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-10 of 13 results. Next

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

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

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 14 2016

Keywords

Comments

The "third shifted power" of permutation A268718.

Crossrefs

Inverse: A268823.
Row 3 of array A268830.

Programs

Formula

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

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

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

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

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

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 14 2016

Keywords

Comments

The sixth "shifted power" of A268718.

Crossrefs

Inverse: A268831.
Row 6 of A268830.

Programs

Formula

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

A268818 Permutation of nonnegative integers: a(n) = A268718(A268718(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 14 2016

Keywords

Crossrefs

Inverse: A268817.
Cf. A268718.
Cf. also A268822.

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(n): return a278618(a278618(n)) # Indranil Ghosh, Jun 07 2017
  • Scheme
    (define (A268818 n) (A268718 (A268718 n)))
    

Formula

a(n) = A268718(A268718(n)).

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

A092246 Odd "odious" numbers (A000069).

Original entry on oeis.org

1, 7, 11, 13, 19, 21, 25, 31, 35, 37, 41, 47, 49, 55, 59, 61, 67, 69, 73, 79, 81, 87, 91, 93, 97, 103, 107, 109, 115, 117, 121, 127, 131, 133, 137, 143, 145, 151, 155, 157, 161, 167, 171, 173, 179, 181, 185, 191, 193, 199, 203, 205, 211, 213, 217, 223, 227, 229, 233
Offset: 1

Views

Author

Benoit Cloitre, Feb 23 2004

Keywords

Comments

In other words, numbers having a binary representation ending in 1, and an odd number of 1's overall. It follows that by decrementing an odd odious number, one gets an even evil number (A125592). - Ralf Stephan, Aug 27 2013
The members of the sequence may be called primitive odious numbers because every odious number is a power of 2 times one of these numbers. Note that the difference between consecutive terms is either 2, 4, or 6. - T. D. Noe, Jun 06 2007
From Gary W. Adamson, Apr 06 2010: (Start)
a(n) = A026147(n)-th odd number, where A026147 = (1, 4, 6, 7, 10, 11, ...); e.g.,
n: 1 2 3 4 5 6 7 8 9 10 11
n-th odd: 1 3 5 7 9 11 13 15 17 19 21
a(n): 1 7 11 13 19 21
etc. (End)
Numbers m, such that when merge-sorting lists of length m, the maximal number of comparisons is even: A003071(a(n)) = A230720(n). - Reinhard Zumkeller, Oct 28 2013
Fixed points of permutation pair A268717/A268718. - Antti Karttunen, Feb 29 2016

Crossrefs

Cf. A230709 (complement).

Programs

  • Haskell
    a092246 n = a092246_list !! (n - 1)
    a092246_list = filter odd a000069_list
    -- Reinhard Zumkeller, Oct 28 2013
    
  • Mathematica
    Table[If[n < 1, 0, 2 n - 1 - Mod[First@ DigitCount[n - 1, 2], 2]], {n, 120}] /. n_ /; EvenQ@ n -> Nothing (* Michael De Vlieger, Feb 29 2016 *)
    Select[Range[1, 1001, 2], OddQ[Total[IntegerDigits[#, 2]]]&] (* Jean-François Alcover, Mar 15 2016 *)
  • PARI
    is(n)=n%2&&hammingweight(n)%2 \\ Charles R Greathouse IV, Mar 21 2013
    
  • PARI
    a(n)=4*n-if(hammingweight(n-1)%2,1,3) \\ Charles R Greathouse IV, Mar 22 2013
    
  • Python
    def A092246(n): return (n<<2)-(1 if (n-1).bit_count()&1 else 3) # Chai Wah Wu, Mar 03 2023

Formula

a(n) = 4*n + 2*A010060(n-1) - 3;
a(n) = 2*A001969(n-1) + 1.

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

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 12 2016

Keywords

Crossrefs

Inverse: A268718.
Row 1 and column 1 of array A268715 (without the initial zero).
Row 1 of array A268820.
Cf. A092246 (fixed points).
Cf. A268817 ("square" of this permutation).
Cf. A268821 ("shifted square"), A268823 ("shifted cube") and also A268825, A268827 and A268831 ("shifted higher powers").

Programs

Formula

a(n) = A003188(A066194(n)) = A003188(1+A006068(n-1)).
Other identities. For all n >= 0:
A101080(n,a(n+1)) = 1. [The Hamming distance between n and a(n+1) is always one.]
A268726(n) = A000523(A003987(n, a(n+1))). [A268726 gives the index of the toggled bit.]
From Alan Michael Gómez Calderón, May 29 2025: (Start)
a(2*n) = (2*n-1) XOR (2-A010060(n-1)) for n >= 1;
a(n) = (A268718(n-1)-1) XOR (A171977(n-1)+1) for n >= 2. (End)
Showing 1-10 of 13 results. Next