; Seek primes in arithmetic sequence a + n*b. ; http://cap-lore.com/code/mult/ff.txt (lambda (a b)(let* ( (mod-exp (lambda (b p m) (let me ((p p))(cond ((= p 0) 1) ((even? p)(let ((x (me (/ p 2))))(modulo (* x x) m))) (#t (modulo (* b (me (- p 1))) m)))))) (pt (lambda (a n) (or (= n 2) ; Miller-Rabin (let* ((nm1 (- n 1))(pr (let z ((q nm1)(k 0))(if (odd? q)(cons q k) (z (/ q 2)(+ k 1))))) (d (car pr))(s (cdr pr))) (let lp ((r 0)(y (mod-exp a d n))) (or (and (= r 0)(= y 1)) (= y nm1) (and (< (+ r 1) s)(lp (+ r 1)(modulo (* y y) n))))))))) (ww (lambda(n x)(display (list n x)) x)) (g (gcd a b))(n (modulo b 30030)) (random ((((fileVal "RC4") "ijos") 'rbi) (+ a (if (positive? b) 0 (* 2000 b))))) (probe (+ 1 (random)))) (if (> g 1) (list "Always divisible by" g) (let more ((a1 a)(m (modulo a 30030))(cn 0)) (if (and (let all ((l (list 2 3 5 7 11 13)))(or (null? l) (and (positive? (remainder m (car l))) (all (cdr l))))) (let all ((l 20)(p probe)) (or (zero? l) (and (ww cn (pt p a1)) (all (- l 1)(+ 1 (random))))))) a1 (begin (display ",")(more (+ a1 b)(modulo (+ m n) 30030)(+ cn 1))))))))