login
Palindromic primes in bases 2 and 4.
2

%I #8 Nov 07 2015 04:13:19

%S 3,5,17,257,5189,65537,83269,86293,1053953,1066049,1134929,1311749,

%T 1380629,16864513,17060929,17909009,18153809,18171217,21251141,

%U 22103317,289423441,290455889,290735441,336662789,336925957,340873541

%N Palindromic primes in bases 2 and 4.

%C Intersection of A016041 and A029972.

%C Subsequence of primes of A097856. - _Michel Marcus_, Nov 07 2015

%H Chai Wah Wu, <a href="/A056130/b056130.txt">Table of n, a(n) for n = 1..1000</a>

%e 5 is 101 (base 2) and 11 (base 4), that are both palindromic.

%t Do[If[PrimeQ[n], t = RealDigits[n, 4][[1]]; If[FromDigits[t] == FromDigits[Reverse[t]], s = RealDigits[n, 2][[1]]; If[FromDigits[s] == FromDigits[Reverse[s]], Print[n]]]], {n, 1, 10^8, 2}]

%Y Cf. A016041 and A029972.

%K nonn,base

%O 1,1

%A _Robert G. Wilson v_, Jul 29 2000