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

A168110 Palindromic primes in base 8 which are also emirps (A006567) in base 10.

Original entry on oeis.org

73, 97, 113, 12547, 12611, 13259, 13523, 14107, 14563, 14891, 15667, 15731, 30367, 31799, 31991, 312073, 318281, 350033, 359377, 366169, 371353, 372377, 383833, 392153, 393761, 397921, 792131, 796291, 936227, 936739, 948707, 966379, 992947, 1005427, 1008563, 1029883, 1043899, 1048571, 1311749, 1313797, 1340357, 1358029
Offset: 1

Views

Author

Jonathan Vos Post, Nov 18 2009

Keywords

Comments

What is a good way in the OEIS to show other such pairs of bases analogous to this?

Examples

			a(1) = 73 because 73 (base 8) = 111 (which is a palindrome), and R(73) = 37 which is a different prime (base 10). a(2) = 97 because 97 (base 8) = 141 (which is a palindrome), and R(97) = 79 which is a different prime (base 10). a(3) = 113 because 113 (base 8) = 161 (which is a palindrome), and R(113) = 311 which is a different prime (base 10). a(4) = 12547 because 12547 (base 8) = 30403 (which is a palindrome), and R(12547) = 74521 which is a different prime (base 10).
		

Crossrefs

Programs

  • Maple
    isA006567 := proc(p) local r; if isprime(p) then r := digrev(p) ; r <> p and isprime(r) ; else false; end if; end proc: isA029803 := proc(n) local dgs,d; dgs := convert(n,base,8) ; for d from 1 to nops(dgs)/2 do if op(d,dgs) <> op(-d,dgs) then return false; end if; end do ; return true; end proc: isA029976 := proc(n) isprime(n) and isA029803(n) ; end proc: isA168110 := proc(p) isA029976(p) and isA006567(p) ; end proc: A168110 := proc(n) option remember ; local a; if n = 1 then 73 ; else a := nextprime(procname(n-1)) ; while not isA168110(a) do a := nextprime(a) ; end do ; return a; end if; end proc: seq(A168110(n),n=1..30) ; # R. J. Mathar, Dec 06 2009
  • Mathematica
    okQ[n_]:=Module[{fridn=FromDigits[Reverse[IntegerDigits[n]]], idn8= IntegerDigits[n,8]}, fridn!=n&&PrimeQ[fridn]&&idn8==Reverse[idn8]]; Select[Prime[Range[75000]],okQ] (* Harvey P. Dale, Aug 10 2011 *)

Formula

A029976 INTERSECTION A006567.

Extensions

Terms beyond a(10) by R. J. Mathar, Dec 06 2009

A172463 Partial sums of A006567.

Original entry on oeis.org

13, 30, 61, 98, 169, 242, 321, 418, 525, 638, 787, 944, 1111, 1290, 1489, 1800, 2137, 2484, 2843, 3232, 3933, 4642, 5375, 6114, 6857, 7608, 8369, 9138, 10045, 10982, 11923, 12876, 13843, 14814, 15797, 16788, 17797, 18818, 19849, 20882, 21943, 23012, 24103
Offset: 1

Views

Author

Jonathan Vos Post, Feb 03 2010

Keywords

Crossrefs

Cf. A006567.

Programs

  • Mathematica
    emirpQ[n_]:=Module[{idn=IntegerDigits[n],ridn},ridn=Reverse[idn];idn!= ridn && PrimeQ[FromDigits[ridn]]]; Accumulate[Select[Prime[ Range[ 200]], emirpQ]] (* Harvey P. Dale, Oct 25 2011 *)

Formula

a(n) = Sum_{i=1..n} A006567(n).

Extensions

Corrected by Harvey P. Dale, Oct 25 2011

A375234 Square array T(n,k), n>1 and k>1, read by antidiagonals in ascending order, giving the smallest n*k-digit number that, if arranged in an n X k matrix, forms a k-digit emirp (A006567) in each row and an n-digit emirp in each column, or -1 if no such number exists.

