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

A263273 Bijective base-3 reverse: a(0) = 0; for n >= 1, a(n) = A030102(A038502(n)) * A038500(n).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 05 2015

Keywords

Comments

Here the base-3 reverse has been adjusted so that the maximal suffix of trailing zeros (in base-3 representation A007089) stays where it is at the right side, and only the section from the most significant digit to the least significant nonzero digit is reversed, thus making this sequence a self-inverse permutation of nonnegative integers.
Because successive powers of 3 and 9 modulo 2, 4 and 8 are always either constant 1, 1, 1, ... or alternating 1, -1, 1, -1, ... it implies similar simple divisibility rules for 2, 4 and 8 in base 3 as e.g. 3, 9 and 11 have in decimal base (see the Wikipedia-link). As these rules do not depend on which direction they are applied from, it means that this bijection preserves the fact whether a number is divisible by 2, 4 or 8, or whether it is not. Thus natural numbers are divided to several subsets, each of which is closed with respect to this bijection. See the Crossrefs section for permutations obtained from these sections.
When polynomials over GF(3) are encoded as natural numbers (coefficients presented with the digits of the base-3 expansion of n), this bijection works as a multiplicative automorphism of the ring GF(3)[X]. This follows from the fact that as there are no carries involved, the multiplication (and thus also the division) of such polynomials could be as well performed by temporarily reversing all factors (like they were seen through mirror). This implies also that the sequences A207669 and A207670 are closed with respect to this bijection.

Examples

			For n = 15, A007089(15) = 120. Reversing this so that the trailing zero stays at the right yields 210 = A007089(21), thus a(15) = 21 and vice versa, a(21) = 15.
		

Crossrefs

Bisections: A264983, A264984.
Permutations induced by various sections: A263272 (a(2n)/2), A264974 (a(4n)/4), A264978 (a(8n)/8), A264985, A264989.
Cf. also A004488, A140263, A140264, A246207, A246208 (other base-3 related permutations).

Programs

  • Mathematica
    r[n_] := FromDigits[Reverse[IntegerDigits[n, 3]], 3]; b[n_] := n/ 3^IntegerExponent[n, 3]; c[n_] := n/b[n]; a[0]=0; a[n_] := r[b[n]]*c[n]; Table[a[n], {n, 0, 80}] (* Jean-François Alcover, Dec 29 2015 *)
  • Python
    from sympy import factorint
    from sympy.ntheory.factor_ import digits
    from operator import mul
    def a030102(n): return 0 if n==0 else int(''.join(map(str, digits(n, 3)[1:][::-1])), 3)
    def a038502(n):
        f=factorint(n)
        return 1 if n==1 else reduce(mul, [1 if i==3 else i**f[i] for i in f])
    def a038500(n): return n/a038502(n)
    def a(n): return 0 if n==0 else a030102(a038502(n))*a038500(n) # Indranil Ghosh, May 22 2017
  • Scheme
    (define (A263273 n) (if (zero? n) n (* (A030102 (A038502 n)) (A038500 n))))
    

Formula

a(0) = 0; for n >= 1, a(n) = A030102(A038502(n)) * A038500(n).
Other identities. For all n >= 0:
a(3*n) = 3*a(n).
A000035(a(n)) = A000035(n). [This permutation preserves the parity of n.]
A010873(a(n)) = 0 if and only if A010873(n) = 0. [See the comments section.]

A265345 Square array A(row,col): For row=0, A(0,col) = A265341(col), for row > 0, A(row,col) = A265342(A(row-1,col)).

Original entry on oeis.org

1, 3, 2, 7, 6, 4, 5, 10, 12, 8, 9, 22, 20, 24, 16, 21, 18, 28, 40, 48, 64, 13, 30, 36, 56, 80, 192, 32, 19, 26, 60, 72, 112, 160, 96, 184, 25, 14, 52, 120, 144, 224, 640, 552, 352, 11, 46, 76, 208, 240, 576, 448, 320, 1056, 704, 15, 58, 68, 136, 104, 480, 288, 1720, 1600, 2112, 1408
Offset: 1

Views

Author

Antti Karttunen, Dec 18 2015

Keywords

Comments

Square array A(row,col) is read by downwards antidiagonals as: A(0,0), A(0,1), A(1,0), A(0,2), A(1,1), A(2,0), A(0,3), A(1,2), A(2,1), A(3,0), ...
All the terms in the same column are either all divisible by 3, or none of them are.
Reducing A265342 to its constituent sequences gives A265342(n) = A263273(2*A263273(n)). Iterating this function k times starting from n reduces to (because A263273 is an involution, so pairs of them are canceled) to A263273((2^k)*A263273(n)).

