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

A235145 a(n) = Number of steps to reach a fixed point or 2-cycle, when iterating A235027 starting from value n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2
Offset: 0

Views

Author

Antti Karttunen, Jan 03 2014

Keywords

Comments

Equally, a(n) = minimum number of steps needed to repeat k = A235027(k)(starting from k = n) until A001222(A235027(k)) = A001222(k).
Or in other words, how many times are needed to repeatedly factorize the number, to reverse the bits of each odd prime factor (with A056539) and factorize and bit-reverse the reversed factors again, until the number of prime divisors no more grows, meaning that we have found either a fixed point or entered a cycle of two.

Examples

			19, '10011' in binary, when reversed, yields '11001' = 25, when factored, yields 5 * 5, ('101' * '101' in binary), which divisors stay same when reversed, thus it took one iteration step to reach a point where the number of prime divisors no more grows. Thus a(19)=1.
		

Crossrefs

A235146 gives the positions of records. Cf. A001222, A056539, A074832, A235027.

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);}
    a(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;} \\ Michel Marcus, Aug 06 2017

Formula

If A235027(A235027(n)) = n, a(n)=0, otherwise 1+a(A235027(n)).
Equally, if A001222(A235027(n)) = A001222(n), a(n)=0, otherwise 1+a(A235027(n)).
a(2n) = a(n), and in general, for composite values a(u * v) = max(a(u),a(v)).
For composite n, a(n) = Max_{p|n} a(p). [The above reduces to this: select the maximal value from all values a(p) computed for primes p dividing n]
For prime p, a(p) = 0 if A056539(p) is also prime (p is 2 or in A074832), otherwise a(p) = 1+a(A056539(p)).

A235030 Numbers such that A235027(A235027(n)) <> n; Numbers which are divisible by any of the odd terms of A204219.

Original entry on oeis.org

19, 38, 57, 59, 76, 79, 89, 95, 103, 109, 114, 118, 133, 137, 139, 149, 152, 157, 158, 171, 177, 178, 179, 190, 191, 206, 209, 211, 218, 228, 236, 237, 239, 241, 247, 266, 267, 271, 274, 278, 281, 285, 293, 295, 298, 304, 309, 311, 314, 316, 317, 323, 327, 342
Offset: 1

Views

Author

Antti Karttunen, Jan 02 2014

Keywords

Comments

Sequence consists of all the primes in A204219 (after 2), together with all of their multiples.
Note that this is not the same as the numbers that do not occur in A235027 ("Garden of Eden" numbers for A235027), a subsequence of this sequence, which begins as: 19, 38, 57, 59, 76, 79, 89, 95, 103, 109, 114, 118, 133, 137, 139, 149, 152, 157, 158, 171, 177, 178, 179, 190, 191, 206, 211, 218, 228, 236, 237, 239, 241, 266, 267, 271, 274, 278, 281, 285, 293, 298, 304, 309, 311, 314, 316, 317, 327, 342, 347, 354, 356, 358, ...
The first term that occurs in this sequence, but not in the "GoE"-sequence is a(27)=209, as a(139) = 209 = 11*19 and 139 = A235146(2), the least integer which requires two steps to reach a fixed point or 2-cycle.
Both the above "GoE"-sequence, and its differences from this will be submitted later.

Crossrefs

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.

A290078 Where the ratio A235027(n)/n obtains record values.

Original entry on oeis.org

1, 11, 19, 67, 71, 263, 271, 781, 1273, 1349, 2981, 4757, 5041, 18157, 18673, 19241, 55451, 71273, 73441, 95779, 211651, 337747, 357911, 1289147, 1325783, 1366111, 3937021, 5060383, 5214311, 6800309, 15027221, 19314983, 19902511, 23980037, 25411681
Offset: 1

Views

Author

Antti Karttunen, Aug 07 2017

Keywords

Comments

Because A056539(n)/n < 2 for all n, and already for the tenth term of this sequence 1349 we have A235027(1349)/1349 = 2.094... it follows that the only primes present are terms a(2) .. a(7): 11, 19, 67, 71, 263, 271. Conjecture: every term after that is a product of some of those six primes. For example: 781 = 11*71, 1273 = 19*67, 1349 = 19*71, 2981 = 11*271, 4757 = 67*71, 5041 = 71*71.

Crossrefs

