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

A325820 Multiplication table for carryless product i X j in base 3 for i >= 0 and j >= 0, read by antidiagonals.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 2, 2, 0, 0, 3, 1, 3, 0, 0, 4, 6, 6, 4, 0, 0, 5, 8, 9, 8, 5, 0, 0, 6, 7, 12, 12, 7, 6, 0, 0, 7, 3, 15, 16, 15, 3, 7, 0, 0, 8, 5, 18, 11, 11, 18, 5, 8, 0, 0, 9, 4, 21, 24, 13, 24, 21, 4, 9, 0, 0, 10, 18, 24, 19, 21, 21, 19, 24, 18, 10, 0, 0, 11, 20, 27, 23, 26, 9, 26, 23, 27, 20, 11, 0, 0, 12, 19, 30, 36, 19, 15, 15, 19, 36, 30, 19, 12, 0
Offset: 0

Views

Author

Antti Karttunen, May 22 2019

Keywords

Examples

			The array begins as:
  0,  0,  0,  0,  0,  0,  0,  0,  0,   0,   0,   0,   0, ...
  0,  1,  2,  3,  4,  5,  6,  7,  8,   9,  10,  11,  12, ...
  0,  2,  1,  6,  8,  7,  3,  5,  4,  18,  20,  19,  24, ...
  0,  3,  6,  9, 12, 15, 18, 21, 24,  27,  30,  33,  36, ...
  0,  4,  8, 12, 16, 11, 24, 19, 23,  36,  40,  44,  48, ...
  0,  5,  7, 15, 11, 13, 21, 26, 19,  45,  50,  52,  33, ...
  0,  6,  3, 18, 24, 21,  9, 15, 12,  54,  60,  57,  72, ...
  0,  7,  5, 21, 19, 26, 15, 13, 11,  63,  70,  68,  57, ...
  0,  8,  4, 24, 23, 19, 12, 11, 16,  72,  80,  76,  69, ...
  0,  9, 18, 27, 36, 45, 54, 63, 72,  81,  90,  99, 108, ...
  0, 10, 20, 30, 40, 50, 60, 70, 80,  90, 100,  83, 120, ...
  0, 11, 19, 33, 44, 52, 57, 68, 76,  99,  83,  91, 132, ...
  0, 12, 24, 36, 48, 33, 72, 57, 69, 108, 120, 132, 144, ...
  etc.
A(2,2) = 2*2 mod 3 = 1.
		

Crossrefs

Cf. A169999 (the main diagonal).
Row/Column 0: A000004, Row/Column 1: A001477, Row/Column 2: A004488, Row/Column 3: A008585, Row/Column 4: A242399, Row/Column 9: A008591.
Cf. A325821 (same table without the zero row and column).
Cf. A048720 (binary), A059692 (decimal), A004247 (full multiply).

Programs

  • PARI
    up_to = 105;
    A325820sq(b, c) = fromdigits(Vec(Pol(digits(b,3))*Pol(digits(c,3)))%3, 3);
    A325820list(up_to) = { my(v = vector(up_to), i=0); for(a=0,oo, for(col=0,a, if(i++ > up_to, return(v)); v[i] = A325820sq(a-col,col))); (v); };
    v325820 = A325820list(up_to);
    A325820(n) = v325820[1+n];

A207669 Numbers that match polynomials irreducible (mod 3), with coefficients in {0,1,2}.

Original entry on oeis.org

3, 4, 5, 6, 7, 8, 10, 14, 17, 20, 22, 25, 34, 35, 38, 41, 43, 46, 49, 53, 58, 59, 65, 67, 71, 73, 77, 79, 86, 89, 92, 94, 97, 101, 110, 115, 118, 121, 125, 134, 137, 139, 145, 149, 151, 158, 166, 169, 172, 181, 185, 188, 190, 197, 205, 209, 212, 214, 217
Offset: 1

Views

Author

Clark Kimberling, Feb 26 2012

Keywords

Comments

For such polynomials irreducible over the field of rational numbers, see A207966, which also describes the enumeration of all the nonzero polynomials whose coefficients are all in {0,1,2}.

Examples

			Polynomials having coefficients in {0,1,2} are
enumerated by the positive integers as follows:
n ... p[n,x] .. irreducible (mod 3)
1 ... 1 ....... no
2 ... 2 ....... no
3 ... x ....... yes
4 ... x+1 ..... yes
5 ... x+2 ..... yes
6 ... 2x ...... yes
7 ... 2x+1 .... yes
8 ... 2x+2 .... yes
9 ... x^2 ..... no
10 .. x^2+1 ... yes
11 .. x^2+2 ... no
The least n for which p(n,x) is irreducible over the
rationals but not modulo 3 is 13; the factorization of
p(13,x) is (x+1)(x+2) (mod 3).
		

Crossrefs

Cf. A207670 (complement), A207671 (ternary).

Programs

  • Mathematica
    t = Table[IntegerDigits[n, 3], {n, 1, 1000}];
    b[n_] := Reverse[Table[x^k, {k, 0, n}]]
    p[n_, x_] := t[[n]].b[-1 + Length[t[[n]]]]
    Table[p[n, x], {n, 1, 15}]
    u = {}; Do[n++;
    If[IrreduciblePolynomialQ[p[n, x], Modulus -> 3],
      AppendTo[u, n]], {n, 1, 400}]
    u                           (* A207669 *)
    Complement[Range[200], %]   (* A207670 *)
    b[n_] := FromDigits[IntegerDigits[u, 3][[n]]]
    Table[b[n], {n, 1, 50}]     (* A207671 *)

A207671 Numbers in ternary representation that match nonzero polynomials with all coefficients in {0,1,2} that are irreducible modulo 3.

Original entry on oeis.org

10, 11, 12, 20, 21, 22, 101, 112, 122, 202, 211, 221, 1021, 1022, 1102, 1112, 1121, 1201, 1211, 1222, 2011, 2012, 2102, 2111, 2122, 2201, 2212, 2221, 10012, 10022, 10102, 10111, 10121, 10202, 11002, 11021, 11101, 11111, 11122, 11222
Offset: 1

Views

Author

Clark Kimberling, Feb 26 2012

Keywords

Comments

For a discussion and examples in base-10 representation, see A207670. For the analogous sequence in base 2, see A206073.

Examples

			(See the Example section of A207669.)
		

Crossrefs

Programs

  • Mathematica
    t = Table[IntegerDigits[n, 3], {n, 1, 1000}];
    b[n_] := Reverse[Table[x^k, {k, 0, n}]]
    p[n_, x_] := t[[n]].b[-1 + Length[t[[n]]]]
    Table[p[n, x], {n, 1, 15}]
    u = {}; Do[n++;
    If[IrreduciblePolynomialQ[p[n, x], Modulus -> 3],
      AppendTo[u, n]], {n, 1, 400}]
    u                           (* A207669 *)
    Complement[Range[200], %]   (* A207670 *)
    b[n_] := FromDigits[IntegerDigits[u, 3][[n]]]
    Table[b[n], {n, 1, 50}]     (* A207671 *)
Showing 1-4 of 4 results.