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 101-110 of 198 results. Next

A214847 Primes that become emirps when their most-significant-digit is deleted.

Original entry on oeis.org

113, 131, 137, 173, 179, 197, 271, 313, 317, 331, 337, 373, 379, 397, 431, 479, 571, 613, 617, 631, 673, 773, 797, 937, 971, 997, 1013, 1031, 1097, 1709, 1733, 1907, 2017, 2113, 2179, 2311, 2347, 2389, 2953, 2971, 3037, 3079, 3167, 3347, 3359, 3389, 3701, 3709
Offset: 1

Views

Author

Keywords

Examples

			113 and 1013 are both in the sequence, because upon deletion they become 13, which is an emirp.
		

Crossrefs

Programs

  • R
    library(gmp); isemirp<-function(x) isprime(x) & (j=paste(rev(unlist(strsplit(as.character(x),split=""))),collapse=""))!=x & isprime(j);
    no0<-function(s){ while(substr(s,1,1)=="0" & nchar(s)>1) s=substr(s,2,nchar(s)); s}
    i=as.bigz(0); y=as.bigz(rep(0,100)); len=0;
    while(len<100)
    if(isemirp(as.bigz(no0(substr((i=nextprime(i)),2,200)))))
    y[(len=len+1)]=i

A217614 Emirps p such that the next emirp is equal to the next prime.

Original entry on oeis.org

13, 31, 71, 73, 337, 701, 733, 739, 743, 761, 937, 953, 967, 983, 1021, 1031, 1097, 1103, 1151, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1279, 1381, 1399, 1499, 1511, 1583, 1597, 1723, 1733, 1831, 1933, 3011, 3019, 3083, 3089, 3191, 3271, 3299
Offset: 1

Views

Author

Jonathan Vos Post, Oct 08 2012

Keywords

Examples

			13 is in the sequence because the next emirp (17) is also the next prime.
71 is in the sequence because the next emirp (73) is also the next prime.
		

Crossrefs

