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

A217386 Emirps (A006567) whose difference with the reversal is a perfect square.

Original entry on oeis.org

37, 73, 1237, 3019, 7321, 9103, 104801, 105601, 106501, 108401, 111211, 112111, 120121, 121021, 137831, 138731, 144541, 145441, 150151, 151051, 161561, 165161, 167861, 168761, 171271, 172171, 180181, 181081, 185681, 186581, 189337, 194891, 198491, 302647, 305603, 306503
Offset: 1

Views

Author

Antonio Roldán, Oct 02 2012

Keywords

Comments

The differences are multiples of 36.

Examples

			37 and 73 are primes. 73 - 37 = 36, which is 6^2.
302647 is prime, the reversal 746203 is also prime. 746203 - 302547 = 443556 = 666^2.
		

Crossrefs

Subsequence of A006567 and of A158065.

Programs

  • PARI
    isinteger(n)=(n==truncate(n))
    reverse(n)=eval(concat(Vecrev(Str(n))))
    isquare(n)= { local(f,m,p=0); if(n==1,p=1,f=factor(n); m=gcd(f[, 2]); if(isinteger(m/2),p=1));return(p) }
    {for(i=2,10^7,p=reverse(i);if(isprime(i)&&isprime(p)&&isquare(abs(i-p)),print1(i", ")))} /* Antonio Roldán, Dec 20 2012 */

A217286 Larger of pairs of emirps (A006567) whose difference with the (smaller) reversal is a triangular number (A000217).

Original entry on oeis.org

73, 1811, 7817, 7927, 11701, 12611, 14431, 14831, 15101, 15241, 15541, 15601, 16111, 16451, 16651, 17021, 18671, 18731, 19181, 19541, 19681, 19841, 32213, 32713, 33223, 33623, 33923, 35803, 36013, 36353, 36913, 37123, 37363, 37463, 37963, 39383, 39983, 71707
Offset: 1

Views

Author

Jonathan Vos Post, Oct 02 2012

Keywords

Comments

Related to A217386 as triangular numbers (A000217) are to squares (A000290), but in the current sequence, only the larger of each emirp pair is used.

Examples

			a(1) = 73 because 73 - 37 = 36 = 8th triangular number.
a(2) = 1811 because R(1811) = A004086(1811) = 1181, and 1811 - 1181 = 630 = 35th triangular number.
a(3) = 7817 because 7817 - 7187 = 630 = 35th triangular number.
a(4) = 7927 because 7927 - 7297 = 630 = 35*36/2.
		

Crossrefs

