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

A265343 Permutation of nonnegative integers: a(n) = A264978(A263272(n)).

Original entry on oeis.org

0, 1, 2, 3, 8, 5, 6, 17, 4, 9, 10, 7, 24, 26, 14, 15, 44, 16, 18, 19, 20, 51, 53, 11, 12, 35, 13, 27, 28, 29, 30, 89, 23, 21, 62, 22, 72, 71, 25, 78, 80, 41, 42, 125, 43, 45, 46, 47, 132, 134, 50, 48, 143, 49, 54, 55, 56, 57, 170, 59, 60, 179, 58, 153, 152, 52, 159, 161, 32, 33, 98, 31, 36, 37, 34, 105, 107, 38, 39, 116, 40, 81
Offset: 0

Views

Author

Antti Karttunen, Dec 07 2015

Keywords

Comments

Composition of A263272 with the permutation obtained from its quadrisection. Equally: composition of permutations that are obtained from the bisection and octisection of A263273.

Crossrefs

Inverse: A265344.
Cf. also A265363.

Programs

Formula

a(n) = A264978(A263272(n)).
Other identities. For all n >= 0:
a(3*n) = 3*a(n).

A265344 Permutation of nonnegative integers: a(n) = A263272(A264978(n)).

Original entry on oeis.org

0, 1, 2, 3, 8, 5, 6, 11, 4, 9, 10, 23, 24, 26, 14, 15, 17, 7, 18, 19, 20, 33, 35, 32, 12, 38, 13, 27, 28, 29, 30, 71, 68, 69, 74, 25, 72, 73, 77, 78, 80, 41, 42, 44, 16, 45, 46, 47, 51, 53, 50, 21, 65, 22, 54, 55, 56, 57, 62, 59, 60, 101, 34, 99, 100, 104, 105, 107, 95, 96, 98, 37, 36, 109, 110, 114, 116, 113, 39, 119, 40, 81
Offset: 0

Views

Author

Antti Karttunen, Dec 07 2015

Keywords

Comments

Composition of A263272 with the permutation obtained from its quadrisection. Equally: composition of permutations that are obtained from the bisection and octisection of A263273.

Crossrefs

Inverse: A265343.
Cf. also A265364.

Programs

Formula

a(n) = A263272(A264978(n)).
Other identities. For all n >= 0:
a(3*n) = 3*a(n).

A265365 Permutation of nonnegative integers: a(n) = A264978(A263273(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 07 2015

Keywords

Comments

Composition of A263273 with the permutation obtained from its octisection.

Crossrefs

Inverse: A265366.
Cf. also A265363.

Programs

Formula

a(n) = A264978(A263273(n)).
Other identities. For all n >= 0:
a(3*n) = 3*a(n).

A265366 Permutation of nonnegative integers: a(n) = A263273(A264978(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 07 2015

Keywords

Comments

Composition of A263273 with the permutation obtained from its octisection.

Crossrefs

Inverse: A265365.
Cf. also A265364.

Programs

Formula

a(n) = A263273(A264978(n)).
Other identities. For all n >= 0:
a(3*n) = 3*a(n).

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

A263272 Self-inverse permutation of nonnegative integers: a(n) = A263273(2*n) / 2.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 11, 8, 9, 10, 7, 12, 13, 14, 15, 32, 23, 18, 29, 20, 33, 38, 17, 24, 35, 26, 27, 28, 19, 30, 37, 16, 21, 34, 25, 36, 31, 22, 39, 40, 41, 42, 95, 68, 45, 86, 59, 96, 113, 50, 69, 104, 77, 54, 83, 56, 87, 110, 47, 60, 101, 74, 99, 92, 65, 114, 119, 44, 51, 98, 71, 72, 89, 62, 105, 116, 53, 78, 107, 80, 81
Offset: 0

Views

Author

Antti Karttunen, Dec 05 2015

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{g, h}, g[x_] := x/3^IntegerExponent[x, 3]; h[x_] := x/g@ x; If[n == 0, 0, FromDigits[Reverse@ IntegerDigits[#, 3], 3] &@ g[n] h[n]]]; Table[f[2 n]/2, {n, 0, 81}] (* Michael De Vlieger, Jan 04 2016,after Jean-François Alcover at A263273 *)
  • 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 a(n): return a263273(2*n)/2 # Indranil Ghosh, May 23 2017
  • Scheme
    (define (A263272 n) (/ (A263273 (+ n n)) 2))
    

Formula

a(n) = A263273(2*n) / 2 = A264984(n) / 2.
As a composition of related permutations:
a(n) = A264974(A264975(n)) = A264976(A264974(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.]
A264974(n) = a(2n)/2. [Thus the restriction onto even numbers induces yet another permutation.]

A264974 Self-inverse permutation of natural numbers: a(n) = A263273(4*n) / 4.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 16, 9, 10, 19, 12, 13, 14, 15, 8, 17, 18, 11, 20, 21, 34, 43, 48, 25, 52, 27, 28, 55, 30, 37, 46, 57, 22, 49, 36, 31, 58, 39, 40, 41, 42, 23, 50, 45, 32, 59, 24, 35, 44, 51, 26, 53, 54, 29, 56, 33, 38, 47, 60, 61, 142, 63, 88, 169, 102, 115, 124, 129, 70, 151, 144, 97, 178, 75, 106, 133, 156, 79, 160, 81
Offset: 0

Views

Author

Antti Karttunen, Dec 05 2015

Keywords

Crossrefs

Terms of A264986 halved.
Cf. also A264975, A264976.

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 a(n): return a263273(4*n)/4 # Indranil Ghosh, May 25 2017

Formula

a(n) = A263273(4*n) / 4.
a(n) = A264986(n) / 2 = A263272(2*n) / 2.
As a composition of related permutations:
a(n) = A264975(A263272(n)) = A263272(A264976(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.]
A264978(n) = a(2n)/2. [Thus the restriction onto even numbers induces yet another permutation.]

A265338 Self-inverse permutation of nonnegative integers: a(n) = A264979(8*n) / 8.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 07 2015

Keywords

Comments

It appears that A264979(m x) == 0 (mod m) for m = 2^k and m = 5*2^k, k >= 0, but not for other m. Is there a simple explanation? - M. F. Hasler, May 21 2021

Crossrefs

Cf. A264979.
Cf. also A264978.

Programs

Formula

a(n) = A264979(8*n) / 8.
Showing 1-8 of 8 results.