159 lines
6.5 KiB
Text
159 lines
6.5 KiB
Text
document weave order 0
|
|
head banner <Weave of 'Summing Primes' generated by Inweb>
|
|
body
|
|
chapter <Sections>
|
|
chapter header <Sections>
|
|
section <Summing Primes>
|
|
section header <Summing Primes>
|
|
section purpose <Here we verify the conjecture for small numbers.>
|
|
paragraph P1
|
|
material discussion
|
|
commentary <So, this is a program to see if even numbers from 4 to 100 can all be written\n>
|
|
commentary <as a sum of two primes. Christian Goldbach asked Euler in 1742 if every even\n>
|
|
commentary <number greater than 2 can be written this way. This remains open, though --\n>
|
|
item depth 1 label <a>
|
|
commentary <every even number is a sum of at most six primes (Ramaré, 1995), and\n>
|
|
item depth 1 label <b>
|
|
commentary <every odd number is a sum of at most five (Tao, 2012).\n>
|
|
vskip (in comment)
|
|
commentary <Besides which, >
|
|
inline
|
|
source_code <printf(k+1)>
|
|
_xxxxxxxxxxx_
|
|
commentary <, to say the least: see >
|
|
url content <http://www.google.com> url <http://www.google.com>
|
|
commentary <\n>
|
|
commentary <or for that matter see >
|
|
url content <The Sieve of Eratosthenes> url <S-tsoe.html>
|
|
commentary <.\n>
|
|
figure <Letter.jpg> -1 by 720
|
|
vskip (in comment)
|
|
commentary <Computer verification has been made up to around >
|
|
mathematics <10^{18}>
|
|
commentary <, but by rather better\n>
|
|
commentary <methods.>
|
|
footnote_cue [1]
|
|
commentary < Which is awesome.>
|
|
footnote_cue [2]
|
|
commentary < And >
|
|
mathematics <i<j>
|
|
commentary <, that's for sure.\n>
|
|
mathematics < \int_0^1 \cos x {\rm d}x > (displayed)
|
|
commentary <\n>
|
|
commentary <Which is really the point.\n>
|
|
material footnotes
|
|
footnote [1]
|
|
footnote_cue [1]
|
|
commentary < And don't just take my word for it.\n>
|
|
footnote [2]
|
|
footnote_cue [2]
|
|
commentary < Really!\n>
|
|
paragraph P2
|
|
material discussion
|
|
commentary <And now...\n>
|
|
carousel slide caption <This is numero 1>
|
|
figure <img1.jpg> -1 by -1
|
|
carousel slide caption <>
|
|
figure <img2.jpg> -1 by -1
|
|
carousel slide caption <So, this is a program to see if even numbers from 4 to 100 can all be written as a sum of two primes. Christian Goldbach asked Euler in 1742 if every even number greater than 2 can be written this way.>
|
|
figure <img3.jpg> -1 by -1
|
|
vskip (in comment)
|
|
commentary <So there, really!\n>
|
|
paragraph P3
|
|
material definition
|
|
code line
|
|
defn <define>
|
|
source_code <RANGE 100>
|
|
_nnnnnpnnn_
|
|
material code: C
|
|
code line
|
|
source_code <#include <stdio.h>>
|
|
_piiiiiiippiiiiipip_
|
|
vskip
|
|
code line
|
|
source_code <int main(int argc, char *argv[]) {>
|
|
_rrrpffffprrrpiiiipprrrrppiiiippppp_
|
|
code line
|
|
source_code < for (int i=4; i<RANGE; i=i+2) >
|
|
_pppprrrpprrrpippppipnnnnnppipipppp_
|
|
commentary < stepping in twos to stay even> (code)
|
|
code line
|
|
source_code < >
|
|
_pppppppp_
|
|
pmac <Solve Goldbach's conjecture for i>
|
|
source_code <;>
|
|
_c_
|
|
code line
|
|
source_code <}>
|
|
_c_
|
|
paragraph P3.1
|
|
material discussion
|
|
commentary <This ought to print:\n>
|
|
material code: ConsoleText
|
|
code line
|
|
source_code < $ goldbach/Tangled/goldbach -fish 1>
|
|
_ppppepfffffffffffffffffffffffffiiiiiipp_
|
|
code line
|
|
source_code < 4 = 2+2>
|
|
_ppppppppppp_
|
|
code line
|
|
source_code < 6 = 3+3 >
|
|
_pppppppppppppp_
|
|
url content <https://www.wikipedia.org> url <https://www.wikipedia.org>
|
|
code line
|
|
source_code < 8 = 3+5>
|
|
_ppppppppppp_
|
|
code line
|
|
source_code < 10 = 3+7 = 5+5>
|
|
_pppppppppppppppppp_
|
|
code line
|
|
source_code < 12 = 5+7>
|
|
_pppppppppppp_
|
|
code line
|
|
source_code < 14 = 3+11 = 7+7>
|
|
_ppppppppppppppppppp_
|
|
code line
|
|
source_code < ...>
|
|
_ppppppp_
|
|
material discussion
|
|
commentary <We'll print each different pair of primes adding up to i. We\n>
|
|
commentary <only check in the range >
|
|
mathematics <2 \leq j \leq i/2>
|
|
commentary < to avoid counting pairs\n>
|
|
commentary <twice over (thus >
|
|
mathematics <8 = 3+5 = 5+3>
|
|
commentary <, but that's hardly two different ways).\n>
|
|
material paragraph macro
|
|
code line
|
|
pmac <Solve Goldbach's conjecture for i> (definition)
|
|
material code: C
|
|
code line
|
|
source_code < printf("%d", i);>
|
|
_ppppiiiiiipssssppipp_
|
|
code line
|
|
source_code < for (int j=2; j<=i/2; j++)>
|
|
_pppprrrpprrrpippppippippppippp_
|
|
code line
|
|
source_code < if ((>
|
|
_pppppppprrppp_
|
|
function usage <isprime>
|
|
source_code <(j)) && (>
|
|
_pippppppp_
|
|
function usage <isprime>
|
|
source_code <(i-j)))>
|
|
_pipippp_
|
|
code line
|
|
source_code < printf(" = %d+%d", j, i-j);>
|
|
_ppppppppppppiiiiiipssssssssssppippipipp_
|
|
code line
|
|
source_code < printf("\n");>
|
|
_ppppiiiiiipsssspp_
|
|
material endnotes
|
|
endnote
|
|
commentary <This code is >
|
|
commentary <used in >
|
|
locale P3
|
|
commentary <.>
|
|
section footer <Summing Primes>
|
|
chapter footer <Sections>
|
|
tail rennab <End of weave>
|