A057708 Numbers m such that 2^m reversed is prime.
1, 4, 5, 7, 10, 17, 24, 37, 45, 55, 70, 77, 107, 137, 150, 271, 364, 1157, 1656, 2004, 2126, 3033, 3489, 3645, 4336, 6597, 7279, 12690, 13840, 20108, 21693, 28888, 84155, 102930
Offset: 1
Examples
4 is a term because 2^4 reversed is 61 and prime.
Crossrefs
Programs
-
Maple
with(numtheory): myarray := []: for n from 1 to 4000 do it1 := convert(2^n, base, 10): it2 := sum(10^(nops(it1)-i)*it1[i], i=1..nops(it1)): if isprime(it2) then printf(`%d,`,n) fi: od:
-
Mathematica
Do[ If[ PrimeQ[ FromDigits[ Reverse[ IntegerDigits[2^n]] ]], Print[ n]], {n, 20000}] (* Robert G. Wilson v, Jan 29 2005 *) Select[Range[4400],PrimeQ[IntegerReverse[2^#]]&] (* Requires Mathematica version 10 or later *) (* The program generates the first 25 terms of the sequence; to generate more, increase the Range constant, but the program will take longer to run. *) (* Harvey P. Dale, Aug 05 2020 *)
-
PARI
isok(m) = isprime(fromdigits(Vecrev(digits(2^m)))) \\ Mohammed Yaseen, Jul 20 2022
-
Python
from sympy import isprime k, m, A057708_list = 1, 2, [] while k <= 10**3: if isprime(int(str(m)[::-1])): A057708_list.append(k) k += 1 m *= 2 # Chai Wah Wu, Mar 09 2021
Extensions
More terms from Chris Nash (chris_nash(AT)prodigy.net), Oct 25 2000
Two more terms from Robert G. Wilson v, Jan 29 2001
3 more terms from Farideh Firoozbakht, Aug 05 2004
a(33)-a(34) from Giovanni Resta, Feb 22 2013
Comments