Original entry on oeis.org

1331, 131337, 113337, 13139731, 113113337, 11933371, 1313717979, 113149971311, 119314713911, 1119737379, 131313131397, 113107709179991, 1193100990013911, 111971414339313, 111119333337
Offset: 2

Views

Author

Jean-Marc Rebert, Aug 06 2024

Keywords

Examples

			T(3,2) = 131337 is the smallest 3*2-digit that if arranged in a 3 X 2 matrix yields in each row and column an emirp, i.e.,
 13
 13
 37
-> 13 (2 times), 37 (1 times), 113 (1 time), 337 (1 time) are all emirps.
Table begins (upper left corner = T(2,2)):
      1331       113337         11933371 ...
    131337    113113337     119314713911 ...
  13139731 113149971311 1193100990013911 ...
       ...          ...              ... ...
		

Crossrefs

A171807 Emirps (A006567) p such that R(prime(p)) is prime.

Original entry on oeis.org

37, 71, 157, 167, 199, 907, 953, 971, 991, 1151, 1193, 1213, 1223, 1231, 1237, 1279, 1283, 1381, 1429, 1471, 1499, 1523, 1583, 1597, 1601, 1619, 1669, 1811, 1831, 1867, 3299, 3343, 3347, 3371, 3373, 3391, 3463, 3467, 3469, 3527, 3541, 3719, 3767, 3803
Offset: 1

Views

Author

Jonathan Vos Post, Dec 18 2009

Keywords

Examples

			a(1) = 37 because 37 and R(37) = 73 are prime, as are prime(37) = 157 and R(prime(37)) = 751.
a(2) = 71 because 71 and R(71) = 17 are prime, as are prime(71) = R(prime(71)) = 353 (which is not an emirp because the reversal is the same prime).
a(3) = 157 because 157 and R(157) = 751 are prime, as are prime(157) = R(prime(157)) = 919 (which is not an emirp because the reversal is the same prime).
a(4) = 167 because 167 and R(157) = 671 are prime, as are prime(167) = 991 and R(prime(167)) = 199.
a(5) = 199 because 199 and (199) = 991 are prime, as are prime(199) = 1217 and R(1217)= prime(912) = 7121.
		

Crossrefs

Programs

  • Mathematica
    emQ[n_]:=Module[{idn=IntegerDigits[n],revidn},revidn=Reverse[idn];idn!= revidn && PrimeQ[FromDigits[revidn]] && PrimeQ[FromDigits[ Reverse[ IntegerDigits[ Prime[n]]]]]]; Select[Prime[Range[600]],emQ] (* Harvey P. Dale, Mar 01 2012 *)

Formula

{n such that n is in A000040 and A006567(n) is in A000040 and A000040(n) is in A000040 and A006567(A000040(n)) is in A000040}.

Extensions

More terms from R. J. Mathar, Jan 25 2010

A215685 Smallest prime whose decimal expansion consists of the concatenation of a 2-digit emirp, a 3-digit emirp, a 4-digit emirp, ..., and an n-digit emirp (A006567).

Original entry on oeis.org

13, 13337, 131071021, 13107100910711, 13107100910007100483, 131071009100071000491000187, 13107100910007100049100003310000657, 13107100910007100049100003310000169100007543, 131071009100071000491000033100001691000000071000015351
Offset: 2

Views

Author

Jonathan Vos Post, Aug 20 2012

Keywords

Comments

If a(n) exists it has A000217(n)-1 digits.

Examples

			a(2) = 13 which is a prime, and whose decimal digits reversed, 31, is also a prime.
a(3) = 13337, which is a prime, and the concatenation of 13 (an emirp) and 337 (an emirp because 733 is also a prime). It happens that the digital reversal of a(3), 73331, is also prime, so that 13337 is an emirp, but that is not a requirement for this sequence.
Note that a(4) is a prime but not an emirp, because 12070131 = 3 * 61 * 65957.
		