Programs

  • Mathematica
    emrp[p_]:=Module[{rev=IntegerReverse[p]},If[rev!=p&&PrimeQ[rev],Max[ rev,p],Nothing]]; Select[Union[emrp/@Prime[Range[7500]]],OddQ[Sqrt[8(#-IntegerReverse[ #])+1]]&] (* Harvey P. Dale, Jan 30 2023 *)

Formula

{k: k is in A006567 and k - A004086(k) is in A000217}.

Extensions

More terms from Alois P. Heinz, Oct 03 2012

A217387 Emirps (A006567) whose difference with the reversal is a perfect cube.

Original entry on oeis.org

1523, 3251, 7529, 9257, 154747, 165857, 171467, 174767, 312509, 322519, 373669, 747451, 758561, 764171, 767471, 905213, 915223, 966373, 1000033, 1020233, 1077733, 1078733, 1083833, 1099933, 1165643, 1173743, 1175743, 1213153, 1239353, 1247453, 1281853, 1292953
Offset: 1

Views

Author

Antonio Roldán, Oct 02 2012

Keywords

Comments

The differences are multiples of 1728.

Examples

			905213 is prime, 312509 is prime. 905213 - 312509 = 592704 = 84^3.
		

Crossrefs

Cf. A006567.

Programs

  • Mathematica
    Select[Prime[Range[100000]],!PalindromeQ[#]&&PrimeQ[IntegerReverse[#]] && IntegerQ[ CubeRoot[ Abs[#-IntegerReverse[#]]]]&] (* Harvey P. Dale, Jan 27 2023 *)
  • PARI
    isok(i)=my(p=fromdigits(Vecrev(digits(i)))); i!=p && isprime(i) && isprime(p) && ispower(abs(i-p), 3)
    {for(i=2, 2*10^6, if(isok(i), print1(i, ", ")))} /* Antonio Roldán, Dec 19 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

A127827 Smallest n-digit emirp (A006567) with nondecreasing digits.

Original entry on oeis.org

13, 113, 1223, 11149, 111119, 1111339, 11111117, 111111199, 1111111999, 11111111113, 111111111149, 1111111111267, 11111111111257, 111111111113447, 1111111111112227, 11111111111122223, 111111111111113569, 1111111111111113779, 11111111111111133677, 111111111111111111157, 1111111111111111122359, 11111111111111111133469
Offset: 2

Views

Author

Ray Chandler, Jan 31 2007

Keywords

Crossrefs

Programs

  • Maple
    nextl:= proc(L)
    local m,k,r;
    # L a list of digits 1-9, last odd, in nondecreasing order
    if L[-1]<= 7 then return subsop(-1=L[-1]+2, L) fi;
    m:= nops(L); k:= m-1;
    while L[k] =9 do k:= k-1 od:
    r:= [op(L[1..k-1]),(L[k]+1) $ (m+1-k)];
    if r[-1]::even then r:= subsop(-1=r[-1]+1, r) fi;
    r
    end proc:
    f:= proc(n) local L,p,q,i;
      L:= [1$n];
      do
        p:= add(L[i]*10^(i-1),i=1..n);
        q:= add(L[-i]*10^(i-1),i=1..n);
        if q <> p and isprime(p) and isprime(q) then return(q) fi;
        L:= nextl(L);
      od
    end proc:
    map(f, [$2..30]); # Robert Israel, Nov 19 2017
  • Python
    from sympy import isprime
    from itertools import count, islice, combinations_with_replacement as mc
    def bgen(d):
        nd = ("".join(m) for m in mc("123456789", d))
        yield from filter(isprime, map(int, nd))
    def ok(ndp):
        s = str(ndp)
        return len(set(s)) != 1 and isprime(int(s[::-1]))
    def agen():
        yield from (next(filter(ok, bgen(d))) for d in count(2))
    print(list(islice(agen(), 22))) # Michael S. Branicky, Jun 26 2022

Extensions

More terms from Robert Israel, Nov 19 2017

A127828 Largest n-digit emirp (A006567) with nonincreasing digits.

Original entry on oeis.org

97, 991, 9941, 99881, 999983, 9999971, 99999643, 999999761, 9999999511, 99999999977, 999999998863, 9999999998633, 99999999998333, 999999999999877, 9999999999998633, 99999999999987443, 999999999999999331, 9999999999999988633, 99999999999999999631
Offset: 2

Views

Author

Ray Chandler, Jan 31 2007

Keywords

Crossrefs

Programs

  • Mathematica
    nde[n_]:=Module[{p=NextPrime[10^n,-1]},While[Max[Differences[ IntegerDigits[ p]]]>0 || CompositeQ[IntegerReverse[p]],p=NextPrime[ p,-1]];p]; Array[nde,17,2] (* Harvey P. Dale, Mar 13 2020 *)
  • Python
    from sympy import isprime
    from itertools import count, islice, combinations_with_replacement as mc
    def bgen(d):
        nd = ("".join(m) for m in mc("987654321", d))
        yield from filter(isprime, map(int, nd))
    def ok(ndp):
        s = str(ndp)
        return len(set(s)) != 1 and isprime(int(s[::-1]))
    def agen():
        yield from (next(filter(ok, bgen(d))) for d in count(2))
    print(list(islice(agen(), 20))) # Michael S. Branicky, Jun 26 2022

Extensions

a(19) and beyond from Michael S. Branicky, Jun 26 2022

A167992 Least n-digit emirp (A006567) with emirp digital sum, or 0 if no such value.

Original entry on oeis.org

0, 0, 157, 1097, 10039, 100129, 1000039, 10000169, 100000543, 1000000097, 10000000277, 100000000237, 1000000001159, 10000000000853, 100000000001173, 1000000000000273, 10000000000000079, 100000000000001249
Offset: 1

Views

Author

Jonathan Vos Post, Nov 16 2009

Keywords

Comments

Least emirp (non-palindromic prime in A007500, i.e., prime whose reversal is a different prime) greater than 10^n, for which the sum of digits (A007953) is also an emirp.

Examples

			a(1) = a(2) = 0. a(3) = 157 because 157 is the least non-palindromic prime p > 10^3 such that R(p), in this case 751, is also prime, and the sum of digits sod(p), in this case 1+5+7 = 13, is likewise an emirp (prime with reversal a different prime). a(4) = 1097 because it is the smallest 4-digit prime, whose reversal (7901) is a different prime, and whose digital sum 1+0+9+7 = 17, which is prime and has a prime reversal (71).
		

Crossrefs

Programs

  • Maple
    read("transforms") ; A007953 := proc(n) local d ; add(d, d=convert(n,base,10)) ; end proc: isA006567 := proc(p) if isprime(p) then isprime(digrev(p)) and digrev(p) <> p ; else false ; end if; end proc ; A167992 := proc(n) local p; p := nextprime(10^(n-1)) ; while p <= 10^n do if isA006567(p) and isA006567(A007953(p)) then return p; end if; p := nextprime(p) ; end do ; return 0 ; end proc: seq(A167992(n),n=1..70) ; # R. J. Mathar, Nov 18 2009

Formula

a(n) = Min{p > 10^n in A006567, and A007953(p) is in A006567} = Min{p > 10^n in A000040 such that A004086(p) is in A000040, and A004086(p) distinct from p, and in A006567(p) is in A000040, and A004086(p) distinct from A006567(p), and in A000040}.

Extensions

More terms from R. J. Mathar, Nov 18 2009

A168174 Emirps (A006567) with emirp number of digits and emirp digital sum.

Original entry on oeis.org

1000000001159, 1000000002217, 1000000003463, 1000000004161, 1000000005713, 1000000005911, 1000000006037, 1000000006451, 1000000006699, 1000000007333, 1000000009403, 1000000010249, 1000000010447, 1000000010483, 1000000011019
Offset: 1

Views

Author

Jonathan Vos Post, Nov 19 2009

Keywords

Comments

Last 13-digit examples: 9999999990583, 9999999990853, 9999999995191, 9999999996901, 9999999997919, 9999999998987. First examples of some digit lengths: 10^16 + {79, 1551, 3711, 7711, 9421, 9867}; 10^30 + {2613, 29979, 37857, 41461, 47577}; 10^36 + {9061, 21081, 52351, 71017, 95781}; 10^70 + {691, 19321, 203403, 225201, 231987}; 10^72 + {97167, 158637, 227001, 233679, 265021}. ... and skipping a few other legal lengths... 10^148 + 53967 -- Jack Brennen

Examples

			a(1) = 1000000001159, which is prime, and R(1000000001159) = 951100000000 is prime, and sod(1000000001159) = 17 is prime, and R(17) = 71 is prime.
		

Crossrefs

Formula

{p: p in A006567 and A055642(p) in A006567 and A007953(p) in A006567}.

A127748 Largest n-digit emirp (A006567) with strictly decreasing (distinct) digits.

Original entry on oeis.org

97, 983, 9871, 98731, 986543, 9875321
Offset: 2

Views

Author

Lekraj Beedassy, Jan 28 2007

Keywords

Crossrefs

Extensions

Edited and extended by Ray Chandler, Jan 30 2007

A167631 Emirps A006567 with a sum of digits and a number of digits which are both primes.

Original entry on oeis.org

113, 157, 179, 199, 311, 337, 359, 733, 739, 751, 937, 953, 971, 991, 10039, 10079, 10091, 10253, 10273, 10321, 10343, 10453, 10457, 10459, 10499, 10613, 10639, 10651, 10781, 10853, 10859, 10891, 10909, 11003, 11083, 11159, 11197, 11243
Offset: 1

Views

Author

Claudio Meller, Nov 07 2009

Keywords

Comments

Subsequence of A006567 and A028834. - R. J. Mathar, Nov 12 2009

Examples

			113 and 311 are distinct primes, and 3 (number of digits) and 5 (1+1+3) are also primes.
		

Programs

  • PARI
    sod(n)=my(s=0);while(n>9,s+=n%10;n\=10);s+n
    R(n)=my(v=eval(Vec(Str(n))),s=0);forstep(i=#v,1,-1,s=10*s+v[i]);s
    isA167631(n)=my(r); isprime(#Str(n)) && isprime(sod(n)) && isprime(n) && isprime(r=R(n)) && n!=r \\ Charles R Greathouse IV, Nov 10 2009
    
  • Python
    from sympy import primerange, isprime
    A167631 =[]
    for power_of_ten in [2,3,5]: # (7 can be added (12 sec. and 26790 terms), 11 not recommended)
        primes = list(primerange(10**(power_of_ten-1),10**power_of_ten))
        for p in primes:
            if str(p) != (p_rev:=str(p)[::-1]):
                if isprime(int(p_rev)):
                    if isprime(sum(list(map(int, p_rev.strip())))): A167631.append(p)
    print(A167631) # Karl-Heinz Hofmann, Feb 19 2025

Extensions

Edited by Charles R Greathouse IV and R. J. Mathar, Nov 10 2009
Showing 1-10 of 198 results. Next