Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 1021

Chapter 1 - Introduction

The procedure below produces the table on page 2. See Chapter 5 for information about the mod operation.

P=primes_first_n(100001) S=[] T=[3] tbl=[] for m in [0..4]: for k in [10^m+1..10^(m+1)]: if mod(P[k],4)==1: S.append(P[k]) else: T.append(P[k]) tbl.append([len(S),len(T)]) table([(10^(m+1),tbl[m][0],tbl[m][1]) for m in [0..4]], header_row=["n", "primes of the form 4k+1","primes of the form 4k+3"], frame=True)
+--------+-------------------------+-------------------------+ | n | primes of the form 4k+1 | primes of the form 4k+3 | +========+=========================+=========================+ | 10 | 4 | 6 | +--------+-------------------------+-------------------------+ | 100 | 47 | 53 | +--------+-------------------------+-------------------------+ | 1000 | 495 | 505 | +--------+-------------------------+-------------------------+ | 10000 | 4984 | 5016 | +--------+-------------------------+-------------------------+ | 100000 | 49950 | 50050 | +--------+-------------------------+-------------------------+