Palindromic primes in base 16: Difference between revisions

Added 11l
(Added solution for Action!)
(Added 11l)
Line 4:
Find palindromic primes &nbsp; '''n''' &nbsp; in base 16, &nbsp; where &nbsp; '''n &nbsp; &lt; &nbsp; 500<sub>10</sub>'''
<br><br>
 
=={{header|11l}}==
<lang 11l>F is_prime(a)
I a == 2
R 1B
I a < 2 | a % 2 == 0
R 0B
L(i) (3 .. Int(sqrt(a))).step(2)
I a % i == 0
R 0B
R 1B
 
L(n) 500
V h = hex(n)
I h == reversed(h) & is_prime(n)
print(h, end' ‘ ’)
print()</lang>
 
{{out}}
<pre>
2 3 5 7 B D 11 101 151 161 191 1B1 1C1
</pre>
 
=={{header|Action!}}==
1,480

edits