Examples

			The top left corner of the array:
    1,    3,    7,    5,    9,   21,   13,   19,   25,   11,   15,    39, .
    2,    6,   10,   22,   18,   30,   26,   14,   46,   58,   66,    78, .
    4,   12,   20,   28,   36,   60,   52,   76,   68,   44,   84,   156, .
    8,   24,   40,   56,   72,  120,  208,  136,   88,  232,  168,   624, .
   16,   48,   80,  112,  144,  240,  104,  200,  496,  424,  336,   312, .
   64,  192,  160,  224,  576,  480,  520,  256,  344,  608,  672,  1560, .
   32,   96,  640,  448,  288, 1920, 1144,  512, 1984,  736, 1344,  3432, .
  184,  552,  320, 1720, 1656,  960, 2072, 1024, 1376, 4384, 5160,  6216, .
  352, 1056, 1600,  824, 3168, 4800, 3712, 6040, 5344, 2936, 2472, 11136, .
  ...
		

Crossrefs

Inverse: A265346.
Transpose: A265347.
Leftmost column: A264980.
Topmost row: A265341.
Row index: A265330 (zero-based), A265331 (one-based).
Column index: A265910 (zero-based), A265911 (one-based).
Cf. also A265342.
Related permutations: A263273, A265895.

Programs

Formula

For row=0, A(0,col) = A265341(col), for row>0, A(row,col) = A265342(A(row-1,col)).
A(row, col) = A263273((2^row) * A263273(A265341(col))). [The above reduces to this.]

A265342 Permutation of even numbers: a(n) = 2 * A265351(n).

Original entry on oeis.org

0, 2, 4, 6, 8, 22, 12, 10, 16, 18, 20, 58, 24, 26, 76, 66, 64, 70, 36, 14, 40, 30, 28, 34, 48, 46, 52, 54, 56, 166, 60, 62, 184, 174, 172, 178, 72, 74, 220, 78, 80, 238, 228, 226, 232, 198, 68, 202, 192, 190, 196, 210, 208, 214, 108, 38, 112, 42, 44, 130, 120, 118, 124, 90, 32, 94, 84, 82, 88, 102, 100, 106, 144
Offset: 0

Views

Author

Antti Karttunen, Dec 07 2015

Keywords

Comments

Iterating this sequence as 1, a(1), a(a(1)), a(a(a(1))), ... yields A264980.

Crossrefs

Cf. A265351.
Cf. also A265341, A263273, A264980.

Programs

  • Python
    from sympy import factorint
    from sympy.ntheory.factor_ import digits
    from operator import mul
    def a030102(n): return 0 if n==0 else int(''.join(map(str, digits(n, 3)[1:][::-1])), 3)
    def a038502(n):
        f=factorint(n)
        return 1 if n==1 else reduce(mul, [1 if i==3 else i**f[i] for i in f])
    def a038500(n): return n/a038502(n)
    def a263273(n): return 0 if n==0 else a030102(a038502(n))*a038500(n)
    def a263272(n): return a263273(2*n)/2
    def a(n): return 2*a263272(a263273(n)) # Indranil Ghosh, May 25 2017
  • Scheme
    (define (A265342 n) (* 2 (A265351 n)))
    

Formula

a(n) = 2 * A265351(n).

A265210 Irregular triangle read by rows in which row n lists the base 3 digits of 2^n in reverse order, n >= 0.

Original entry on oeis.org

1, 2, 1, 1, 2, 2, 1, 2, 1, 2, 1, 0, 1, 1, 0, 1, 2, 2, 0, 2, 1, 1, 1, 1, 1, 0, 0, 1, 2, 2, 2, 0, 0, 2, 1, 2, 2, 1, 0, 1, 1, 2, 1, 2, 0, 1, 2, 2, 1, 0, 2, 1, 2, 1, 2, 1, 2, 0, 1, 0, 2, 0, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 2, 1, 1
Offset: 0

Views

Author

L. Edson Jeffery, Dec 04 2015

Keywords

Comments

The length of row n is A020915(n) = 1 + A136409(n).
Conjecture 1: The sequence in column k is periodic, with period p(k) = 2*3^(k-1) = A008776(k-1), k >= 1, and in which the numbers 0,1,2 appear with equal frequency, for each k>1.

Examples

			n
0:    1
1:    2
2:    1  1
3:    2  2
4:    1  2  1
5:    2  1  0  1
6:    1  0  1  2
7:    2  0  2  1  1
8:    1  1  1  0  0  1
9:    2  2  2  0  0  2
10:   1  2  2  1  0  1  1
11:   2  1  2  0  1  2  2
12:   1  0  2  1  2  1  2  1
13:   2  0  1  0  2  0  2  0  1
14:   1  1  2  0  1  1  1  1  2
15:   2  2  1  1  2  2  2  2  1  1
		

Crossrefs

Cf. A000079 (powers of 2), A004642 (powers of 2 written in base 3), A008776 (2*3^n).
Cf. A265209 (base 3 digits of 2^n).
Cf. A264980 (row n read as ternary number).
Cf. A037096 (numbers constructed from the inverse case, base 2 digits of 3^n).

Programs

  • Mathematica
    (* Replace Flatten with Grid to display the triangle: *)
    Flatten[Table[Reverse[IntegerDigits[2^n, 3]], {n, 0, 15}]]
  • PARI
    A265210_row(n)=Vecrev(digits(2^n,3)) \\ M. F. Hasler, Dec 05 2015
Showing 1-4 of 4 results.