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

A343706 Lesser emirps (A109308) p such that A056964(p) is in A343703.

Original entry on oeis.org

17, 107, 113, 167, 179, 389, 1031, 1091, 1097, 1109, 1181, 1259, 1439, 1487, 1523, 1583, 1619, 1847, 3023, 3089, 3257, 3347, 3359, 3527, 3719, 7349, 7529, 7577, 7589, 7649, 7949, 9029, 10067, 10151, 10247, 10487, 10739, 10781, 11057, 11423, 11621, 11777, 11897, 11933, 12119, 12227, 12641, 13151
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Apr 26 2021

Keywords

Comments

Primes p such that the digit-reversal q = A004086(p) is a prime greater than p, and p+q = x*y for some x and y such that x+y and the concatenation x|y are primes.

Examples

			a(4) = 167 is a term because 167 and 761 are primes with 167 < 761, and 167+761 = 928 = 32*29 with 3229 and 32+29 = 61 prime.
		

Crossrefs

Programs

  • Maple
    revdigs:= proc(n) local L,i;
        L:= convert(n,base,10);
        add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    filter:= proc(p) local q,m,d,e;
       q:= revdigs(p); if q <= p then return false fi;
       if not isprime(p) or not isprime(q) then return false fi;
       m:= p+q;
       for d in numtheory:-divisors(m) do
         e:= m/d;
         if isprime(d*10^(1+ilog10(e))+e) and isprime(d+e) then return true fi
       od;
       false
    end proc:

A346756 Lesser emirps (A109308) subtracted from their reversals.

Original entry on oeis.org

18, 54, 36, 18, 594, 198, 792, 594, 594, 792, 792, 396, 396, 594, 594, 198, 198, 198, 7992, 180, 270, 2268, 540, 8532, 810, 6804, 1908, 7902, 360, 2358, 630, 2718, 1908, 5904, 1998, 7992, 90, 6084, 8172, 8262, 8442, 2538, 450, 8532, 7632, 7812, 7902, 2088, 270
Offset: 1

Views

Author

George Bull, Aug 20 2021

Keywords

Examples

			31 - 13 = 18, 71 - 17 = 54, 73 - 37 = 36 (distance between lesser emirps and their reversals).
		

Crossrefs

