Skip to content

Latest commit

 

History

History
39 lines (20 loc) · 488 Bytes

is-prime.md

File metadata and controls

39 lines (20 loc) · 488 Bytes

Primitive Primality Test

Checks if the input is a prime in [1..37].


btcdeb "[
	
	OP_DUP

	OP_DUP 2 OP_NUMEQUAL OP_SUB

	OP_DUP 3 OP_NUMEQUAL OP_SUB

	OP_DUP 5 OP_NUMEQUAL OP_SUB

	OP_DUP 7 OP_NUMEQUAL OP_SUB

	OP_DUP 11 OP_NUMEQUAL OP_SUB

	OP_DUP 13 OP_NUMEQUAL OP_SUB

	OP_DUP 17 OP_NUMEQUAL OP_SUB

	OP_DUP 19 OP_NUMEQUAL OP_SUB

	OP_DUP 23 OP_NUMEQUAL OP_SUB

	OP_DUP 29 OP_NUMEQUAL OP_SUB

	OP_DUP 31 OP_NUMEQUAL OP_SUB

	OP_DUP 37 OP_NUMEQUAL OP_SUB

	OP_SUB

]" 13