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.

Previous Showing 11-20 of 23 results. Next

A136634 Primes whose reversals in bases 10, 9, 8, 7, 6, 5, 4, 3 and 2 are all prime.

Original entry on oeis.org

93836531, 1819395637, 1919723027, 1963209431, 3277373311, 3540866053, 15969326033, 16075946743, 16735166477, 17145519379, 71606465171, 71624919101, 72338598089, 73544885809, 73939267019, 74592559721
Offset: 1

Views

Author

Harry J. Smith, Jan 15 2008

Keywords

Examples

			Prime 93836531 reversed base 10 = 13563839, a prime.
93836531 = 215511462 base 9, reversed = 264115512 base 9 = 116986691, a prime.
93836531 = 545752363 base 8, reversed = 363257545 base 8 = 63790949, a prime.
93836531 = 2216411615 base 7, reversed = 5161146122 base 7 = 212620277, a prime.
93836531 = 13151124215 base 6, reversed = 51242115131 base 6 = 316991071, a prime.
93836531 = 143010232111 base 5, reversed = 111232010341 base 5 = 61594471, a prime.
93836531 = 11211331103303 base 4, reversed = 30330113311211 base 4 = 217152869, a prime.
93836531 = 20112120101112002 base 3, reversed = 20021110102121102 base 3 = 90058187, a prime.
93836531 = 101100101111101010011110011 base 2, reversed = 110011110010101111101001101 base 2 = 108617549, a prime.
		

Crossrefs

Programs

  • PARI
    emirp(p,b)=my(q,t=p);while(t,q=b*q+t%b;t\=b);isprime(q) && p!=q
    is(n)=for(b=2,10,if(!emirp(n,b),return(0))); isprime(n) \\ Charles R Greathouse IV, Sep 03 2013

A204219 Primes whose binary reversal is not prime.

Original entry on oeis.org

2, 19, 59, 79, 89, 103, 109, 137, 139, 149, 157, 179, 191, 211, 239, 241, 271, 281, 293, 311, 317, 347, 367, 379, 389, 397, 401, 419, 439, 457, 467, 499, 523, 541, 547, 557, 563, 569, 587, 593, 607, 613, 641, 647, 659, 673, 719, 733, 743, 751, 761, 769, 787, 809, 811, 829, 859, 863, 877, 887, 919, 929, 971, 977, 983, 991, 997
Offset: 1

Views

Author

M. F. Hasler, Jan 13 2012

Keywords

Crossrefs

Complement of A074832 in A000040.
Cf. A076056, the base 10 equivalent.

