login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A340842 Emirps p such that p + (sum of digits of p) is an emirp. 2
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Robert Israel, Table of n, a(n) for n = 1..10000

EXAMPLE

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.

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)]);

PROG

(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

CROSSREFS

Cf. A006567.  Contains A340843.

Sequence in context: A031442 A066831 A067382 * A253776 A158941 A128003

Adjacent sequences:  A340839 A340840 A340841 * A340843 A340844 A340845

KEYWORD

nonn,base

AUTHOR

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

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 17 17:21 EDT 2021. Contains 348065 sequences. (Running on oeis4.)