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

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

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

A226019 Primes whose binary reversal is a square.

Original entry on oeis.org

2, 19, 79, 149, 569, 587, 1237, 2129, 2153, 2237, 2459, 2549, 4129, 4591, 4657, 4999, 8369, 8999, 9587, 9629, 9857, 10061, 17401, 17659, 17737, 18691, 20149, 20479, 33161, 33347, 34631, 35117, 35447, 39023, 40427, 40709, 66403, 68539, 74707, 75703, 79063, 79333, 80071
Offset: 1

Views

Author

Alex Ratushnyak, May 23 2013

Keywords

Comments

The sequence of corresponding squares begins: 1, 25, 121, 169, 625, 841, 1369, 2209, 2401, 3025, 3481, 2809, 4225, 7921, ...
For n>1 the second and third most significant bits of a(n) are "0" because all odd squares are equal to 1 mod 8. - Andres Cicuttin, May 12 2016

Crossrefs

Subsequence of A204219. Cf. also A235027.

Programs

  • Mathematica
    Select[Table[Prime[j],{j,1,10000}],Element[Sqrt[FromDigits[Reverse[IntegerDigits[#,2]],2]],Integers]&] (* Andres Cicuttin, May 12 2016 *)
  • PARI
    isok(k) = isprime(k) && issquare(fromdigits(Vecrev(binary(k)), 2)); \\ Michel Marcus, Feb 19 2021
  • Python
    import math
    primes = []
    def addPrime(k):
      for p in primes:
        if k%p==0:  return
        if p*p > k:  break
      primes.append(k)
      r = 0
      p = k
      while k:
        r = r*2 + (k&1)
        k>>=1
      s = int(math.sqrt(r))
      if s*s == r:  print(p, end=', ')
    addPrime(2)
    addPrime(3)
    for i in range(5, 1000000000, 6):
      addPrime(i)
      addPrime(i+2)
    
  • Python
    from sympy import isprime
    A226019_list, i, j = [2], 0, 0
    while j < 2**34:
        p = int(format(j,'b')[::-1],2)
        if j % 2 and isprime(p):
            A226019_list.append(p)
        j += 2*i+1
        i += 1
    A226019_list = sorted(A226019_list) # Chai Wah Wu, Dec 20 2015
    
  • Python
    from sympy import integer_nthroot, primerange
    def ok(p): return integer_nthroot(int(bin(p)[:1:-1], 2), 2)[1]
    def aupto(lim): return [p for p in primerange(2, lim+1) if ok(p)]
    print(aupto(80071)) # Michael S. Branicky, Feb 19 2021
    
Showing 1-4 of 4 results.