Programs

  • Mathematica
    a = {}; For[n = 1, n <= 1000, n++, If[PrimeQ[n], {d = Reverse[ IntegerDigits[n,2]]; If[!PrimeQ[FromDigits[d,2]], AppendTo[a, n]]}]]; a (* Hasler *)
    Select[Prime[Range[170]], Not[PrimeQ[FromDigits[Reverse[IntegerDigits[#, 2]], 2]]] &] (* Alonso del Arte, Jan 13 2012 *)
  • PARI
    forprime(p=1,1e3,if(!isprime(sum(i=1,#b=binary(p),b[i]<
    				
  • PARI
    isok(k) = isprime(k) && !isprime(fromdigits(Vecrev(binary(k)), 2)); \\ Michel Marcus, Feb 19 2021
    
  • Python
    from sympy import isprime, primerange
    def ok(p): return not isprime(int(bin(p)[:1:-1], 2))
    def aupto(lim): return [p for p in primerange(2, lim+1) if ok(p)]
    print(aupto(1000)) # Michael S. Branicky, Feb 19 2021

A229687 Odd squares whose binary reversal is also a square.

Original entry on oeis.org

1, 9, 20457529, 143784081, 331130809, 4365905625, 5216450625, 20074072489, 1193532215121, 10036851273801, 36014509461681, 38767247532225, 41413201925481, 155991531977649, 320642706437001, 2543173099393689, 2696589987547401, 4665141483989281, 87463589042698969
Offset: 1

Views

Author

Alex Ratushnyak, Dec 19 2013

Keywords

Comments

The sequence of binary reversals that are squares is a permutation of a(n), it begins: 1, 9, 20457529, 143784081, 331130809, 5216450625, 4365905625, 20074072489, 1193532215121, 10036851273801, 38767247532225, 36014509461681, ...
A029983 is a subsequence (after zero). - Antti Karttunen, Dec 20 2013

Crossrefs

Programs

  • C
    #include 
    #include 
    int main() {
      unsigned long long n, t, r, sr;
      for (n=1; n<(1ULL<<32); n+=2) {
         t = n*n;
         r = 0;
         while (t)  r = r*2+(t&1),  t >>= 1;
         sr = sqrt(r);
         if (sr*sr==r)  printf("%llu, ", n*n);
      }
      return 0;
    }
    
  • Scheme
    (define (A229687 n) (A000290 (A229766 n))) ;; Antti Karttunen, Dec 20 2013

Formula

a(n) = A229766(n)^2.

A080167 Primes beginning with '10' and ending with '01' in binary representation.

Original entry on oeis.org

5, 17, 37, 41, 73, 89, 137, 149, 157, 173, 181, 257, 269, 277, 281, 293, 313, 317, 337, 349, 353, 373, 521, 541, 557, 569, 577, 593, 601, 613, 617, 641, 653, 661, 673, 677, 701, 709, 733, 757, 761, 1033, 1049, 1061, 1069, 1093, 1097, 1109, 1117, 1129, 1153
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 04 2003

Keywords

Comments

Intersection of A002144 and A080165.

Examples

			A000040(12)=37 -> '100101' therefore 37 is a term.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[200]],Take[IntegerDigits[#,2],2]=={1,0}&&Take[ IntegerDigits[#,2],-2]=={0,1}&] (* Harvey P. Dale, May 10 2015 *)

A080168 Primes beginning and ending with '11' in binary representation.

Original entry on oeis.org

3, 7, 31, 59, 103, 107, 127, 199, 211, 223, 227, 239, 251, 419, 431, 439, 443, 463, 467, 479, 487, 491, 499, 503, 787, 811, 823, 827, 839, 859, 863, 883, 887, 907, 911, 919, 947, 967, 971, 983, 991, 1019, 1543, 1559, 1567, 1571, 1579, 1583, 1607, 1619, 1627
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 04 2003

Keywords

Comments

Intersection of A002145 and A080166.

Examples

			A000040(17)=59 -> '111011' therefore 59 is a term.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[300]],Take[IntegerDigits[#,2],2]==Take[ IntegerDigits[ #,2],-2]=={1,1}&] (* Harvey P. Dale, Jul 28 2021 *)

A136186 Primes whose decimal and binary reversal are both prime.

Original entry on oeis.org

3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 97, 101, 107, 113, 131, 151, 167, 181, 199, 313, 337, 353, 359, 373, 383, 701, 709, 727, 739, 757, 797, 907, 937, 941, 953, 967, 1033, 1091, 1109, 1153, 1181, 1193, 1201, 1217, 1229, 1259, 1439, 1453, 1471, 1487, 1619, 1669
Offset: 1

Views

Author

Harry J. Smith, Dec 19 2007

Keywords

Examples

			337 = 101010001 base 2, reverse the sequence of ones and zeros: 100010101 base 2 = 277. 337, 733 and 277 are all prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[300]],AllTrue[{IntegerReverse[#],FromDigits[ Reverse[ IntegerDigits[ #,2]],2]},PrimeQ]&] (* Harvey P. Dale, Nov 11 2021 *)

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.

A136187 Primes whose decimal, binary and binary-decimal reversals are all prime.

Original entry on oeis.org

3, 5, 7, 11, 13, 17, 31, 71, 73, 107, 113, 313, 701, 727, 739, 757, 797, 941, 1033, 1153, 1193, 1453, 1487, 1619, 1831, 1879, 1949, 3019, 3343, 3389, 3511, 3527, 3643, 3803, 3851, 9001, 9013, 9173, 9403, 9439, 9491, 9497, 9521, 9533, 9769, 10151, 10159
Offset: 1

Views

Author

Harry J. Smith, Dec 19 2007

Keywords

Examples

			113 = 1110001 base 2, reverse the sequence of ones and zeros: 1000111 base 2 = 71. 113, 311, 71 and 17 are all prime.
		

Crossrefs

A175045 a(n) = number of distinct values k of substrings in binary n where both k is prime and A030101(k) is prime.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 1, 2, 0, 0, 1, 3, 1, 3, 2, 2, 0, 1, 0, 1, 1, 1, 3, 5, 1, 1, 3, 4, 2, 5, 2, 3, 0, 0, 1, 2, 0, 2, 1, 2, 1, 2, 1, 4, 3, 4, 5, 6, 1, 2, 1, 1, 3, 4, 4, 6, 2, 2, 5, 6, 2, 6, 3, 3, 0, 0, 0, 2, 1, 2, 2, 4, 0, 1, 2, 4, 1, 3, 2, 2, 1, 2, 2, 4, 1, 1, 4, 6, 3, 3, 4, 4, 5, 7, 6, 7, 1, 2, 2, 2, 1, 4, 1, 2, 3
Offset: 0

Views

Author

Leroy Quet, Dec 02 2009

Keywords

Comments

A030101(m) is the decimal value of {m written in binary and then the digits reversed}.

Examples

			23 in binary is 10111. Looking at the distinct values of substrings: 0, 0 in decimal, is not a prime. 1, 1 in decimal, is not a prime. 10 = 2 in decimal, is a prime, but its reversal is 1, which is not a prime. 11 is 3 in decimal, which is prime; and its reversal, 11, is prime in decimal too. 101 is 5 in decimal, a prime; and its reversal, 101, is prime in decimal too. 111 is 7 in decimal, a prime, and its reversal is 7, which is also a prime. 1011 is 11 in decimal, which is prime, and its reversal, 1101, is 13, which is also a prime. And 10111 itself is 23 in decimal, a prime, and its reversal is 11101, which is 29 in decimal, also a prime. There are therefore 5 values of substrings that are prime and their binary digit reversals are prime, so a(23) = 5.
10010 is 18 in decimal. Note that "010" is a substring with a decimal value of 2, and the reversal of this substring is also 2. However, this substring does not count towards the substrings being enumerated because we first take the value k of the substring, then take A030101(k) to see if both are prime. And A030101(2) = 1, not 2.
		

Crossrefs

Extensions

Extended by Ray Chandler, Dec 18 2009

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
    
Previous Showing 11-20 of 23 results. Next