Kip, That was a challenge! Soon someone will do it much more grcefully!
Simplifications welcome. It is all done in characters.
f=:[: ": [: ,. p:
g=:((1 = [: +/"1 ' ' ~: f) + ((1 {"1 f) = 2 {"1 f) + 3 = [: +/"1 f = [: |:
[: |. [: |: f) # f
g i.40
2
3
5
7
11
101
131
151
Linda
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of bill lam
Sent: Friday, October 16, 2015 2:05 AM
To: Programming forum
Subject: Re: [Jprogramming] Finding prime palindromes
IIRC J extended precision number implementation uses decimal base 1000 or
100000 , so that ": format is fast but calculation is slower. Things could
be the opposite if J had used 2^n base.
----------------------------------------------------------------------
For information about J forums see <http://www.jsoftware.com/forums.htm>
http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm