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

A264967 Permutation of nonnegative integers: a(n) = A263272(A246200(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 05 2015

Keywords

Crossrefs

Inverse: A264968.
Cf. also A264965, A264966.

Programs

Formula

a(n) = A263272(A246200(n)).
Other identities. For all n >= 0:
A000035(a(n)) = A000035(n). [This permutation preserves the parity of numbers.]

A264968 Permutation of nonnegative integers: a(n) = A246200(A263272(n)).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 11, 8, 9, 10, 7, 12, 19, 14, 15, 32, 27, 18, 39, 20, 33, 26, 17, 24, 25, 38, 23, 28, 13, 30, 41, 16, 21, 34, 35, 36, 31, 22, 29, 40, 37, 42, 123, 68, 75, 86, 47, 96, 135, 70, 81, 152, 77, 46, 53, 56, 107, 110, 59, 60, 163, 82, 99, 108, 65, 142, 111, 44, 51, 134, 57, 72, 139, 62, 147, 156, 83, 58, 87, 80, 69
Offset: 0

Views

Author

Antti Karttunen, Dec 05 2015

Keywords

Crossrefs

Inverse: A264967.
Cf. also A264965, A264966.

Programs

Formula

a(n) = A246200(A263272(n)).
Other identities. For all n >= 0:
A000035(a(n)) = A000035(n). [This permutation preserves the parity of numbers.]

A280509 a(n) = A051064(A246200(n)); 3-adic valuation of A057889(3*n).

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 4, 2, 1, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 3, 1, 1, 1, 1, 1, 2, 1, 1, 2, 4, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 5, 1, 2, 3, 1, 1, 3, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 4, 1, 1, 2, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 4, 1, 1, 2, 1, 1, 2, 2
Offset: 1

Views

Author

Antti Karttunen, Jan 09 2017

Keywords

Crossrefs

Differs from A051064 for the first time at n=23, where a(23) = 4, while A051064(23) = 1.
Cf. also A265331.

Programs

Formula

a(n) = A007949(A057889(3*n)).
a(n) = A051064(A246200(n)).

A286588 a(n) = A278222(A246200(n)).

Original entry on oeis.org

1, 2, 2, 4, 2, 6, 4, 8, 2, 6, 6, 12, 4, 12, 8, 16, 2, 6, 6, 12, 6, 30, 12, 36, 4, 12, 12, 24, 8, 24, 16, 32, 2, 6, 6, 12, 6, 30, 12, 24, 6, 30, 30, 60, 12, 60, 36, 72, 4, 12, 12, 36, 12, 60, 24, 72, 8, 24, 24, 48, 16, 48, 32, 64, 2, 6, 6, 12, 6, 30, 12, 24, 6, 30, 30, 60, 12, 60, 24, 48, 6, 30, 30, 60, 30, 210, 60, 180, 12, 60, 60, 180, 36
Offset: 0

Views

Author

Antti Karttunen, Jun 03 2017

Keywords

Crossrefs

Cf. A246200, A278222, A286589 (rgs-version of this sequence).

Programs

Formula

a(n) = A278222(A246200(n)).

A057889 Bijective bit-reverse of n: keep the trailing zeros in the binary expansion of n fixed, but reverse all the digits up to that point.

Original entry on oeis.org

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

Views

Author

Marc LeBrun, Sep 25 2000

Keywords

Comments

The original name was "Bit-reverse of n, including as many leading as trailing zeros." - Antti Karttunen, Dec 25 2024
A permutation of integers consisting only of fixed points and pairs. a(n)=n when n is a binary palindrome (including as many leading as trailing zeros), otherwise a(n)=A003010(n) (i.e. n has no axis of symmetry). A057890 gives the palindromes (fixed points, akin to A006995) while A057891 gives the "antidromes" (pairs). See also A280505.
This is multiplicative in domain GF(2)[X], i.e. with carryless binary arithmetic. A193231 is another such permutation of natural numbers. - Antti Karttunen, Dec 25 2024

Examples

			a(6)=6 because 0110 is a palindrome, but a(11)=13 because 1011 reverses into 1101.
		

Crossrefs

Cf. A030101, A000265, A006519, A006995, A057890, A057891, A280505, A280508, A331166 [= min(n,a(n))], A366378 [k for which a(k) = k (mod 3)], A369044 [= A014963(a(n))].
Similar permutations for other bases: A263273 (base-3), A264994 (base-4), A264995 (base-5), A264979 (base-9).
Other related (binary) permutations: A056539, A193231.
Compositions of this permutation with other binary (or other base-related) permutations: A264965, A264966, A265329, A265369, A379471, A379472.
Compositions with permutations involving prime factorization: A245450, A245453, A266402, A266404, A293448, A366275, A366276.
Other derived permutations: A246200 [= a(3*n)/3], A266351, A302027, A302028, A345201, A356331, A356332, A356759, A366389.
See also A235027 (which is not a permutation).

Programs

  • Mathematica
    Table[FromDigits[Reverse[IntegerDigits[n, 2]], 2]*2^IntegerExponent[n, 2], {n, 71}] (* Ivan Neretin, Jul 09 2015 *)
  • PARI
    A030101(n) = if(n<1,0,subst(Polrev(binary(n)),x,2));
    A057889(n) = if(!n,n,A030101(n/(2^valuation(n,2))) * (2^valuation(n, 2))); \\ Antti Karttunen, Dec 25 2024
  • Python
    def a(n):
        x = bin(n)[2:]
        y = x[::-1]
        return int(str(int(y))+(len(x) - len(str(int(y))))*'0', 2)
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 11 2017
    
  • Python
    def A057889(n): return int(bin(n>>(m:=(~n&n-1).bit_length()))[-1:1:-1],2)<Chai Wah Wu, Dec 25 2024
    

Formula

a(n) = A030101(A000265(n)) * A006519(n), with a(0)=0.

Extensions

Clarified the name with May 30 2016 comment from N. J. A. Sloane, and moved the old name to the comments - Antti Karttunen, Dec 25 2024

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

A266643 Permutation of nonnegative integers: a(n) = A264965(3*n) / 3.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 04 2016

Keywords

Crossrefs

Formula

a(n) = A264965(3*n) / 3.
As a composition of related permutations:
a(n) = A263273(A246200(n)).

A266644 Permutation of nonnegative integers: a(n) = A264966(3*n) / 3.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 04 2016

Keywords

Crossrefs

Inverse: A266643.
Differs from A264965 for the first time at n=17, where a(17) = 35, while A264965(17) = 25.

Programs

Formula

a(n) = A264966(3*n) / 3.
As a composition of related permutations:
a(n) = A246200(A263273(n)).

A264993 Self-inverse permutation of nonnegative integers: a(n) = A264994(3*n)/3.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 07 2015

Keywords

Crossrefs

Cf. A264994.
Cf. also A246200, A265335.

Programs

Showing 1-9 of 9 results.