aboutsummaryrefslogtreecommitdiffhomepage
path: root/samples/fun/goldbach.bruijn
blob: feaf1ee15a6e35d29e0d32b31c7775ba26af49bd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Tromp's version, will reduce to [0] iff Goldbach conjecture is false

:import std/Combinator .

zero [[1]]

one [[0]]

sieve y [[[0 one (2 sn1 f)]]]
	f y [sn2 0]
		sn2 [[0 (0 4 1)] [[[[0 2 (1 3)]]]]]
	sn1 [[0 (0 3 1)] [[[[0 2 (1 3)]]]]]

zeroS [[[[0 zero (1 3)]]]]

primes sieve zeroS

check y [[[[[primes 0 (1 (4 0))] testp1]]]]
	testp1 [0 0 2 [0 4] 0]

main [primes (check [[[[0]]]])]