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 14 results. Next

A265354 Permutation of nonnegative integers: a(n) = A263273(A264985(n)).

Original entry on oeis.org

0, 1, 3, 2, 4, 9, 6, 10, 12, 7, 5, 19, 8, 13, 27, 18, 28, 36, 21, 11, 57, 24, 37, 30, 15, 31, 39, 22, 16, 64, 23, 14, 55, 20, 46, 58, 25, 17, 73, 26, 40, 81, 54, 82, 108, 63, 29, 171, 72, 109, 90, 45, 85, 117, 66, 34, 192, 69, 38, 165, 60, 100, 174, 75, 35, 219, 78, 118, 84, 33, 91, 93, 48, 32, 138, 51, 112, 111, 42, 94, 120, 67
Offset: 0

Views

Author

Antti Karttunen, Dec 07 2015

Keywords

Comments

Composition of A263273 with the permutation obtained from its odd bisection.

Crossrefs

Inverse: A265353.
Cf. also A265352, A265355, A265356.

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 a264985(n): return (a263273(2*n + 1) - 1)/2
    def a(n): return a263273(a264985(n)) # Indranil Ghosh, May 22 2017
  • Scheme
    (define (A265354 n) (A263273 (A264985 n)))
    

Formula

a(n) = A263273(A264985(n)).

A265353 Permutation of nonnegative integers: a(n) = A264985(A263273(n)).

Original entry on oeis.org

0, 1, 3, 2, 4, 10, 6, 9, 12, 5, 7, 19, 8, 13, 31, 24, 28, 37, 15, 11, 33, 18, 27, 30, 21, 36, 39, 14, 16, 46, 23, 25, 73, 69, 55, 64, 17, 22, 58, 26, 40, 94, 78, 85, 112, 51, 34, 100, 72, 82, 91, 75, 109, 118, 42, 32, 96, 20, 35, 105, 60, 99, 102, 45, 29, 87, 54, 81, 84, 57, 90, 93, 48, 38, 114, 63, 108, 111, 66, 117, 120, 41
Offset: 0

Views

Author

Antti Karttunen, Dec 07 2015

Keywords

Comments

Composition of A263273 with the permutation obtained from its odd bisection.

Crossrefs

Inverse: A265354.

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 a264985(n): return (a263273(2*n + 1) - 1)/2
    def a(n): return a264985(a263273(n)) # Indranil Ghosh, May 22 2017
  • Scheme
    (define (A265353 n) (A264985 (A263273 n)))
    

Formula

a(n) = A264985(A263273(n)).

A265355 Permutation of nonnegative integers: a(n) = A263272(A264985(n)).

Original entry on oeis.org

0, 1, 3, 2, 4, 9, 6, 10, 12, 5, 11, 7, 8, 13, 27, 18, 28, 36, 15, 29, 21, 24, 37, 30, 33, 31, 39, 14, 32, 16, 17, 38, 19, 20, 34, 22, 23, 35, 25, 26, 40, 81, 54, 82, 108, 45, 83, 63, 72, 109, 90, 99, 85, 117, 42, 86, 48, 51, 110, 57, 60, 88, 66, 69, 89, 75, 78, 118, 84, 87, 91, 93, 96, 92, 102, 105, 112, 111, 114, 94, 120, 41
Offset: 0

Views

Author

Antti Karttunen, Dec 07 2015

Keywords

Comments

Composition of permutations obtained from the bisections of A263273.

Crossrefs

Programs

Formula

a(n) = A263272(A264985(n)).

A265356 Permutation of nonnegative integers: a(n) = A264985(A263272(n)).

Original entry on oeis.org

0, 1, 3, 2, 4, 9, 6, 11, 12, 5, 7, 10, 8, 13, 27, 18, 29, 30, 15, 32, 33, 20, 35, 36, 21, 38, 39, 14, 16, 19, 23, 25, 28, 24, 34, 37, 17, 22, 31, 26, 40, 81, 54, 83, 84, 45, 86, 87, 56, 89, 90, 57, 92, 93, 42, 95, 96, 59, 98, 99, 60, 101, 102, 47, 104, 105, 62, 107, 108, 63, 110, 111, 48, 113, 114, 65, 116, 117, 66, 119, 120, 41
Offset: 0

Views

Author

Antti Karttunen, Dec 07 2015

Keywords

Comments

Composition of permutations obtained from the bisections of A263273.

Crossrefs

Programs

Formula

a(n) = A264985(A263272(n)).

A264991 Permutation of nonnegative integers: a(n) = A264989(A264985(n)).

Original entry on oeis.org

0, 1, 5, 2, 4, 14, 6, 16, 17, 3, 7, 8, 11, 13, 41, 15, 43, 44, 18, 19, 59, 56, 49, 50, 47, 52, 53, 9, 10, 32, 29, 22, 23, 20, 25, 26, 12, 34, 35, 38, 40, 122, 42, 124, 125, 45, 46, 140, 137, 130, 131, 128, 133, 134, 54, 55, 167, 164, 58, 176, 60, 178, 179, 57, 169, 170, 173, 148, 149, 51, 151, 152, 48
Offset: 0

