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

A268834 Transpose of array A268833.

Original entry on oeis.org

0, 1, 0, 2, 1, 0, 1, 2, 1, 0, 2, 3, 2, 1, 0, 3, 2, 3, 2, 1, 0, 2, 1, 2, 1, 2, 1, 0, 1, 2, 3, 2, 3, 2, 1, 0, 2, 3, 4, 3, 2, 1, 2, 1, 0, 3, 2, 3, 4, 3, 2, 1, 2, 1, 0, 4, 3, 2, 3, 4, 3, 2, 3, 2, 1, 0, 3, 4, 1, 2, 3, 4, 3, 2, 3, 2, 1, 0, 2, 3, 2, 3, 2, 3, 2, 1, 2, 1, 2, 1, 0, 3, 2, 3, 2, 3, 2, 1, 2, 3, 2, 1, 2, 1, 0, 2, 1, 2, 1, 4, 3, 2, 3, 4, 3, 2, 3, 2, 1, 0
Offset: 0

Views

Author

Antti Karttunen, Feb 15 2016

Keywords

Comments

See comments in A268833.

Examples

			The top left [0 .. 16] x [0 .. 16] section of the array:
  0, 1, 2, 1, 2, 3, 2, 1, 2, 3, 4, 3, 2, 3, 2, 1, 2
  0, 1, 2, 3, 2, 1, 2, 3, 2, 3, 4, 3, 2, 1, 2, 3, 2
  0, 1, 2, 3, 2, 3, 4, 3, 2, 1, 2, 3, 2, 3, 4, 3, 2
  0, 1, 2, 1, 2, 3, 4, 3, 2, 3, 2, 1, 2, 3, 4, 3, 2
  0, 1, 2, 3, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3, 4, 3, 2
  0, 1, 2, 1, 2, 3, 4, 3, 2, 3, 4, 3, 4, 5, 4, 3, 2
  0, 1, 2, 1, 2, 3, 2, 1, 2, 3, 4, 3, 4, 5, 4, 3, 2
  0, 1, 2, 3, 2, 1, 2, 3, 2, 3, 4, 5, 4, 3, 4, 3, 2
  0, 1, 2, 3, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3, 4, 3, 2
  0, 1, 2, 1, 2, 3, 4, 3, 2, 3, 4, 3, 4, 5, 4, 3, 2
  0, 1, 2, 1, 2, 3, 2, 1, 2, 3, 4, 3, 4, 5, 4, 3, 2
  0, 1, 2, 3, 2, 1, 2, 3, 2, 3, 4, 5, 4, 3, 4, 3, 2
  0, 1, 2, 1, 2, 3, 2, 1, 2, 3, 4, 3, 2, 3, 2, 1, 2
  0, 1, 2, 3, 2, 1, 2, 3, 2, 3, 4, 3, 2, 1, 2, 3, 2
  0, 1, 2, 3, 2, 3, 4, 3, 2, 1, 2, 3, 2, 3, 4, 3, 2
  0, 1, 2, 1, 2, 3, 4, 3, 2, 3, 2, 1, 2, 3, 4, 3, 2
  0, 1, 2, 3, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3, 4, 3, 2
		

Crossrefs

Transpose of A268833.

Programs

A268835 Main diagonal of arrays A268833 & A268834: a(n) = A101080(n, A268820(n, 2*n)).

Original entry on oeis.org

0, 1, 2, 1, 2, 3, 2, 3, 2, 3, 4, 5, 2, 1, 4, 3, 2, 3, 4, 5, 4, 3, 6, 5, 2, 3, 2, 1, 4, 5, 4, 3, 2, 3, 4, 5, 4, 3, 6, 5, 4, 5, 4, 3, 6, 7, 6, 5, 2, 3, 4, 3, 2, 3, 2, 3, 4, 5, 6, 5, 4, 3, 4, 3, 2, 3, 4, 5, 4, 3, 6, 5, 4, 5, 4, 3, 6, 7, 6, 5, 4, 5, 6, 5, 4, 5, 4, 5, 6, 7, 8, 7, 6, 5, 6, 5, 2, 3, 4, 3, 4, 5, 4, 5, 2, 3, 4, 5, 2, 1, 4, 3, 4, 5, 6, 5, 6, 5, 6, 5, 4
Offset: 0