Programs

  • Maple
    digrev:= proc(n) local L,i;
     L:= convert(n,base,10);
     add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    isemirp:= proc(n) local r;
      r:= digrev(n);
      r <> n and isprime(r)
    end proc:
    R:= NULL: count:= 0:
    p:= 2: ep:= false:
    while count < 100 do
      q:= p; eq:= ep;
      p:= nextprime(p);
      ep:= isemirp(p);
      if ep and eq then
         R:= R, q; count:= count+1;
      fi
    od:
    R; # Robert Israel, Jun 20 2021
  • Mathematica
    emirpQ[n_] := PrimeQ[n] && Block[{r=FromDigits@Reverse@IntegerDigits@n},
    r != n && PrimeQ[r]]; nextEmirp[n_] := Block[{e=NextPrime[n]}, While[! emirpQ[e], e = NextPrime[e]]; e]; Select[Prime@Range@1000, emirpQ[#] && NextPrime[#] == nextEmirp[#] &] (* Giovanni Resta, Oct 28 2012 *)

Extensions

More terms from Giovanni Resta, Oct 28 2012

A225234 Primes whose internal digits are an emirp.

Original entry on oeis.org

1171, 1319, 1373, 1733, 1973, 1979, 2131, 2137, 2179, 2311, 2371, 2377, 2711, 2713, 2719, 2731, 2791, 2797, 2971, 3137, 3313, 3319, 3371, 3373, 3719, 3733, 3739, 3793, 3797, 4133, 4139, 4177, 4373, 4733, 4793, 4799, 4973, 5171, 5179, 5711, 5717, 5737, 5791
Offset: 1

Views

Author

Keywords

Comments

a(414) = 112019 is the first term with an internal even digit.

Examples

			Example: 1171 has the emirp 17 as its internal digits.
		

Crossrefs

Programs

  • R
    library(gmp); isemirp<-function(x) isprime(x) & (j=paste(rev(unlist(strsplit(as.character(x),split=""))),collapse=""))!=x & isprime(j);
    no0<-function(s){ while(substr(s,1,1)=="0" & nchar(s)>1) s=substr(s,2,nchar(s)); s}
    i=as.bigz(0); y=as.bigz(rep(0,100)); len=0;
    while(len<100) if(isemirp(as.bigz(no0(substr((i=nextprime(i)),2,nchar(as.character(i))-1))))) y[(len=len+1)]=i

A227864 Smallest base in which n's digital reversal is prime, or 0 if no such base exists.

Original entry on oeis.org

0, 0, 3, 2, 0, 2, 2, 2, 4, 6, 2, 2, 2, 2, 2, 3, 8, 2, 3, 3, 2, 3, 2, 2, 2, 2, 2, 9, 2, 2, 6, 2, 4, 3, 2, 3, 12, 2, 6, 3, 2, 2, 6, 2, 2, 3, 2, 2, 2, 3, 2, 9, 2, 2, 3, 2, 2, 3, 2, 4, 12, 2, 2, 3, 12, 3, 6, 2, 2, 3, 10, 2, 6, 2, 2, 3, 10, 2, 26, 3, 2, 27, 2, 2
Offset: 0

Views

Author

Carl R. White, Nov 01 2013

Keywords

Comments

0 and 1 are not prime and are single digits in all bases, so no reversal of digits can make them prime. a(n) is therefore 0 for both.
4 is not prime and so cannot be prime if reversed in any base where it is a single digit. This leaves bases 2 and 3 where, upon reversal, it is 1 and 4 respectively. Neither are prime, and so a(4) is also 0.
Conjecture 1: 0, 1 and 4 are the only values where there is no base in which a digital reversal makes a prime.
It is clear that for any prime p, a(p) cannot be zero, since a(p)=p+1 is a solution if there is none smaller.
Conjecture 2: n = 2 is the only prime p which must be represented in base p+1, i.e., trivially, as a single digit, in order for its reversal to be prime.
Corollary: Since a(n) cannot be n itself -- reversing n in base n obtains 1, which is not prime -- this would mean that for all positive n except 2, a(n) < n.
Other than its small magnitude, a(n) = 2 occurs often due to the fact that a reversed positive binary number is guaranteed to be odd and thus stands a greater chance of being prime.
Similarly, many solutions exist solely because reversal removes all powers of the base from n, reducing the number of divisors. Thus based solely on observation:
Conjecture 3: With the restriction gcd(base,n) = 1, a(n) = 0 except for n = 2, 3 and 6k+-1, for positive integer k, i.e., terms of A038179.

Examples

			9 in base 2 is 1001, which when reversed is the same and so not prime. In base 3 it is 100, which becomes 1 when reversed and also not prime. Base 4: 21 -> 12 (6 decimal), not prime; Base 5: 14 -> 41 (21 decimal), not prime; Base 6: 13 -> 31 (19 decimal), which is prime, so a(9) = 6, i.e., 6 is the smallest base in which 9's digital reversal is a prime number.
		

Crossrefs

Positions of 2's: A204232.

Programs

  • Python
    from sympy import isprime
    from sympy.ntheory.digits import digits
    def okb(n, b):
        return isprime(sum(d*b**i for i, d in enumerate(digits(n, b)[1:])))
    def a(n):
        for b in range(2, n+2):
            if okb(n, b): return b
        return 0
    print([a(n) for n in range(84)]) # Michael S. Branicky, Sep 06 2021

A263240 Emirps whose reversals are merely their end digits swapped.

Original entry on oeis.org

13, 17, 31, 37, 71, 73, 79, 97, 107, 113, 149, 157, 167, 179, 199, 311, 337, 347, 359, 389, 701, 709, 733, 739, 743, 751, 761, 769, 907, 937, 941, 953, 967, 971, 983, 991, 1009, 1223, 1229, 1559, 1669, 3221, 3889, 7229, 9001, 9221, 9227, 9551, 9661, 10007, 10009, 10909, 11717, 11719, 12227, 12323, 12829, 13337, 13933, 14143, 14447, 14449, 14549, 14843, 14947
Offset: 1

Views

Author

Lekraj Beedassy, Oct 13 2015

Keywords

Comments

Subsequence of emirps A006567 with which it is identical for the first 37 terms.
Entries with 4 or more digits consist of a middle repdigit or palindrome part inserted between the end digits.

Crossrefs

A263241 Lesser of emirp pairs that are merely reversals of their end digits.

Original entry on oeis.org

13, 17, 37, 79, 107, 113, 149, 157, 167, 179, 199, 337, 347, 359, 389, 709, 739, 769, 1009, 1223, 1229, 1559, 1669, 3889, 7229, 10007, 10009, 10909, 11717, 11719, 12227, 12323, 12829, 13337, 13933, 14143, 14447, 14449, 14549, 14843, 14947, 15053, 16063, 16267, 16567, 16763
Offset: 1

Views

Author

Lekraj Beedassy, Oct 13 2015

Keywords

Comments

The first digit is always smaller than last digit.

Crossrefs

Programs

  • Mathematica
    Select[Range[20000], And @@ PrimeQ[{#, IntegerReverse[#]}] && ! PalindromeQ[#] && First[(d = IntegerDigits[#])] < Last[d] && PalindromeQ[Most@ Rest@ IntegerDigits[#]] &] (* Amiram Eldar, Oct 16 2021 *)
  • PARI
    isok(p) = my(dp=digits(p), dr=Vecrev(dp), r=fromdigits(dr)); if (isprime(r) && (r>p) && isprime(p), sum(i=2, #dp-1, dp[i]==dr[i]) == #dp-2); \\ Michel Marcus, Oct 16 2021

Extensions

Missing 179 added by Zak Seidov, Oct 15 2021

A298613 Primes formed by the concatenation of 2^k-1 and 2^(k-1)-1.

Original entry on oeis.org

31, 73, 157, 12763, 255127, 40952047, 524287262143, 41943032097151, 6871947673534359738367, 7036874417766335184372088831, 22517998136852471125899906842623, 14757395258967641292773786976294838206463, 604462909807314587353087302231454903657293676543
Offset: 1

Views

Author

Paolo Galliani, Jan 23 2018

Keywords

Comments

Conjectures:
(1) The factorization of a(n) + 1 never contains an odd prime squared.
(2) a(n) + 1 is not divisible by 7.
(3) There are infinitely many primes of this form.
(4) The fifth term, 255127 is the only term of the sequence which can be written as the sum of a square and a repunit. In fact, 255127=504^2+1111.
(5) The fifth term, 255127 is the only term of the sequence which is congruent to 1 mod 101.
(6) a(9) is the largest term of the sequence for which k is a power.
Note: a(n) can never be a Sophie Germain prime. - Max Alekseyev, Mar 30 2018
Note that from a(20) to a(28), the primes are congruent to 3 (mod 7), whereas a(30), a(31), a(32), a(33) and a(34) are all congruent to 5 (mod 7). - Paolo Galliani, Jun 17 2018 and Jun 25 2018
The first conjecture has been disproved. In fact, a(36)+1 is divisible by 23^2. - Paolo Galliani, Aug 27 2018
The first four terms of the sequence: 31, 73, 157, 12763 are emirps. - Paolo Galliani, Nov 05 2018
The first four terms of the sequence reversed: 13, 37, 751, 36721 are Chen primes. - Paolo Galliani, Nov 09 2018

Crossrefs

Programs

  • GAP
    m:=300;;
    g1:=List(List([1..m],k->2^k-1),ListOfDigits);;
    g2:=List(List([1..m],k->2^(k-1)-1),ListOfDigits);;
    g3:=List([1..m],i->Concatenation(g1[i],g2[i]));;
    a:=Filtered(List([1..Length(g3)],s->Sum([0..Length(g3[s])-1],t->g3[s][Length(g3[s])-t]*10^t)),IsPrime); # Muniru A Asiru, Mar 29 2018
  • Magma
    [t: n in [1..100] | IsPrime(t) where t is Seqint(Intseq(2^(n-1)-1) cat Intseq(2^n-1))]; // Bruno Berselli, Feb 02 2018
    
  • Mathematica
    Select[Map[#1 10^IntegerLength@ #2 + #2 & @@ Reverse@ # &, Partition[Array[2^# - 1 &, 90], 2, 1]], PrimeQ] (* Michael De Vlieger, Jan 23 2018 *)
  • PARI
    lista(nn) = for (n=1, nn, if (isprime(p=fromdigits(concat(digits(2^n-1), digits(2^(n-1)-1)))), print1(p, ", "))); \\ Michel Marcus, Jan 29 2018
    

Formula

a(n) = concatenation of 2^k-1 and 2^(k-1)-1, where k = A301806(n).

A331486 Numbers k which are emirps in more bases 1 < b < k than any previous number.

Original entry on oeis.org

2, 5, 7, 11, 13, 17, 23, 29, 31, 41, 43, 53, 67, 73, 79, 97, 113, 127, 157, 193, 223, 269, 277, 311, 379, 421, 431, 467, 487, 563, 613, 647, 743, 907, 937, 977, 1093, 1193, 1249, 1259, 1373, 1483, 1543, 1637, 1667, 1933, 2239, 2393, 2477, 2521, 2857, 2957, 3083
Offset: 1

Views

Author

Amiram Eldar, Jan 23 2020

Keywords

Comments

The corresponding numbers of bases are 0, 1, 3, 6, 8, 9, 12, 13, 17, 21, 24, ... (see the link for more values).

Examples

			2 is not emirp in any base.
5 is emirp in one base, 3: 5 is 12 in base 3, and 21 in base 3 is 7 which is also a prime.
7 is emirp in 3 bases, 3, 4, and 5.
		

Crossrefs

Programs

  • Mathematica
    emirpQ[n_, b_] := n != (rev = FromDigits[Reverse @ IntegerDigits[n, b], b]) && And @@ PrimeQ[{n, rev}];
    emirpCount[n_] := Length @ Select[Range[2, n - 1], emirpQ[n, #] &];
    seq = {}; emax = -1; Do[e1 = emirpCount[n]; If[e1 > emax, emax = e1; AppendTo[seq, n]], {n, 2, 3000}]; seq

A333422 Factorial base emirps: prime numbers whose factorial base reversal is a different prime.

Original entry on oeis.org

29, 37, 137, 181, 733, 743, 769, 977, 1013, 1031, 1033, 1049, 5107, 5119, 5171, 5179, 5233, 5273, 5297, 5323, 5387, 5393, 5399, 5407, 5437, 5441, 5449, 5471, 5477, 5483, 6571, 6607, 6689, 6691, 6709, 6719, 6733, 6763, 6803, 6823, 6829, 6907, 6947, 6949, 40343
Offset: 1

Views

Author

Amiram Eldar, Mar 20 2020

Keywords

Examples

			29 is a term since it is a prime number and its representation in factorial base is 1021, whose reversal, 1201, is the factorial base representation of another prime number, 37.
		

Crossrefs

Programs

  • Mathematica
    max = 8; bases = Range[max, 2, -1]; nmax = max! - 1; emirpQ[n_] := PrimeQ[n] && Module[{d = IntegerDigits[n, MixedRadix[bases]]}, r = Reverse @ d; IntegerDigits[(m = FromDigits[r, MixedRadix[bases]]), MixedRadix[bases]] == r && m != n && PrimeQ[m]]; Select[Range[nmax], emirpQ]

A340842 Emirps p such that p + (sum of digits of p) is an emirp.

Original entry on oeis.org

13, 71, 97, 701, 1061, 1223, 1597, 1847, 1933, 3067, 3089, 3373, 3391, 3889, 7027, 7043, 7577, 9001, 9241, 9421, 10061, 10151, 10333, 10867, 11057, 11657, 11677, 11897, 11923, 12227, 12269, 12809, 13147, 13457, 13477, 14087, 14207, 16979, 17011, 17033, 17903, 32173, 32203, 32353, 32687, 33589
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Jan 23 2021

Keywords

Examples

			a(3) = 97 is an emirp because 97 and 79 are distinct primes. Its sum of digits is 9+7=16, and 97+16 = 113 is an emirp because 113 and 311 are primes.
		

Crossrefs

Cf. A006567. Contains A340843.

Programs

  • Maple
    revdigs:= proc(n) local L,i;
      L:= convert(n,base,10);
      add(10^(i-1)*L[-i],i=1..nops(L))
    end proc:
    isemirp:= proc(n) local r;
    if not isprime(n) then return false fi;
    r:= revdigs(n);
    r <> n and isprime(r)
    end proc:
    filter:= n -> isemirp(n) and isemirp(n +convert(convert(n,base,10),`+`)):
    select(filter, [seq(i,i=3..10^5,2)]);
  • Python
    from sympy import isprime
    def sd(n): return sum(map(int, str(n)))
    def emirp(n):
      if not isprime(n): return False
      revn = int(str(n)[::-1])
      if n == revn: return False
      return isprime(revn)
    def ok(n): return emirp(n) and emirp(n + sd(n))
    def aupto(nn): return [m for m in range(1, nn+1) if ok(m)]
    print(aupto(18000)) # Michael S. Branicky, Jan 24 2021
Previous Showing 101-110 of 198 results. Next