login
Primes that are palindromic in base 12.
5

%I #12 Aug 11 2024 14:41:30

%S 2,3,5,7,11,13,157,181,193,229,241,277,761,773,797,809,821,857,1039,

%T 1051,1063,1087,1123,1607,1619,1667,21169,21313,21601,22621,23053,

%U 23197,23629,23773,23917,24061,24793,25657,25801,26821,27109,27253

%N Primes that are palindromic in base 12.

%H Harvey P. Dale, <a href="/A029979/b029979.txt">Table of n, a(n) for n = 1..1000</a>

%H P. De Geest, <a href="https://www.worldofnumbers.com/palpri.htm">World!Of Palindromic Primes</a>

%t f[n_]:=FromDigits[RealDigits[n,12][[1]]]==FromDigits[Reverse[RealDigits[n,12][[1]]]]; lst={}; Do[p=Prime[n]; If[f[p],AppendTo[lst,p]],{n,8!}]; lst (* _Vladimir Joseph Stephan Orlovsky_, Aug 10 2009 *)

%t pal12Q[n_]:=Module[{idn=IntegerDigits[n,12]},idn==Reverse[idn]]; Select[ Prime[ Range[3000]],pal12Q] (* _Harvey P. Dale_, Sep 23 2016 *)

%K nonn,base

%O 1,1

%A _Patrick De Geest_