Crossrefs

Extensions

More terms from Alois P. Heinz, Aug 22 2012

A217591 Absolute differences between emirps (A006567) and their reversals.

Original entry on oeis.org

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

Views

Author

Jonathan Vos Post, Oct 07 2012

Keywords

Comments

This is unsorted, and in order of appearance of emirps.
All values are multiples of 18 (A008600). - Charles R Greathouse IV, Oct 15 2012

Examples

			a(1) = absolute value of first emirp versus its reversal = |13 - 31| = |-18| = 18.
a(2) = |17 - 71| = |-54| = 54.
a(3) = |31 - 13| = |18| = 18.
a(4) = |37 - 73| = |-36| = 36.
		

Crossrefs

Programs

  • Maple
    R:= n-> (s-> parse(cat(s[-i]$i=1..length(s))))(""||n):
    q:= n-> isprime(n) and (p-> p<>n and isprime(p))(R(n)):
    map(x-> abs(x-R(x)), select(q, [$2..1280]))[];  # Alois P. Heinz, Jul 12 2024

Formula

a(n) = | A006567(n) - R(A006567(n)) | = | A006567(n) - A004086(A006567(n)) |.

Extensions

Corrected and more terms from Georg Fischer, Jul 12 2024

A217610 Emirps (A006567) whose difference with the reversal is a perfect 4th power (A000583).

Original entry on oeis.org

1100090011, 1100900011, 1103093011, 1103903011, 1154094511, 1154904511, 1213093121, 1213903121, 1304094031, 1304904031, 1364094631, 1364904631, 1367097631, 1367907631, 1421091241, 1421901241, 1450090541, 1450900541, 1466096641, 1466906641, 1495095941, 1495905941, 1498098941, 1498908941
Offset: 1

Views

Author

Jonathan Vos Post, Oct 06 2012

Keywords

Comments

This is to A217387 as perfect 4th powers (A000583) are to perfect cubes (A000578), and as A217386 is to perfect squares (A000290). Subset of A217386, since every perfect 4th power is a perfect square (though not vice versa). In these terms all the difference are equal to 30^4.
Values a(1) through a(24) supplied by Giovanni Resta.

Crossrefs

A382389 Numbers k such that k, prime(k) and primepi(reverse(prime(k))) are emirps (A006567).

Original entry on oeis.org

7673, 9001, 12491, 17749, 31481, 75041, 93887, 95881, 102061, 104479, 112621, 113557, 118429, 139999, 722713, 743891, 749927, 999133, 1001941, 1086353, 1115071, 1165511, 1233907, 1861913, 1861973, 1881697, 1927903, 1972259
Offset: 1

Views

Author

Ivan N. Ianakiev, Mar 23 2025

Keywords

Examples

			Take for example the two emirps 133963 and 369331. Their indices (in A000040) are 12491 and 31481, which are also emirps. So, those indices are terms of the present sequence.
		

Crossrefs

Cf. A006567 (supersequence).

