summaryrefslogtreecommitdiff
path: root/problem27.ijs
blob: f4d5d472f4f7104cf131fc27ee9b46628d02af4a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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