Views

Author

Antti Karttunen, Dec 05 2015

Keywords

Crossrefs

Inverse: A264992.
Cf. also A264975, A264976.

Programs

Formula

a(n) = A264989(A264985(n)).

A264992 Permutation of nonnegative integers: a(n) = A264985(A264989(n)).

Original entry on oeis.org

0, 1, 3, 9, 4, 2, 6, 10, 11, 27, 28, 12, 36, 13, 5, 15, 7, 8, 18, 19, 33, 99, 31, 32, 96, 34, 35, 81, 82, 30, 90, 85, 29, 87, 37, 38, 108, 109, 39, 117, 40, 14, 42, 16, 17, 45, 46, 24, 72, 22, 23, 69, 25, 26, 54, 55, 21, 63, 58, 20, 60, 100, 101, 297, 298, 102, 306, 94, 95, 285, 97, 98, 288
Offset: 0

Views

Author

Antti Karttunen, Dec 05 2015

Keywords

Crossrefs

Inverse: A264991.
Cf. also A264975, A264976.

Programs

Formula

a(n) = A264985(A264989(n)).

A266190 Self-inverse permutation of nonnegative integers: a(n) = A264985(A263273(A264985(n))).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 02 2016

Keywords

Comments

A263273 conjugated with the permutation obtained from its odd bisection.

Crossrefs

Cf. A265369, A265904, A266401, A266403 (other conjugates or similar derivations of A263273).
Cf. also A266189.

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]]]; s = Select[f /@ Range@ 5000, OddQ]; t = Table[(s[[n + 1]] - 1)/2, {n, 0, 1000}]; Table[t[[f[t[[n + 1]]] + 1]], {n, 0, 83}] (* Michael De Vlieger, Jan 04 2016, after Jean-François Alcover at A263273 *)
  • Scheme
    (define (A266190 n) (A264985 (A263273 (A264985 n))))

Formula

a(n) = A264985(A263273(A264985(n))).
As a composition of related permutations:
a(n) = A265353(A264985(n)).
a(n) = A264985(A265354(n)).

A264996 Self-inverse permutation of natural numbers: a(n) = (1/2) * (1+A263273(2n -1)) = 1 + A264985(n-1).

Original entry on oeis.org

1, 2, 4, 3, 5, 10, 7, 11, 13, 6, 8, 12, 9, 14, 28, 19, 29, 37, 16, 20, 34, 25, 32, 31, 22, 38, 40, 15, 17, 33, 24, 23, 30, 21, 35, 39, 18, 26, 36, 27, 41, 82, 55, 83, 109, 46, 56, 100, 73, 86, 91, 64, 110, 118, 43, 47, 97, 70, 59, 88, 61, 101, 115, 52, 74, 106, 79, 95, 85, 58, 92, 112, 49, 65, 103, 76
Offset: 1

Views

Author

Antti Karttunen, Jan 04 2016

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]]]; Array[(1/2) (1 + f[2 # - 1]) &, {76}] (* Michael De Vlieger, Jan 04 2016, after Jean-François Alcover at A263273 *)

Formula

a(n) = (1/2) * (1+A263273((2*n)-1)).
a(n) = 1 + A264985(n-1).

A266189 Self-inverse permutation of nonnegative integers: a(n) = A263273(A264985(A263273(n))).

Original entry on oeis.org

0, 1, 3, 2, 4, 10, 6, 9, 12, 7, 5, 11, 8, 13, 37, 24, 28, 31, 21, 19, 57, 18, 27, 30, 15, 36, 39, 22, 16, 34, 23, 17, 35, 69, 29, 32, 25, 14, 38, 26, 40, 118, 78, 109, 112, 75, 46, 100, 72, 82, 91, 51, 85, 94, 66, 64, 192, 20, 73, 219, 60, 171, 138, 63, 55, 165, 54, 81, 84, 33, 90, 111, 48, 58, 174, 45, 108, 93, 42, 117, 120, 67, 49
Offset: 0

Views

Author

Antti Karttunen, Jan 02 2016

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]]]; s = Select[f /@ Range@ 5000, OddQ]; t = Table[(s[[n + 1]] - 1)/2, {n, 0, 1000}]; Table[f@ t[[f@ n + 1]], {n, 0, 82}] (* 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 a264985(n): return (a263273(2*n + 1) - 1)/2
    def a(n): return a263273(a264985(a263273(n))) # Indranil Ghosh, May 22 2017
  • Scheme
    (define (A266189 n) (A263273 (A264985 (A263273 n))))
    

Formula

a(n) = A263273(A264985(A263273(n))).
As a composition of related permutations:
a(n) = A263273(A265353(n)).
a(n) = A265354(A263273(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.]
Showing 1-10 of 14 results. Next