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

A331746 Lexicographically earliest infinite sequence such that a(i) = a(j) => A009194(i) = A009194(j) and A331166(i) = A331166(j) for all i, j.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 04 2020

Keywords

Comments

Restricted growth sequence transform of the ordered pair [A009194(n), A331166(n)].
For all i, j:
a(i) = a(j) => A331747(i) = A331747(j).

Crossrefs

Programs

  • PARI
    \\ Needs also code from A331166.
    up_to = 65537;
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    A009194(n) = gcd(n, sigma(n));
    Aux331746(n) = [A009194(n),A331166(n)];
    v331746 = rgs_transform(vector(up_to, n, Aux331746(n)));
    A331746(n) = v331746[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

A331300 Lexicographically earliest infinite sequence such that a(i) = a(j) => f(i) = f(j), where f(n) = min(n, A057889(n)), and A057889 is a bijective base-2 reverse.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 18 2020

Keywords

Comments

Restricted growth sequence transform of A331166. See comments in that sequence.

Crossrefs

Cf. also A324400, A331303, A305801, A305801, A305900, A295300 for other "top level" filtering sequences.

Programs

  • PARI
    up_to = 100000;
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    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)));
    A331166(n) = min(n, A057889(n));
    v331300 = rgs_transform(vector(1+up_to,n,A331166(n-1)));
    A331300(n) = v331300[1+n];
    for(n=0,up_to,write("b331300.txt", n, " ", A331300(n)));

A331167 a(n) = min(n, A193231(n)), where A193231(n) is blue code of n.

Original entry on oeis.org

0, 1, 2, 2, 4, 4, 6, 7, 8, 9, 10, 11, 10, 11, 9, 8, 16, 16, 18, 19, 20, 21, 22, 22, 24, 25, 26, 27, 27, 26, 24, 25, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 34, 35, 33, 32, 39, 38, 36, 37, 45, 44, 46, 47, 40, 41, 43, 42, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 68, 69, 71, 70, 65, 64, 66, 67, 75, 74, 72, 73, 78, 79, 77, 76
Offset: 0

Views

Author

Antti Karttunen, Jan 12 2020

Keywords

Comments

For all i, j > 0: a(i) = a(j) => A280501(i) = A280501(j).

Crossrefs

Cf. also A331166.

Programs

  • PARI
    A331167(n) = { my(x='x); min(n,subst(lift(Mod(1, 2)*subst(Pol(binary(n), x), x, 1+x)), x, 2)); };

Formula

a(n) = min(n, A193231(n)).

A331173 a(n) = min(n, A263273(n)), where A263273 is bijective base-3 reverse.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 11, 20, 15, 14, 23, 24, 17, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 31, 38, 39, 40, 41, 42, 43, 44, 45, 34, 47, 48, 43, 50, 51, 52, 53, 54, 29, 56, 33, 38, 59, 60, 47, 62, 45, 32, 59, 42, 41, 68, 69, 50, 71, 72, 35, 62, 51, 44, 71, 78, 53, 80, 81
Offset: 0

Views

Author

Antti Karttunen, Jan 12 2020

Keywords

Comments

For all i, j:
a(i) = a(j) => A290094(i) = A290094(j).
For all i, j > 0:
a(i) = a(j) => A007949(i) = A007949(j).

Crossrefs

Programs

Showing 1-5 of 5 results.