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

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

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

A074833 Primes whose ternary reversal is also prime.

Original entry on oeis.org

2, 5, 7, 11, 13, 19, 23, 31, 37, 41, 47, 53, 61, 67, 79, 83, 101, 103, 113, 127, 131, 151, 163, 167, 173, 179, 181, 191, 193, 211, 227, 233, 263, 281, 293, 311, 331, 349, 353, 359, 401, 409, 419, 421, 431, 439, 449, 463, 467, 491, 499, 503, 521, 523, 541, 563
Offset: 1

Views

Author

Robert G. Wilson v, Sep 09 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Prime[ Select[ Range[110], PrimeQ[ FromDigits[ Reverse[ IntegerDigits[ Prime[ # ], 3]], 3]] &]]

A074834 Primes whose base 4 reversal is also prime.

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 23, 29, 31, 53, 59, 61, 67, 73, 79, 83, 89, 97, 101, 107, 193, 197, 199, 211, 233, 239, 241, 251, 257, 269, 277, 281, 293, 311, 313, 337, 353, 367, 373, 383, 397, 401, 409, 419, 433, 443, 449, 457, 461, 467, 487, 491, 499, 509, 787, 797, 809
Offset: 1

Views

Author

Robert G. Wilson v, Sep 09 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Prime[ Select[ Range[140], PrimeQ[ FromDigits[ Reverse[ IntegerDigits[ Prime[ # ], 4]], 4]] &]]

A075235 Primes whose base 5 reversal is also prime.

Original entry on oeis.org

2, 3, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 47, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 149, 151, 157, 163, 167, 191, 193, 211, 223, 227, 229, 233, 239, 251, 257, 269, 271, 277, 281, 293, 317, 331, 337, 347, 349, 353, 359, 367
Offset: 1

Views

Author

Robert G. Wilson v, Sep 09 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Prime[ Select[ Range[100], PrimeQ[ FromDigits[ Reverse[ IntegerDigits[ Prime[ # ], 5]], 5]] &]]

A075236 Primes whose base 6 reversal is also prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 31, 37, 41, 43, 53, 59, 61, 67, 71, 181, 191, 193, 197, 199, 211, 227, 233, 257, 263, 271, 277, 281, 293, 307, 311, 313, 317, 331, 337, 349, 359, 367, 373, 379, 383, 389, 431, 1087, 1093, 1103, 1109, 1117, 1123, 1153, 1187, 1193, 1201, 1213
Offset: 1

Views

Author

Robert G. Wilson v, Sep 09 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Prime[ Select[ Range[200], PrimeQ[ FromDigits[ Reverse[ IntegerDigits[ Prime[ # ], 6]], 6]] &]]
    Select[Prime[Range[200]],PrimeQ[FromDigits[Reverse[IntegerDigits[#,6]],6]]&] (* Harvey P. Dale, Oct 12 2023 *)

A075237 Primes whose base 7 reversal is also prime.

Original entry on oeis.org

2, 3, 5, 11, 13, 17, 19, 23, 29, 37, 41, 43, 47, 53, 67, 71, 79, 89, 97, 101, 107, 127, 137, 139, 149, 151, 157, 167, 173, 179, 193, 197, 199, 211, 227, 229, 233, 241, 257, 269, 271, 277, 281, 307, 311, 331, 337, 347, 373, 389, 397, 401, 419, 421, 433, 439, 443
Offset: 1

Views

Author

Robert G. Wilson v, Sep 09 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Prime[ Select[ Range[100], PrimeQ[ FromDigits[ Reverse[ IntegerDigits[ Prime[ # ], 7]], 7]] &]]

A075238 Primes whose base 8 reversal is also prime.

Original entry on oeis.org

2, 3, 5, 7, 13, 29, 31, 41, 43, 47, 59, 61, 67, 71, 73, 79, 89, 97, 101, 107, 113, 193, 211, 227, 233, 239, 251, 349, 353, 373, 383, 449, 457, 463, 479, 487, 491, 503, 509, 521, 523, 541, 577, 587, 643, 677, 683, 719, 733, 751, 757, 773, 787, 811, 823, 827, 829
Offset: 1

Views

Author

Robert G. Wilson v, Sep 09 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Prime[ Select[ Range[150], PrimeQ[ FromDigits[ Reverse[ IntegerDigits[ Prime[ # ], 8]], 8]] &]]
    Select[Prime[Range[200]],PrimeQ[IntegerReverse[#,8]]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 09 2017 *)

A075239 Primes whose base 9 reversal is also prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 37, 43, 47, 67, 71, 73, 79, 83, 97, 101, 109, 113, 127, 139, 151, 157, 163, 173, 179, 181, 191, 193, 197, 227, 229, 239, 241, 331, 337, 353, 367, 373, 379, 383, 389, 397, 419, 433, 439, 457, 463, 479, 571, 577, 593, 599, 601, 607
Offset: 1

Views

Author

Robert G. Wilson v, Sep 09 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Prime[ Select[ Range[115], PrimeQ[ FromDigits[ Reverse[ IntegerDigits[ Prime[ # ], 9]], 9]] &]]

A080790 Binary emirps, primes whose binary reversal is a different prime.

Original entry on oeis.org

11, 13, 23, 29, 37, 41, 43, 47, 53, 61, 67, 71, 83, 97, 101, 113, 131, 151, 163, 167, 173, 181, 193, 197, 199, 223, 227, 229, 233, 251, 263, 269, 277, 283, 307, 331, 337, 349, 353, 359, 373, 383, 409, 421, 431, 433, 449, 461, 463, 479, 487, 491, 503, 509, 521
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 25 2003

Keywords

Comments

Members of A074832 that are not in A006995. - Robert Israel, Aug 31 2016

Examples

			A000040(10) = 29 -> '11101' rev '10111' -> 23 = A000040(9), therefore 29 and 23 are terms.
The prime 19 is not a term, as 19 -> '10011' rev '11001' -> 25 = 5^2; and 7 = A074832(3) is not a term because it is a binary palindrome (A006995) and therefore not different.
		

Crossrefs

Programs

  • Maple
    revdigs:= proc(n) local L; L:= convert(n,base,2); add(L[-i]*2^(i-1),i=1..nops(L)) end proc:
    filter:= proc(t) local r; if not isprime(t) then return false fi;
      r:= revdigs(t); r <> t and isprime(r) end proc:
    select(filter, [seq(i,i=3..10000,2)]); # Robert Israel, Aug 30 2016
  • Mathematica
    Select[Prime[Range[100]], (r = IntegerReverse[#, 2]) != # && PrimeQ[r] &] (* Amiram Eldar, Jul 28 2025 *)
  • Python
    from sympy import isprime
    def ok(n):
        r = int(bin(n)[2:][::-1], 2)
        return n != r and isprime(n) and isprime(r)
    print([k for k in range(600) if ok(k)]) # Michael S. Branicky, Jul 30 2022
Showing 1-10 of 23 results. Next