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 21-30 of 198 results. Next

A048054 Number of n-digit reversible primes (emirps).

Original entry on oeis.org

4, 9, 43, 204, 1499, 9538, 71142, 535578, 4197196, 33619380, 274932272, 2294771254, 19489886063, 167630912672, 1456476399463
Offset: 1

Views

Author

Keywords

Comments

The count includes palindromes.

Examples

			2, 3, 5 and 7 are 1-digit reversible primes, so a(1)=4.
		

Crossrefs

Programs

  • Mathematica
    Count[Range[10^(# - 1), 10^# - 1], n_ /; And[PrimeQ@ n, PrimeQ@ FromDigits@ Reverse@ IntegerDigits@ n]] & /@ Range@ 7 (* Michael De Vlieger, Jul 14 2015 *)
  • Python
    from sympy import isprime, primerange
    def A048054(n):
        return len([p for p in primerange(10**(n-1),10**n)
                    if isprime(int(str(p)[::-1]))]) # Chai Wah Wu, Aug 14 2014

Extensions

a(11)-a(13) from Giovanni Resta, Jul 19 2015
a(14)-a(15) from Cécile Dartyge, Bruno Martin, Joël Rivat, Igor E. Shparlinski, and Cathy Swaenepoel, Oct 05 2023

A003684 Number of n-digit reversible primes (or emirps) with distinct digits.

Original entry on oeis.org

4, 8, 22, 84, 402, 1218, 3572, 8218, 11804
Offset: 1

Views

Author

Keywords

Examples

			13, 17, 31, 37, 71, 73, 79 and 97 are reversible primes (emirps), so a(2)=8.
		

Crossrefs

Programs

  • Mathematica
    emrpQ[n_]:=Module[{idn=IntegerDigits[n],rev},rev=Reverse[idn];rev!=idn && Max[DigitCount[n]] ==1&&PrimeQ[FromDigits[rev]]]; With[{ems=Select[ Prime[ Range[ 51*10^6]],emrpQ]},Join[ {4},Table[Count[ems,?(IntegerLength[ #] == n&)],{n,2,9}]]] (* _Harvey P. Dale, Nov 29 2014 *)
  • Python
    from sympy import primerange, isprime
    def A003684(n):
        return len([p for p in primerange(10**(n-1),10**n)
        if len(set(str(p))) == len(str(p)) and isprime(int(str(p)[::-1]))])
    # Chai Wah Wu, Aug 14 2014

Extensions

Typo in example corrected by David Ritterskamp (dritters(AT)usi.edu), Mar 24 2008

A048052 Start of the first occurrence of n consecutive reversible primes (emirps).

Original entry on oeis.org

2, 2, 2, 2, 2, 2, 2, 727, 1193, 1193, 1477271183, 9387802769, 15423094826093
Offset: 1

Views

Author

Keywords

Comments

Palindromic primes are allowed.

Examples

			2, 3, 5, 7, 11, 13 and 17 are consecutive reversible primes, so a(7) = 2.
		

Crossrefs

Cf. A040104 (n=10), A048051 (n=11), A048053 (n=12), A003684, A006567, A007628, A046732, A048054, A048895.

Extensions

Corrected by Rick L. Shepherd, May 28 2002
a(13) from Giovanni Resta, Nov 07 2019

A048895 Bemirps: primes that yield a different prime when turned upside down with reversals of both being two more different primes.

Original entry on oeis.org

1061, 1091, 1601, 1901, 10061, 10091, 16001, 19001, 106861, 109891, 168601, 198901, 1106881, 1109881, 1606081, 1806061, 1809091, 1886011, 1889011, 1909081, 10806881, 10809881, 11061811, 11091811, 11609681, 11698691, 11816011, 11819011, 11906981
Offset: 1

Views

Author

Keywords

Comments

Emirps that yield other emirps when turned upside down. - Lekraj Beedassy, Apr 03 2009
Invertible primes whose reversals are also invertible primes. - Lekraj Beedassy, Apr 04 2009
All terms must begin and end with a one. - T. D. Noe, Apr 21 2014
A term has to include 6 or 9. The concatenation of first n = 809 bemirp 10611091...11688981911 is a prime with 8143 digits being the smallest one for n > 1. There isn't a bemirp < 10^15 with a bemirp index (over all primes). Bemirps such that 4 associated primes are all Sophie Germain primes are 1161880189181, 1191880186181, 1819810881611, 1816810881911, ... . - Metin Sariyar, Mar 06 2020

Crossrefs

Programs

  • Mathematica
    upDown[0] = 0; upDown[1] = 1; upDown[6] = 9; upDown[8] = 8; upDown[9] = 6; fQ[p_] := Module[{revP, upDownP, revUpDownP}, If[Intersection[{2, 3, 4, 5, 7}, Union[IntegerDigits[p]]] != {}, False, revP = FromDigits[Reverse[IntegerDigits[p]]]; upDownP = FromDigits[upDown /@ IntegerDigits[p]]; revUpDownP = FromDigits[Reverse[IntegerDigits[upDownP]]]; p != revP && p != upDownP && p != revUpDownP && PrimeQ[revP] && PrimeQ[upDownP] && PrimeQ[revUpDownP]]]; t = {}; nn = 6; Do[p = 10^n; While[p < 2*10^n, p = NextPrime[p]; If[fQ[p], AppendTo[t, p]]], {n, nn}]; t (* T. D. Noe, Apr 21 2014 *)

Extensions

More terms from David W. Wilson

A046732 "Norep emirps": primes with distinct digits which remain prime when reversed.

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 31, 37, 71, 73, 79, 97, 107, 149, 157, 167, 179, 347, 359, 389, 701, 709, 739, 743, 751, 761, 769, 907, 937, 941, 953, 967, 971, 983, 1069, 1097, 1237, 1249, 1259, 1279, 1283, 1409, 1429, 1439, 1453, 1487, 1523, 1583, 1597, 1657, 1723, 1753
Offset: 1

Views

Author

Keywords

Comments

There are no 10-digit terms because their sum of digits would be 45 and thus the number would be divisible by 3.
There are 25332 terms in this sequence, the last of which is 987653201, as found by Harvey P. Dale. - see Martin Gardner's column in Scientific American.

Crossrefs

Programs

  • Maple
    read(transforms): A046732 := proc(n) option remember: local d,k,p,distdig: if(n=1)then return 2: fi: p:=procname(n-1): do p:=nextprime(p): if(isprime(digrev(p)))then d:=convert(p,base,10): distdig:=true: for k from 0 to 9 do if(numboccur(d,k)>1)then distdig:=false: break: fi: od: if(distdig)then return p: fi: fi: od: end: seq(A046732(n),n=1..52); # Nathaniel Johnston, May 29 2011
  • Mathematica
    Select[Prime[Range[280]], Length[Union[x = IntegerDigits[#]]] == Length[x] && PrimeQ[FromDigits[Reverse[x]]] &] (* Jayanta Basu, Jun 28 2013 *)
  • Python
    from sympy import prime, isprime
    A046732 = [p for p in (prime(n) for n in range(1,10**3)) if len(str(p)) == len(set(str(p))) and isprime(int(str(p)[::-1]))] # Chai Wah Wu, Aug 14 2014

Extensions

More terms from Jud McCranie.

A109308 Lesser emirps (primes whose digit reversal is a larger prime).

Original entry on oeis.org

13, 17, 37, 79, 107, 113, 149, 157, 167, 179, 199, 337, 347, 359, 389, 709, 739, 769, 1009, 1021, 1031, 1033, 1061, 1069, 1091, 1097, 1103, 1109, 1151, 1153, 1181, 1193, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1279, 1283, 1381, 1399, 1409, 1429
Offset: 1

Views

Author

Zak Seidov, Jun 25 2005

Keywords

Crossrefs

Cf. A006567 (emirps), A109309 (larger emirps).

Programs

  • Maple
    read("transforms"):
    A109308 := proc(n)
        option remember;
        local p,R ;
        if n = 1 then
            return 13 ;
        else
            p := nextprime(procname(n-1)) ;
            while true do
                R := digrev(p) ;
                if R> p and isprime(R) then
                    return p;
                end if;
                p := nextprime(p) ;
            end do:
        end if;
    end proc: # R. J. Mathar, Oct 12 2012
  • Mathematica
    dr[n_]:=FromDigits[Reverse[IntegerDigits[n]]];Select[Prime[Range[1000]], PrimeQ[dr[ # ]]&&dr[ # ]>#&]
  • PARI
    isok(p) = if (isprime(p), my(q=fromdigits(Vecrev(digits(p)))); (p < q) && isprime(q)); \\ Michel Marcus, Sep 07 2021
    
  • Python
    from sympy import isprime, primerange
    def ok(p): revp = int(str(p)[::-1]); return p < revp and isprime(revp)
    print(list(filter(ok, primerange(1, 1430)))) # Michael S. Branicky, Sep 07 2021

A007628 Reflectable emirps.

Original entry on oeis.org

13, 31, 113, 311, 1031, 1033, 1103, 1181, 1301, 1381, 1811, 1831, 3011, 3083, 3301, 3803, 10333, 11003, 11083, 11833, 18013, 18133, 18803, 30011, 30881, 31033, 31081, 31183, 33013, 33181, 33301, 33811, 38011, 38113
Offset: 1

Views

Author

Keywords

Comments

Subsequence of A125308, the reflectable primes. - Reinhard Zumkeller, Jul 16 2014

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • C. W. Trigg, "Reflective Primes", J. Rec. Math., 15 (1983), 251-256.

Crossrefs

Programs

  • Haskell
    a007628 n = a007628_list !! (n-1)
    a007628_list = filter f a125308_list where
       f p = a010051' q == 1 && q /= p  where q = a004086 p
    -- Reinhard Zumkeller, Jul 16 2014

Extensions

Missing 1811 inserted by Reinhard Zumkeller, Jul 16 2014

A109031 Numbers that have exactly eleven prime factors counted with multiplicity (A069272) whose digit reversal is different and also has 11 prime factors (with multiplicity).

Original entry on oeis.org

295245, 426816, 542592, 618624, 2112480, 2116224, 2150064, 2154816, 2196000, 2302560, 2327616, 2342277, 2388672, 2555280, 2576896, 2599200, 2768832, 2952288, 2952576, 4017216, 4074240, 4074840, 4076160, 4076568, 4078848
Offset: 1

Views

Author

Jonathan Vos Post, Jun 16 2005

Keywords

Comments

This sequence is the k = 11 instance of the series which begins with k = 1 (emirps), k = 2, k = 3 (A109023), k = 4 (A109024), k = 5 (A109025), k = 6 (A109026), k = 7 (A109027), k = 8 (A109028), k = 9 (A109029), k = 10 (A109030).

Examples

			a(1) = 295245 is in this sequence because 295245 = 3^10 * 5 has exactly 11 prime factors counted with multiplicity and reverse(295245) = 542592 = 2^7 * 3^3 * 157 also has 11 prime factors counted with multiplicity.
		

Crossrefs

Programs

  • PARI
    is(n) = {
    	my(r = fromdigits(Vecrev(digits(n))));
    	n!=r && bigomega(n) == 11 && bigomega(r) == 11
    } \\ David A. Corneth, Mar 07 2024

Extensions

a(5)-a(25) from Donovan Johnson, Apr 09 2010

A071612 a(n) is the smallest prime that is the first of n consecutive primes which are all emirps.

Original entry on oeis.org

13, 13, 71, 733, 1193, 1193, 1193, 1193, 1193, 1193, 1477271183, 9387802769, 15423094826093
Offset: 1

Views

Author

Klaus Brockhaus, May 27 2002

Keywords

Examples

			1193,1201,1213,1217,1223,1229,1231,1237,1249,1259 are ten consecutive primes which are all emirps and 1193,1201,1213,1217,1223 is the first occurrence of five consecutive primes which are all emirps, so a(5) = a(6) = a(7) = a(8) = a(9) = a(10) = 1193.
		

Crossrefs

Extensions

By studying terms of the sequence A103172 we can deduce that a(11), a(12) are 1477271183 & 9387802769. - Farideh Firoozbakht, Jun 17 2010
a(13) from Giovanni Resta, Apr 23 2021

A098562 Primes that are the sum of the squares of the first k primes for some k.

Original entry on oeis.org

13, 20477, 75997, 239087, 2210983, 3579761, 29194283, 40002073, 45448471, 55600481, 77290091, 108095623, 114986483, 155637463, 226226771, 302920139, 324657881, 519681709, 551321299, 618359839, 797005427, 944007487, 1039681147, 1124764853, 1923614047, 2135308631
Offset: 1

Views

Author

Rick L. Shepherd, Sep 14 2004

Keywords

Comments

These are the primes arising in A098561.

Examples

			From _K. D. Bajpai_, Dec 15 2014: (Start)
13 is in the sequence because the sum of the squares of the first 2 primes is 2^2 + 3^2 = 4 + 9 = 13, which is prime.
20477 is in the sequence because the sum of the squares of the first 18 primes is 2^2 + 3^2 + 5^2 + ... + 59^2 + 61^2 = 4 + 9 + 25 + ... + 3481 + 3721 = 20477, which is prime.
(End)
		

Crossrefs

Cf. A098561 (corresponding n), A024450 (sum of squares of primes), A066525 (sums of cubes of primes), A013918 (sums of primes).
Cf. A000040, A006567. - Jonathan Vos Post, Aug 13 2009

Programs

  • Mathematica
    Select[Table[Sum[Prime[k]^2, {k, 1, n}], {n, 1000}], PrimeQ]  (* K. D. Bajpai, Dec 15 2014 *)
  • PARI
    s=0; forprime(p=2, 1e6, t=s+=p^2; if(isprime(t), print1(t,", "))) \\ K. D. Bajpai, Dec 15 2014

Extensions

a(24)-a(26) from K. D. Bajpai, Dec 15 2014
a(42) in b-file corrected by Andrew Howroyd, Feb 28 2018
Previous Showing 21-30 of 198 results. Next