Views

Author

Antti Karttunen, Feb 15 2016

Keywords

Crossrefs

Programs

Formula

a(n) = A101080(n, A268820(n, 2*n)).

A268820 Square array A(r,c): A(0,c) = c, A(r,0) = 0, A(r>=1,c>=1) = A003188(1+A006068(A(r-1,c-1))) = A268717(1+A(r-1,c-1)), read by descending antidiagonals as A(0,0), A(0,1), A(1,0), A(0,2), A(1,1), A(2,0), ...

Original entry on oeis.org

0, 1, 0, 2, 1, 0, 3, 3, 1, 0, 4, 6, 3, 1, 0, 5, 2, 2, 3, 1, 0, 6, 12, 7, 2, 3, 1, 0, 7, 4, 6, 6, 2, 3, 1, 0, 8, 7, 13, 5, 6, 2, 3, 1, 0, 9, 5, 12, 7, 7, 6, 2, 3, 1, 0, 10, 24, 5, 15, 4, 7, 6, 2, 3, 1, 0, 11, 8, 4, 13, 5, 5, 7, 6, 2, 3, 1, 0, 12, 11, 25, 4, 14, 12, 5, 7, 6, 2, 3, 1, 0, 13, 9, 24, 12, 15, 4, 4, 5, 7, 6, 2, 3, 1, 0, 14, 13, 9, 27, 12, 10, 13, 4, 5, 7, 6, 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, 3, 6, 2, 12,  4,  7,  5, 24,  8, 11,  9, 13, 15, 10, 14, 48, 16, 19
0, 1, 3, 2, 7,  6, 13, 12,  5,  4, 25, 24,  9,  8, 15, 14, 11, 10, 49, 48
0, 1, 3, 2, 6,  5,  7, 15, 13,  4, 12, 27, 25,  8, 24, 14, 10,  9, 11, 51
0, 1, 3, 2, 6,  7,  4,  5, 14, 15, 12, 13, 26, 27, 24, 25, 10, 11,  8,  9
0, 1, 3, 2, 6,  7,  5, 12,  4, 10, 14, 13, 15, 30, 26, 25, 27, 11,  9, 24
0, 1, 3, 2, 6,  7,  5,  4, 13, 12, 11, 10, 15, 14, 31, 30, 27, 26,  9,  8
0, 1, 3, 2, 6,  7,  5,  4, 12, 15, 13,  9, 11, 14, 10, 29, 31, 26, 30,  8
0, 1, 3, 2, 6,  7,  5,  4, 12, 13, 14, 15,  8,  9, 10, 11, 28, 29, 30, 31
0, 1, 3, 2, 6,  7,  5,  4, 12, 13, 15, 10, 14, 24,  8, 11,  9, 20, 28, 31
0, 1, 3, 2, 6,  7,  5,  4, 12, 13, 15, 14, 11, 10, 25, 24,  9,  8, 21, 20
0, 1, 3, 2, 6,  7,  5,  4, 12, 13, 15, 14, 10,  9, 11, 27, 25,  8, 24, 23
0, 1, 3, 2, 6,  7,  5,  4, 12, 13, 15, 14, 10, 11,  8,  9, 26, 27, 24, 25
0, 1, 3, 2, 6,  7,  5,  4, 12, 13, 15, 14, 10, 11,  9, 24,  8, 30, 26, 25
0, 1, 3, 2, 6,  7,  5,  4, 12, 13, 15, 14, 10, 11,  9,  8, 25, 24, 31, 30
0, 1, 3, 2, 6,  7,  5,  4, 12, 13, 15, 14, 10, 11,  9,  8, 24, 27, 25, 29
0, 1, 3, 2, 6,  7,  5,  4, 12, 13, 15, 14, 10, 11,  9,  8, 24, 25, 26, 27
		

Crossrefs

Inverses of these permutations can be found in table A268830.
Row 0: A001477, Row 1: A268717, Row 2: A268821, Row 3: A268823, Row 4: A268825, Row 5: A268827, Row 6: A268831, Row 7: A268933.
Rows converge towards A003188, which is also the main diagonal.
Cf. array A268715 (can be extracted from this one).
Cf. array A268833 (shows related Hamming distances with regular patterns).