Programs

  • Maple
    rev:= proc(n) local L,i;
      L:= convert(n,base,10);
      add(L[-i]*10^(i-1),i=1..nops(L));
    end proc:
    f:= proc(p) local r;
      if not isprime(p) then return NULL fi;
      r:= rev(p);
      if r > p and isprime(r) then r-p else NULL fi
    end proc:
    map(f, [seq(i,i=11 .. 10^4, 2)]); # Robert Israel, Dec 28 2023
  • Mathematica
    f[n_] := IntegerReverse[n] - n; Map[f, Select[Range[1500], f[#] > 0 && PrimeQ[#] && PrimeQ @ IntegerReverse[#] &]] (* Amiram Eldar, Sep 08 2021 *)
  • PARI
    rev(p) = fromdigits(Vecrev(digits(p))); \\ A004086
    lista(nn) = {my(list = List()); forprime (p=1, nn, my(q=rev(p)); if ((q>p) && isprime(q), listput(list, q-p));); Vec(list);} \\ Michel Marcus, Sep 07 2021
    
  • Python
    from sympy import isprime, nextprime
    def aupton(terms):
        alst, p = [], 2
        while len(alst) < terms:
            revp = int(str(p)[::-1])
            if p < revp and isprime(revp):
                alst.append(revp - p)
            p = nextprime(p)
        return alst
    print(aupton(49)) # Michael S. Branicky, Sep 08 2021

Formula

a(n) = reverse(A109308(n)) - A109308(n).

Extensions

Better name and more terms from Jon E. Schoenfield, Aug 20 2021

A083815 Semiprimes whose prime factors are distinct and the reversal of one factor is equal to the other.

Original entry on oeis.org

403, 1207, 2701, 7663, 35143, 75007, 117907, 127087, 140209, 173809, 197209, 247021, 257821, 342127, 382387, 643063, 692443, 743623, 1226221, 1341331, 1626151, 1698661, 1739161, 2073991, 2138791, 2528611, 2561011, 3321133
Offset: 1

Views

Author

Jason Earls, Jun 17 2003

Keywords

Comments

Products of emirp pairs, sorted. - Lekraj Beedassy, Jan 10 2008

Examples

			a(2)= 1207 = 17 * 71.
		

Crossrefs

Programs

  • Maple
    revdigs:= proc(n) local i,L;
      L:= convert(n,base,10);
      add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    f:= proc(p) local r;
      if not isprime(p) then return NULL fi;
      r:= revdigs(p);
      if r > p and isprime(r) then r*p fi
    end proc:
    sort(map(f, [seq(i,i=13..9999,2)])); # Robert Israel, Dec 26 2018

Extensions

More terms from Ray Chandler, Jul 22 2003

A109309 Larger emirps (primes whose digit reversal is a lesser prime).

Original entry on oeis.org

31, 71, 73, 97, 311, 701, 733, 743, 751, 761, 907, 937, 941, 953, 967, 971, 983, 991, 1201, 1301, 1321, 1511, 1601, 1741, 1811, 1831, 1901, 3011, 3121, 3191, 3203, 3221, 3251, 3271, 3301, 3371, 3391, 3433, 3511, 3541, 3571, 3613, 3643, 3733, 3803, 3821
Offset: 1

Views

Author

Zak Seidov, Jun 25 2005

Keywords

Crossrefs

Cf. A006567 Emirps (primes whose digit reversal is a different prime), A109308 Lesser emirps (primes whose digit reversal is a larger prime).

Programs

  • Mathematica
    dr[n_]:=FromDigits[Reverse[IntegerDigits[n]]];Select[Prime[Range[1000]], PrimeQ[dr[ # ]]&&dr[ # ]<#&]
    Select[Prime[Range[600]],PrimeQ[IntegerReverse[#]]&&#>IntegerReverse[#]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 23 2020 *)

A178581 Primes that are the average of the members of emirp pairs.

Original entry on oeis.org

11311, 12721, 13831, 14741, 16061, 16561, 17471, 18481, 20507, 21107, 21407, 21617, 21817, 22727, 23027, 23227, 23327, 23537, 24137, 24547, 24847, 25147, 25247, 25447, 25657, 26357, 27067, 27367, 28277, 34543, 34843, 35153, 35353
Offset: 1

Views

Author

Lekraj Beedassy, May 29 2010

Keywords

Comments

For the lesser member of the corresponding smallest emirp pair, see A178582.

Crossrefs

A178092 Lesser of emirp pairs whose digital sums are also emirps (A178091).

Original entry on oeis.org

157, 179, 337, 359, 1097, 1237, 1259, 1381, 1439, 1453, 1471, 1583, 1619, 1723, 3019, 3109, 3163, 3257, 3343, 3347, 3527, 7699, 7879, 9679, 10039, 10079, 10273, 10453, 10457, 10651, 10781, 10853, 11083, 11159, 11353, 11447, 11551, 11717, 11731, 11933, 12073
Offset: 1

Views

Author

Lekraj Beedassy, May 19 2010

Keywords

Crossrefs

Programs

  • Mathematica
    emrp[n_]:=Module[{e=FromDigits[Reverse[IntegerDigits[n]]]},If[n!=e&&PrimeQ[ e],{n,e},{}]]; dsemQ[m_]:=Module[ {ds=Total[IntegerDigits[m]],em}, em= FromDigits[ Reverse[IntegerDigits[ ds]]];em!=ds&& And@@PrimeQ[{ds,em}]]; Select[Transpose[Rest[Union[Sort/@(emrp/@Prime[Range[2000]])]]][[1]],dsemQ] (* Harvey P. Dale, Sep 11 2013 *)

Extensions

Corrected and extended by Harvey P. Dale, Sep 11 2013

A166681 Primes p which have at least one prime anagram larger than p.

Original entry on oeis.org

13, 17, 37, 79, 107, 113, 127, 131, 137, 139, 149, 157, 163, 167, 173, 179, 181, 191, 197, 199, 239, 241, 251, 277, 281, 283, 313, 337, 347, 349, 359, 367, 373, 379, 389, 397, 419, 457, 461, 463, 467, 479, 491, 563, 569, 571, 577, 587, 593, 613
Offset: 1

Views

Author

Pierre CAMI, Oct 18 2009

Keywords

Comments

Primes like 113, 137, 149, 157 etc have more than one such larger anagram, but are only listed once.

Examples

			13 is the first with 31 as prime anagram.
17 is the second with 71 as prime anagram.
31 has one anagram 13 but this is not >31 so 31 is not in the sequence.
		

Crossrefs

Programs

  • Maple
    filter:= proc(p) local L,Lp,q,i;
      if not isprime(p) then return false fi;
      L:= convert(p,base,10);
      for Lp in combinat:-permute(L) do
        q:= add(Lp[i]*10^(i-1),i=1..nops(L));
        if q > p and isprime(q) then return true fi
      od;
    false
    end proc:
    select(filter, [seq(i,i=13..1000,2)]); # Robert Israel, Jan 18 2023
  • Mathematica
    paQ[n_]:=Length[Select[FromDigits/@Permutations[IntegerDigits[n]],#>n && PrimeQ[#]&]]>0; Select[Prime[Range[200]],paQ] (* Harvey P. Dale, Sep 23 2013 *)
  • Python
    from itertools import islice
    from sympy.utilities.iterables import multiset_permutations
    from sympy import isprime, nextprime
    def A166681_gen(): # generator of terms
        p = 13
        while True:
            for q in multiset_permutations(str(p)):
                if (r:=int(''.join(q)))>p and isprime(r):
                    yield p
                    break
            p = nextprime(p)
    A166681_list = list(islice(A166681_gen(),20)) # Chai Wah Wu, Jan 17 2023

Extensions

Definition clarified, sequence extended. - R. J. Mathar, Oct 12 2012

A127747 Smallest n-digit emirp (A006567) with strictly increasing (distinct) digits.

Original entry on oeis.org

13, 149, 1237, 12689, 345689, 1235789
Offset: 2

Views

Author

Lekraj Beedassy, Jan 28 2007

Keywords

Crossrefs

Extensions

Edited and extended by Ray Chandler, Jan 30 2007

A246944 Prime numbers p with property that when the first digit is shifted to the last digit, we obtain a prime greater than p.

Original entry on oeis.org

13, 17, 37, 79, 113, 127, 131, 149, 157, 163, 181, 191, 197, 199, 337, 359, 367, 373, 787, 797, 1117, 1123, 1129, 1151, 1153, 1181, 1187, 1193, 1201, 1213, 1231, 1237, 1259, 1279, 1297, 1301, 1319, 1327, 1367, 1409, 1423, 1427, 1439, 1459, 1483, 1487, 1493
Offset: 1

Views

Author

Shanmuga Subramanian, Sep 08 2014

Keywords

Examples

			13: when 1 is shifted to last it becomes 31.
		

Crossrefs

Cf. A109308.

Programs

  • Mathematica
    fdlQ[n_]:=Module[{c=FromDigits[RotateLeft[IntegerDigits[n]]]},PrimeQ[c] && c>n]; Select[Prime[Range[300]],fdlQ] (* Harvey P. Dale, Jun 06 2018 *)
  • PARI
    move(n)=n=Vec(Str(n));N=List();for(i=2,#n,listput(N,n[i]));listput(N,n[1]);return(eval(concat(N)));
    forprime(p=2,1000,if(isprime(move(p))&&move(p)>p,print1(p,","))) \\ Edward Jiang, Sep 08 2014
  • PHP
    function number_firsttolast($a)
    {
    $b=str_split($a);
    $c=count($b);
    for($i=1;$i<$c;$i++)
    {
      $d=$d.$b[$i];
    }
    $e=$d.$b[0];
    return ($e);
    }
    

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
Showing 1-10 of 12 results. Next