summaryrefslogtreecommitdiff
path: root/problem27.ijs
diff options
context:
space:
mode:
Diffstat (limited to 'problem27.ijs')
-rw-r--r--problem27.ijs16
1 files changed, 16 insertions, 0 deletions
diff --git a/problem27.ijs b/problem27.ijs
new file mode 100644
index 0000000..f4d5d47
--- /dev/null
+++ b/problem27.ijs
@@ -0,0 +1,16 @@
+seq =: dyad define "0
+ n =. 0
+ primes =. 0
+ while. 1 p: y+(n*x)+n*n do.
+ n =. n+1
+ primes =. primes+1
+ end.
+ primes
+)
+
+max =: 1000
+range =: max-~i.>:max*2
+tab =: seq/~range
+rowIx =: {. \: >./"1 tab
+colIx =: {. \: rowIx { tab
+problem27 =: */range{~rowIx,colIx