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

A235027 Reverse the bits of prime divisors of n (with 2 -> 2), and multiply together: a(0)=0, a(1)=1, a(2)=2, a(p) = revbits(p) for odd primes p, a(u*v) = a(u) * a(v) for composites.

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, 25, 22, 27, 28, 23, 30, 31, 32, 39, 34, 35, 36, 41, 50, 33, 40, 37, 42, 53, 52, 45, 58, 61, 48, 49, 50, 51, 44, 43, 54, 65, 56, 75, 46, 55, 60, 47, 62, 63, 64, 55, 78, 97
Offset: 0

Views

Author

Antti Karttunen, Jan 02 2014

Keywords

Comments

This is not a permutation of integers: a(25) = 25 = 5*5 = a(19) is the first case which breaks the injectivity. However, the first 24 terms are equal with A057889, which is a GF(2)[X]-analog of this sequence and which in contrary to this, is bijective. This stems from the fact that the set of irreducible GF(2)[X] polynomials (A014580) is closed under bit-reversal (A056539), while primes (A000040) are not.
Sequence A290078 gives the positions n where the ratio a(n)/n obtains new record values.
Note, instead of A056539 we could as well use A057889 to reverse the bits of n, and also A030101 when restricted to odd primes.

Examples

			a(33) = a(3*11) = a(3) * a(11) = 3 * 13 = 39 (because 3, in binary '11', stays same when reversed, while 11 (eleven), in binary '1011', changes to '1101' = 13).
		

Crossrefs

A235028 gives the fixed points. A235030 numbers such that n <> a(a(n)), or equally A001222(a(n)) > A001222(n). A235145 the number of iterations needed to reach a fixed point or cycle of 2, A235146 its records.

Programs

  • Mathematica
    f[p_, e_] := IntegerReverse[p, 2]^e; f[2, e_] := 2^e; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100, 0] (* Amiram Eldar, Sep 03 2023 *)
  • PARI
    revbits(n) = fromdigits(Vecrev(binary(n)), 2);
    a(n) = {my(f = factor(n)); for (k=1, #f~, if (f[k,1] != 2, f[k,1] = revbits(f[k,1]););); factorback(f);} \\ Michel Marcus, Aug 05 2017

Formula

Completely multiplicative with a(0)=0, a(1)=1, a(p) = A056539(p) for primes p (which maps 2 to 2, and reverses the binary representation of odd primes), and a(u*v) = a(u) * a(v) for composites.
Equally, after a(0)=0, a(p * q * ... * r) = A056539(p) * A056539(q) * ... * A056539(r), for primes p, q, etc., not necessarily distinct.
a(0)=0, a(1)=1, a(n) = A056539(A020639(n)) * a(n/A020639(n)).

A235146 a(n) = Least integer k such that it takes n iterations of "factor and reverse bits of odd prime divisors" (A235027) before a fixed point or cycle of 2 is reached; records in A235145.

Original entry on oeis.org

0, 19, 139, 719, 4793, 23773, 260863, 2375231, 21793843
Offset: 0

Views

Author

Antti Karttunen, Jan 03 2014

Keywords

Comments

Note, as for all composite values A235145(u * v) = max(A235145(u), A235145(v)) which can be further reduced as A235145(n) = Max_{p|n} A235145(p), and because for any odd prime p, lpf(A056539(p)) >= 3 (where lpf = A020639, the least prime dividing n) while 1/2 < A056539(n)/n < 2, it follows that this sequence gives also the positions of the records in A235145, as its new values must appear in order.
Also, because of that multiplicativity criterion, all terms (after zero) must be primes, and specifically, the terms are a subset of A235030 (i.e., of A204219).
Conjecture: additional property is that the primes here belong to that subset of p in A204219 for which A056539(p) > p. The list of such primes begins as: 19, 79, 103, 137, 139, 149, 157, 179, 191, 239, 271, 281, 293, 311, 317, 347, 367, 379, 439, 523, 541, 547, 557, 563, 569, 587, 607, 613, 647, 659, 719, 733, 743, 751, 787, ...

Crossrefs

A subset of A235030 and A204219.

Programs

  • PARI
    revbits(n) = fromdigits(Vecrev(binary(n)), 2);
    a235027(n) = {f = factor(n); for (k=1, #f~, if (f[k,1] != 2, f[k,1] = revbits(f[k,1]););); factorback(f);}
    find(v, newn) = {for(k=1, #v, if (v[#v -k + 1] == newn, return (k));); return (0);}
    a235145(n) = {ok = 0; v = [n]; while (! ok, newn = a235027(n); ind = find(v, newn); if (ind, ok = 1, v = concat(v, newn); n = newn);); #v - ind;}
    a(n) = {k = 0; while (a235145(k) != n, k = nextprime(k+1)); k;}
    lista(nn) = {kprec = 0; for (n=0, nn, k = kprec; while (a235145(k) != n, k = nextprime(k+1)); print1(k, ", "); kprec = k;);} \\ Michel Marcus, Aug 06 2017

Extensions

a(5)-a(8) from Michel Marcus, Aug 06 2017

A235028 Fixed points of A235027.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 21, 24, 25, 27, 28, 30, 31, 32, 34, 35, 36, 40, 42, 45, 48, 49, 50, 51, 54, 56, 60, 62, 63, 64, 68, 70, 72, 73, 75, 80, 81, 84, 85, 90, 93, 96, 98, 100, 102, 105, 107, 108, 112, 119, 120, 124, 125
Offset: 1

Views

Author

Antti Karttunen, Jan 02 2014

Keywords

Comments

The first 20 terms are equal with A057890, after which a(21)=25, while A057890(21)=27. On the other hand, 33 is the first term which occurs in A057890 but does not occur here.
If terms x and y are included, then also their product x*y is included. If term x is included, then 2^k * x is also included. The sequence contains also all primes in A016041 and their mutual multiples. However, in addition to that, there are also terms like 143 = 11*13, where A235027 will map the factors to each other (as their binary expansions '1011' and '1101' are mirror images of each other), even although neither of them is present in A016041. (These latter kind of primes are in A074832).
Please use the "graph" link to see how the terms get rarer.

Crossrefs

The primes in this sequence: A016041.
Showing 1-3 of 3 results.