Cf. A235027.

Programs

  • PARI
    revbits(n) = fromdigits(Vecrev(binary(n)), 2);
    A235027(n) = {my(f = factor(n)); for (k=1, #f~, if (f[k, 1] != 2, f[k, 1] = revbits(f[k, 1]); ); ); factorback(f); } \\ This function from Michel Marcus, Aug 05 2017
    m=0; i=0; n=0; while(i<35, n++; if((A235027(n)/n) > m, m = A235027(n)/n; i++; print1(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

A091214 Composite numbers whose binary representation encodes a polynomial irreducible over GF(2).

Original entry on oeis.org

25, 55, 87, 91, 115, 117, 143, 145, 171, 185, 203, 213, 247, 253, 285, 299, 301, 319, 333, 351, 355, 357, 361, 369, 375, 391, 395, 415, 425, 445, 451, 471, 477, 501, 505, 515, 529, 535, 539, 545, 623, 637, 665, 675, 687, 695, 721, 731, 789, 799, 803, 817
Offset: 1

Views

Author

Antti Karttunen, Jan 03 2004

Keywords

Comments

"Encoded in binary representation" means that a polynomial a(n)*X^n+...+a(0)*X^0 over GF(2) is represented by the binary number a(n)*2^n+...+a(0)*2^0 in Z (where each coefficient a(k) = 0 or 1).

Crossrefs

Intersection of A002808 and A014580.
Subsequence of A235033, A236834 and A236838.
Left inverse: A235044.
Cf. A091206 (Primes whose binary expansion encodes a polynomial irreducible over GF(2)), A091209 (Primes that encode a polynomial reducible over GF(2)), A091212 (Composite, and reducible over GF(2)).
Cf. also A235041-A235042.

Programs

  • Mathematica
    fQ[n_] := Block[{ply = Plus @@ (Reverse@ IntegerDigits[n, 2] x^Range[0, Floor@ Log2@ n])}, ply == Factor[ply, Modulus -> 2] && n != 2^Floor@ Log2@ n && ! PrimeQ@ n]; Select[ Range@ 840, fQ] (* Robert G. Wilson v, Aug 12 2011 *)
  • PARI
    isA014580(n)=polisirreducible(Pol(binary(n))*Mod(1, 2)); \\ This function from Charles R Greathouse IV
    isA091214(n) = (!isprime(n) && isA014580(n));
    n = 0; i = 0; while(n < 2^20, n++; if(isA091214(n), i++; write("b091214.txt", i, " ", n)));
    \\ The b-file was computed with this program. Antti Karttunen, May 17 2015

Formula

Other identities. For all n >= 1:
A235044(a(n)) = n. [A235044 works as a left inverse of this sequence.]
a(n) = A014580(A091215(n)). - Antti Karttunen, May 17 2015

Extensions

Entry revised and name corrected by Antti Karttunen, May 17 2015

A236850 After 0 and 1, numbers n whose binary representation encodes such a polynomial over GF(2) that all its irreducible factors (their binary codes) are primes in N (terms of A091206).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 02 2014

Keywords

Comments

To determine whether n belongs to this sequence: first find a unique multiset of terms i, j, ..., k (terms not necessarily distinct) from A014580 for which i x j x ... x k = n, where x stands for the carryless multiplication (A048720). If and only if NONE of those i, j, ..., k is a composite (in other words, if all are primes in N, i.e. terms of A091206), then n is a member.
Equally, numbers which can be constructed as p x q x ... x r, where p, q, ..., r are terms of A091206. (Compare to the definition of A236860.)
Also fixed points of A236851(n). Proof: if k is a term of this sequence, the operation described in A236851 reduces to an identity operation. On the other hand, if k is not a term of this sequence, then it contains at least one irreducible GF(2)[X]-factor which is a composite in N, which is thus "broken" by A236851 to two or more separate GF(2)[X]-factors (either irreducible or not), and because the original factor was irreducible, and GF(2)[X] is a unique factorization domain, the new product computed over the new set of factors (with one or more "broken" pieces) cannot be equal to the original k. (Compare this to how primes are "broken" in a similar way in A235027, also A235145.)
Also by similar to above reasoning, positions where A234742(n) = A236837(n).
This is a subsequence of A236841, from which this differs for the first time at n=43, where A236841(43)=43, while from here 43 is missing, and a(43)=44.

Examples

			25 is the first term not included, as although it encodes an irreducible polynomial in GF(2)[X]: X^4 + X^3 + 1 (binary code 11001), it is composite in Z, thus not in A091206, but in A091214.
27 is included, as it factors as 5 x 7, and both factors are present in A091206.
37 is included, as it is a member of A091206 (irreducible in both Z and GF(2)[X]).
43 is NOT included because, even although it is a prime in Z, it factors as 3 x 25 in GF(2)[X]. Of these, only 3 is a term of A091206, while 25 belongs to A091214, as it further divides to 5*5.
		

Crossrefs

Subsequence of A236841.
Subsequence: A235032.

A236851 Remultiply n first "upward", from GF(2)[X] to N, and then remultiply that result back "downward", from N to GF(2)[X]: a(n) = A234741(A234742(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 02 2014

Keywords

Examples

			5 ('101' in binary) = 3 x 3 (3 = '11' in binary). 3 is in A091206, so it stays intact, and 3 x 3 = 5, thus a(5)=5.
25 ('11001' in binary) = 25 (25 is irreducible in GF(2)[X]). However, it divides as 5*5 in Z, so the result is 5 x 5 = 17, thus a(25)=17, 25 being the least n which is not fixed by this function.
43 ('101011' in binary) = 3 x 25, of which the latter factor divides to 5*5, thus the result is 3 x 5 x 5 = 3 x 17 = 15 x 5 = 51.
		

Crossrefs

A236850 gives the fixed points.

Programs

Formula

a(n) = A234741(A234742(n)).
To compute a(n): factor n as a polynomial over GF(2) (where n is mapped to such polynomials via the binary representation of n), that is, find first a unique multiset of terms i, j, ..., k from A014580 for which i x j x ... x k = n, where x stands for the carryless multiplication (A048720). Then divide from those i, j, ..., k the ones that are in A091214 (composite integers in N) to their constituent prime factors (in N), and multiply all back together (including the factors that are in A091206 and thus not changed) with the carryless multiplication (A048720).
Compare this to how primes are "broken" in a similar way in A235027 (cf. also A235145).

A236860 After 0 and 1, numbers n all of whose prime divisors encode an irreducible polynomial over GF(2) (are terms of A091206).

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 7, 8, 9, 11, 12, 13, 14, 16, 18, 19, 21, 22, 24, 26, 27, 28, 31, 32, 33, 36, 37, 38, 39, 41, 42, 44, 47, 48, 49, 52, 54, 56, 57, 59, 61, 62, 63, 64, 66, 67, 72, 73, 74, 76, 77, 78, 81, 82, 84, 88, 91, 93, 94, 96, 97, 98, 99, 103, 104, 108, 109
Offset: 1

Views

Author

Antti Karttunen, Mar 08 2014

Keywords

Comments

After 0 and 1, positive integers which are products of p * q * ... * r, where p, q, ..., r are terms of A091206.
Also fixed points of A236852(n). Proof: if k is a term of this sequence, the operation described in A236852 reduces to an identity operation. On the other hand, if k is not a term of this sequence, then it has at least one prime divisor which is reducible in polynomial ring GF(2)[X], which is thus "broken" by A236852 (A234742) to two or more separate factors (either prime or not), and because the original factor was prime, and N is a unique factorization domain, the new product computed over the new set of factors (with one or more "broken" pieces) cannot be equal to the original k. (Compare this to how primes are "broken" in a similar way in A235027, also A235145.)
Note: This sequence is not equal to all n for which A234741(n) = A236846(n). The first counterexample occurs at a(325) = 741 (= 3*13*19) for which we have: A236846(741) = 281 (= 3 x 247 = 3 x (13*19)) while A234741(741) = 329 (= 3 x 13 x 19). Contrast this with the behavior of the "dual sequence" A236850, where the corresponding property holds.

Crossrefs

Complement: A236848.
Subsequence of A236842.
Fixed points of A236852.

Programs

  • PARI
    isp(p) = polisirreducible( Mod(1, 2) * Pol(binary(p))); \\ A091206
    isok(n) = if ((n==0), 1 , my(f=factor(n)); prod(k=1, #f~, isp(f[k,1])) != 0); \\ Michel Marcus, Dec 22 2018
Showing 1-10 of 13 results. Next