Programs

  • Mathematica
    A003188[n_]:=BitXor[n, Floor[n/2]]; A006068[n_]:=If[n<2, n, Block[{m=A006068[Floor[n/2]]}, 2m + Mod[Mod[n,2] + Mod[m, 2], 2]]]; a[r_, 0]:= 0; a[0, c_]:=c; a[r_, c_]:= A003188[1 + A006068[a[r - 1, c - 1]]]; Table[a[c, r - c], {r, 0, 15}, {c, 0, r}] //Flatten (* Indranil Ghosh, Apr 02 2017 *)
  • PARI
    A003188(n) = bitxor(n, n\2);
    A006068(n) = if(n<2, n, {my(m = A006068(n\2)); 2*m + (n%2 + m%2)%2});
    a(r, c) = if(r==0, c, if(c==0, 0, A003188(1 + A006068(a(r - 1, c - 1)))));
    for(r=0, 15, for(c=0, r, print1(a(c, r - c),", "); ); print(); ); \\ Indranil Ghosh, Apr 02 2017
    
  • Python
    def A003188(n): return n^(n//2)
    def A006068(n):
        if n<2: return n
        else:
            m=A006068(n//2)
            return 2*m + (n%2 + m%2)%2
    def a(r, c): return c if r<1 else 0 if c<1 else A003188(1 + A006068(a(r - 1, c - 1)))
    for r in range(16):
        print([a(c, r - c) for c in range(r + 1)]) # Indranil Ghosh, Apr 02 2017
  • Scheme
    (define (A268820 n) (A268820bi (A002262 n) (A025581 n)))
    (define (A268820bi row col) (cond ((zero? row) col) ((zero? col) 0) (else (A268717 (+ 1 (A268820bi (- row 1) (- col 1)))))))
    (define (A268820bi row col) (cond ((zero? row) col) ((zero? col) 0) (else (A003188 (+ 1 (A006068 (A268820bi (- row 1) (- col 1))))))))
    

Formula

For row zero: A(0,k) = k, for column zero: A(n,0) = 0, and in other cases: A(n,k) = A003188(1+A006068(A(n-1,k-1)))
Other identities. For all n >= 0:
A(n,n) = A003188(n).
A(A006068(n),A006068(n)) = n.

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

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 14 2016

Keywords

Comments

The "shifted square" of permutation A268717.

Crossrefs

Inverse: A268822.
Row 2 of array A268820.
From term a(2) onward (3, 2, 7, 6, ...) also row 3 of A268715.
Cf. also A101080, A268833.

Programs

Formula

a(0) = 0, for n >= 1, a(n) = A268717(1 + A268717(n-1)).
Other identities. For all n >= 0:
A101080(n, a(n+2)) = 2.

A268726 Index of the toggled bit between n and A268717(n+1): a(n) = A000523(A003987(n, A268717(1+n))).

Original entry on oeis.org

0, 1, 2, 0, 3, 0, 0, 1, 4, 0, 0, 1, 0, 1, 2, 0, 5, 0, 0, 1, 0, 1, 2, 0, 0, 1, 2, 0, 3, 0, 0, 1, 6, 0, 0, 1, 0, 1, 2, 0, 0, 1, 2, 0, 3, 0, 0, 1, 0, 1, 2, 0, 3, 0, 0, 1, 4, 0, 0, 1, 0, 1, 2, 0, 7, 0, 0, 1, 0, 1, 2, 0, 0, 1, 2, 0, 3, 0, 0, 1, 0, 1, 2, 0, 3, 0, 0, 1, 4, 0, 0, 1, 0, 1, 2, 0, 0, 1, 2, 0, 3, 0, 0, 1, 4, 0, 0, 1, 0, 1, 2, 0, 5, 0, 0, 1, 0, 1, 2, 0, 0
Offset: 0

Views

Author

Antti Karttunen, Feb 13 2016

Keywords

Comments

A fractal sequence, because a permutation of A007814. Removing zeros yields A268727(n) = a(n)+1.

Crossrefs

One less than A268727.
Cf. also array A268833.

Programs

Formula

a(n) = A007814(1 + A006068(n)).
a(n) = A000523(A003987(n, A268717(1+n))).
a(n) = floor(log_2(n XOR A003188(1 + A006068(n)))).
Other identities:
For all n >= 1, a(A003188(n-1)) = A007814(n).

A268727 One-based index of the toggled bit between n and A268717(n+1): a(n) = A070939(A003987(n,A268717(1+n))).

Original entry on oeis.org

1, 2, 3, 1, 4, 1, 1, 2, 5, 1, 1, 2, 1, 2, 3, 1, 6, 1, 1, 2, 1, 2, 3, 1, 1, 2, 3, 1, 4, 1, 1, 2, 7, 1, 1, 2, 1, 2, 3, 1, 1, 2, 3, 1, 4, 1, 1, 2, 1, 2, 3, 1, 4, 1, 1, 2, 5, 1, 1, 2, 1, 2, 3, 1, 8, 1, 1, 2, 1, 2, 3, 1, 1, 2, 3, 1, 4, 1, 1, 2, 1, 2, 3, 1, 4, 1, 1, 2, 5, 1, 1, 2, 1, 2, 3, 1, 1, 2, 3, 1, 4, 1, 1, 2, 5, 1, 1, 2, 1, 2, 3, 1, 6, 1, 1, 2, 1, 2, 3, 1, 1
Offset: 0

Views

Author

Antti Karttunen, Feb 13 2016

Keywords

Comments

A fractal sequence like A268726.

Crossrefs

One more than A268726.
Cf. also array A268833.

Programs

Formula

a(n) = A001511(1+A006068(n)).
a(n) = A070939(A003987(n,A268717(1+n))).
a(n) = 1 + floor(log_2(n XOR A003188(1+A006068(n)))).
a(n) = A001511(n)*(1-A010059(n)) + 1. - Alan Michael Gómez Calderón, Jun 15 2025

A268676 a(n) = A101080(n,A268823(3+n)), where A101080(x,y) gives the Hamming distance between binary expansions of x and y.

Original entry on oeis.org

1, 3, 3, 1, 3, 1, 1, 3, 3, 1, 1, 3, 1, 3, 3, 1, 3, 1, 1, 3, 1, 3, 3, 1, 1, 3, 3, 1, 3, 1, 1, 3, 3, 1, 1, 3, 1, 3, 3, 1, 1, 3, 3, 1, 3, 1, 1, 3, 1, 3, 3, 1, 3, 1, 1, 3, 3, 1, 1, 3, 1, 3, 3, 1, 3, 1, 1, 3, 1, 3, 3, 1, 1, 3, 3, 1, 3, 1, 1, 3, 1, 3, 3, 1, 3, 1, 1, 3, 3, 1, 1, 3, 1, 3, 3, 1, 1, 3, 3, 1, 3, 1, 1, 3, 3, 1, 1, 3, 1, 3, 3, 1, 3, 1, 1, 3, 1, 3, 3, 1, 1
Offset: 0

Views

Author

Antti Karttunen, Feb 19 2016

Keywords

Comments

It seems that A001969 gives the positions of 1's, while A000069 gives the positions of 3's.
The above observation follows because by definition, a(n) gives the Hamming distance between binary expansions of n and A003188(3+A006068(n)). To see how this leads to the stated claim, consider the illustration "Visualized as a traversal of vertices of a tesseract" in the Wikipedia article "Gray code". Starting from any vertex with either (A) an even, or (B) an odd number of 1-bits, traverse three edges along the red path, to the direction indicated by the arrow, and then note the Hamming distance between the starting and the ending vertex. It is always 1 in case (A), and 3 in case (B), because the position of the flipped bit is given by sequence A007814, with its every other term zero, so in case (A) the third flip cancels the first flip (both toggling the rightmost bit), which leaves only the second bit-flip effective. Note that the properties of a tesseract generalize to those of an infinite dimensional hypercube. - Antti Karttunen, Mar 11 2024

Crossrefs

Programs

Formula

a(n) = A101080(n,A268823(3+n)), where A101080(x,y) gives the Hamming distance between binary expansions of x and y.
a(n) = 2 - (-1)^A000120(n) = 2 - A106400(n). - Lorenzo Sauras Altuzarra, Mar 10 2024
a(n) = 1 + 2 * A010060(n). - Joerg Arndt, Mar 11 2024
Showing 1-7 of 7 results.