;redcode ;name PNF 3 ;author Mintardjo W. s1 equ 16 s2 equ s1 copy equ (input - 1) out equ (copy - 1) posn equ (out - s1 - 1) ; this holds the current prime number i equ (input - 25) j equ (i + 4000) prime equ (i - 1) ; this holds the first prime number dst equ (last + s1) src equ (dst + 1) sdst equ (src + s1) input dat #-3 ; please put input here nprime dat #prime ;start jmz last, input ;trace start mov #2, prime ; the first prime starts with 2 ;trace off mov #1, posn ; the next starts with 3 - 2. -2 for adjustment ; mov #0, out mark0 mov #s1, src mov @nprime, input) loop1 add @src, @dst slt @dst, @src djn loop1, copy slt @dst, @src ; check for overflow djn fill, src ; and src should be decremented as well mov #0, @dst ; mark the max number at the end mov input, copy ; do not alter the input value at input variable mov #s1+(sdst-dst), dst loop2 mov #0, sdst loop3 slt copy, 0 then reiterate loop4 sub @dst, 0 ; negate the negative exp number add @nprime,