Programs

  • Mathematica
    emirpQ[n_]:=AllTrue[{n,IntegerReverse[n]},PrimeQ]&&!PalindromeQ[n];
    Select[Prime[Range[10000]],AllTrue[{#,Prime[#],PrimePi[IntegerReverse[Prime[#]]]},emirpQ]&]

A002385 Palindromic primes: prime numbers whose decimal expansion is a palindrome.

Original entry on oeis.org

2, 3, 5, 7, 11, 101, 131, 151, 181, 191, 313, 353, 373, 383, 727, 757, 787, 797, 919, 929, 10301, 10501, 10601, 11311, 11411, 12421, 12721, 12821, 13331, 13831, 13931, 14341, 14741, 15451, 15551, 16061, 16361, 16561, 16661, 17471, 17971, 18181, 18481, 19391, 19891, 19991
Offset: 1

Views

Author

Keywords

Comments

Every palindrome with an even number of digits is divisible by 11, so 11 is the only member of the sequence with an even number of digits. - David Wasserman, Sep 09 2004
This holds in any number base A006093(n), n>1. - Lekraj Beedassy, Mar 07 2005 and Dec 06 2009
The log-log plot shows the fairly regular structure of these numbers. - T. D. Noe, Jul 09 2013
Conjecture: The only primes with palindromic prime indices that are palindromic primes themselves are 3, 5 and 11. Tested for the primes with the first 8000000 palindromic prime indices. - Ivan N. Ianakiev, Oct 10 2014
It follows from the above conjecture that 2 is the only k such that k, prime(k), prime(m) = k + prime(k) and m are all palindromic primes. - Ivan N. Ianakiev, Mar 17 2025
Banks, Hart, and Sakata derive a nontrivial upper bound for the number of prime palindromes n <= x as x -> oo. It follows that almost all palindromes are composite. The results hold in any base. The authors use Weil's bound for Kloosterman sums. - Jonathan Sondow, Jan 02 2018
Number of terms < 100^k, k >= 1: 5, 20, 113, 781, 5953, 47995, 401698, .... - Robert G. Wilson v, Jan 03 2018, corrected by M. F. Hasler, Dec 19 2024
Initially the above comment listed 4, 20, 113, ... which is the number of terms less than 10, 1000, 10^5, ..., i.e., up to 10^(2k-1), k >= 1. The number of terms < 10^k are the cumulative sums of A016115(n) (number of prime palindromes with n digits) up to n = k. - M. F. Hasler, Dec 19 2024

References

  • A. H. Beiler, Recreations in the Theory of Numbers, Dover, NY, 1964, p. 228.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 120-121.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A007500 = this sequence union A006567.
Subsequence of A188650; A188649(a(n)) = a(n); see A033620 for multiplicative closure. [Reinhard Zumkeller, Apr 11 2011]
Cf. A016041, A029732, A069469, A117697, A046942, A032350 (Palindromic nonprime numbers).
Cf. A016115 (number of prime palindromes with n digits).

Programs

  • GAP
    Filtered([1..20000],n->IsPrime(n) and ListOfDigits(n)=Reversed(ListOfDigits(n))); # Muniru A Asiru, Mar 08 2019
  • Haskell
    a002385 n = a002385_list !! (n-1)
    a002385_list = filter ((== 1) . a136522) a000040_list
    -- Reinhard Zumkeller, Apr 11 2011
    
  • Maple
    ff := proc(n) local i,j,k,s,aa,nn,bb,flag; s := n; aa := convert(s,string); nn := length(aa); bb := ``; for i from nn by -1 to 1 do bb := cat(bb,substring(aa,i..i)); od; flag := 0; for j from 1 to nn do if substring(aa,j..j)<>substring(bb,j..j) then flag := 1 fi; od; RETURN(flag); end; gg := proc(i) if ff(ithprime(i)) = 0 then RETURN(ithprime(i)) fi end;
    rev:=proc(n) local nn, nnn: nn:=convert(n,base,10): add(nn[nops(nn)+1-j]*10^(j-1),j=1..nops(nn)) end: a:=proc(n) if n=rev(n) and isprime(n)=true then n else fi end: seq(a(n),n=1..20000); # rev is a Maple program to revert a number - Emeric Deutsch, Mar 25 2007
    # A002385 Gets all base-10 palindromic primes with exactly d digits, in the list "Res"
    d:=7; # (say)
    if d=1 then Res:= [2,3,5,7]:
    elif d=2 then Res:= [11]:
    elif d::even then
        Res:=[]:
    else
        m:= (d-1)/2:
        Res2 := [seq(seq(n*10^(m+1)+y*10^m+digrev(n), y=0..9), n=10^(m-1)..10^m-1)]:
        Res:=[]: for x in Res2 do if isprime(x) then Res:=[op(Res),x]; fi: od:
    fi:
    Res; # N. J. A. Sloane, Oct 18 2015
  • Mathematica
    Select[ Prime[ Range[2100] ], IntegerDigits[#] == Reverse[ IntegerDigits[#] ] & ]
    lst = {}; e = 3; Do[p = n*10^(IntegerLength[n] - 1) + FromDigits@Rest@Reverse@IntegerDigits[n]; If[PrimeQ[p], AppendTo[lst, p]], {n, 10^e - 1}]; Insert[lst, 11, 5] (* Arkadiusz Wesolowski, May 04 2012 *)
    Join[{2,3,5,7,11},Flatten[Table[Select[Prime[Range[PrimePi[ 10^(2n)]+1, PrimePi[ 10^(2n+1)]]],# == IntegerReverse[#]&],{n,3}]]] (* The program uses the IntegerReverse function from Mathematica version 10 *) (* Harvey P. Dale, Apr 22 2016 *)
    genPal[n_Integer, base_Integer: 10] := Block[{id = IntegerDigits[n, base], insert = Join[{{}}, {# - 1} & /@ Range[base]]}, FromDigits[#, base] & /@ (Join[id, #, Reverse@id] & /@ insert)]; k = 1; lst = {2, 3, 5, 7}; While[k < 19, p = Select[genPal[k], PrimeQ];
    If[p != {}, AppendTo[lst, p]]; k++]; Flatten@ lst (* RGWv *)
    Select[ Prime[ Range[2100]], PalindromeQ] (* Jean-François Alcover, Feb 17 2018 *)
    NestList[NestWhile[NextPrime, #, ! PalindromeQ[#2] &, 2] &, 2, 41] (* Jan Mangaldan, Jul 01 2020 *)
  • PARI
    is(n)=n==eval(concat(Vecrev(Str(n))))&&isprime(n) \\ Charles R Greathouse IV, Nov 20 2012
    
  • PARI
    forprime(p=2,10^5, my(d=digits(p,10)); if(d==Vecrev(d),print1(p,", "))); \\ Joerg Arndt, Aug 17 2014
    
  • PARI
    A002385_row(n)=select(is_A002113, primes([10^(n-1),10^n])) \\ Terms with n digits. For larger n, better filter primes in palindromes. - M. F. Hasler, Dec 19 2024
    
  • Python
    from itertools import chain
    from sympy import isprime
    A002385 = sorted((n for n in chain((int(str(x)+str(x)[::-1]) for x in range(1,10**5)),(int(str(x)+str(x)[-2::-1]) for x in range(1,10**5))) if isprime(n))) # Chai Wah Wu, Aug 16 2014
    
  • Python
    from sympy import isprime
    A002385 = [*filter(isprime, (int(str(x) + str(x)[-2::-1]) for x in range(10**5)))]
    A002385.insert(4, 11)  # Yunhan Shi, Mar 03 2023
    
  • Python
    from sympy import isprime
    from itertools import count, islice, product
    def A002385gen(): # generator of palprimes
        yield from [2, 3, 5, 7, 11]
        for d in count(3, 2):
            for last in "1379":
                for p in product("0123456789", repeat=d//2-1):
                    left = "".join(p)
                    for mid in [[""], "0123456789"][d&1]:
                        t = int(last + left + mid + left[::-1] + last)
                        if isprime(t):
                            yield t
    print(list(islice(A002385gen(), 46))) # Michael S. Branicky, Apr 13 2025
    
  • Sage
    [n for n in (2..18181) if is_prime(n) and Word(n.digits()).is_palindrome()] # Peter Luschny, Sep 13 2018
    

Formula

Intersection of A000040 (primes) and A002113 (palindromes).
A010051(a(n)) * A136522(a(n)) = 1. [Reinhard Zumkeller, Apr 11 2011]
Complement of A032350 in A002113. - Jonathan Sondow, Jan 02 2018

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Oct 25 2000
Comment from A006093 moved here by Franklin T. Adams-Watters, Dec 03 2009

A007500 Primes whose reversal in base 10 is also prime (called "palindromic primes" by David Wells, although that name usually refers to A002385). Also called reversible primes.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, 97, 101, 107, 113, 131, 149, 151, 157, 167, 179, 181, 191, 199, 311, 313, 337, 347, 353, 359, 373, 383, 389, 701, 709, 727, 733, 739, 743, 751, 757, 761, 769, 787, 797, 907, 919, 929, 937, 941, 953, 967, 971, 983, 991, 1009, 1021
Offset: 1

Views

Author

Keywords

Comments

The numbers themselves need not be palindromes.
The range is a subset of the range of A071786. - Reinhard Zumkeller, Jul 06 2009
Number of terms less than 10^n: 4, 13, 56, 260, 1759, 11297, 82439, 618017, 4815213, 38434593, ..., . - Robert G. Wilson v, Jan 08 2015

References

  • Roozbeh Hazrat, Mathematica: A Problem-Centered Approach, Springer 2010, pp. 39, 131-132
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 113.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, 134.

Crossrefs

Cf. A002385 (primes that are palindromes in base 10).
Equals A002385 union A006567.
Complement of A076056 with respect to A000040. [From Reinhard Zumkeller, Jul 06 2009]

Programs

  • Haskell
    a007500 n = a007500_list !! (n-1)
    a007500_list = filter ((== 1) . a010051 . a004086) a000040_list
    -- Reinhard Zumkeller, Oct 14 2011
    
  • Magma
    [ p: p in PrimesUpTo(1030) | IsPrime(Seqint(Reverse(Intseq(p)))) ];  // Bruno Berselli, Jul 08 2011
    
  • Maple
    revdigs:= proc(n)
    local L,nL,i;
    L:= convert(n,base,10);
    nL:= nops(L);
    add(L[i]*10^(nL-i),i=1..nL);
    end:
    Primes:= select(isprime,{2,seq(2*i+1,i=1..5*10^5)}):
    Primes intersect map(revdigs,Primes); # Robert Israel, Aug 14 2014
  • Mathematica
    Select[ Prime[ Range[ 168 ] ], PrimeQ[ FromDigits[ Reverse[ IntegerDigits[ # ] ] ] ]& ] (* Zak Seidov, corrected by T. D. Noe *)
    Select[Prime[Range[1000]],PrimeQ[IntegerReverse[#]]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 15 2016 *)
  • PARI
    is_A007500(n)={ isprime(n) & is_A095179(n)} \\ M. F. Hasler, Jan 13 2012
    
  • Python
    from sympy import prime, isprime
    A007500 = [prime(n) for n in range(1,10**6) if isprime(int(str(prime(n))[::-1]))] # Chai Wah Wu, Aug 14 2014
    
  • Python
    from gmpy2 import is_prime, mpz
    from itertools import count, islice, product
    def agen(): # generator of terms
        yield from [2, 3, 5, 7]
        p = 11
        for digits in count(2):
            for first in "1379":
                for mid in product("0123456789", repeat=digits-2):
                    for last in "1379":
                        s = first + "".join(mid) + last
                        if is_prime(t:=mpz(s)) and is_prime(mpz(s[::-1])):
                            yield int(t)
    print(list(islice(agen(), 60))) # Michael S. Branicky, Jan 02 2025

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Oct 31 2000
Added further terms to the sequence Avik Roy (avik_3.1416(AT)yahoo.co.in), Jan 16 2009. Checked by N. J. A. Sloane, Jan 20 2009.
Third reference added by Harvey P. Dale, Oct 17 2011
Previous Showing 11-20 of 198 results. Next