<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://so.v2.cs.unibo.it/wiki/index.php?action=history&amp;feed=atom&amp;title=Congettura_di_Goldbach</id>
	<title>Congettura di Goldbach - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://so.v2.cs.unibo.it/wiki/index.php?action=history&amp;feed=atom&amp;title=Congettura_di_Goldbach"/>
	<link rel="alternate" type="text/html" href="https://so.v2.cs.unibo.it/wiki/index.php?title=Congettura_di_Goldbach&amp;action=history"/>
	<updated>2026-05-21T10:18:22Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.5</generator>
	<entry>
		<id>https://so.v2.cs.unibo.it/wiki/index.php?title=Congettura_di_Goldbach&amp;diff=864&amp;oldid=prev</id>
		<title>Davide.boldrin: /* Soluzione di BoldrinD */</title>
		<link rel="alternate" type="text/html" href="https://so.v2.cs.unibo.it/wiki/index.php?title=Congettura_di_Goldbach&amp;diff=864&amp;oldid=prev"/>
		<updated>2014-12-08T16:11:51Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Soluzione di BoldrinD&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:11, 8 December 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l21&quot; &gt;Line 21:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 21:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;int valoreprimo=0;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;int valoreprimo=0;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;int valoresecondo=0;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;int valoresecondo=0;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;void calcolosecondo(int val);&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;int isprime(int a){&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;int isprime(int a){&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Davide.boldrin</name></author>
	</entry>
	<entry>
		<id>https://so.v2.cs.unibo.it/wiki/index.php?title=Congettura_di_Goldbach&amp;diff=863&amp;oldid=prev</id>
		<title>Davide.boldrin: Created page with &quot;Nel 1742 Christian Goldbach, un matematico amatoriale tedesco, scrisse una lettera a Leonardo Eulero, in cui fece la seguente congettura:  Ogni numero pari maggiore di 4 può ...&quot;</title>
		<link rel="alternate" type="text/html" href="https://so.v2.cs.unibo.it/wiki/index.php?title=Congettura_di_Goldbach&amp;diff=863&amp;oldid=prev"/>
		<updated>2014-12-08T16:09:34Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Nel 1742 Christian Goldbach, un matematico amatoriale tedesco, scrisse una lettera a Leonardo Eulero, in cui fece la seguente congettura:  Ogni numero pari maggiore di 4 può ...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Nel 1742 Christian Goldbach, un matematico amatoriale tedesco, scrisse una lettera a Leonardo Eulero, in cui fece la seguente congettura:&lt;br /&gt;
&lt;br /&gt;
Ogni numero pari maggiore di 4 può essere scritto &lt;br /&gt;
come la somma di due numeri primi dispari.&lt;br /&gt;
Per esempio:&lt;br /&gt;
&lt;br /&gt;
8 = 3 + 5. Sia 3 che 5 sono numeri primi dispari.&lt;br /&gt;
&lt;br /&gt;
20 = 3 + 17 = 7 + 13.&lt;br /&gt;
&lt;br /&gt;
42 = 5 + 37 = 11 + 31 = 13 + 29 = 19 + 23.&lt;br /&gt;
&lt;br /&gt;
Ad oggi non si sa ancora se la congettura sia corretta.&lt;br /&gt;
&lt;br /&gt;
==Soluzione di BoldrinD==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;math.h&amp;gt;&lt;br /&gt;
int valoreinput=0;&lt;br /&gt;
int valoreprimo=0;&lt;br /&gt;
int valoresecondo=0;&lt;br /&gt;
&lt;br /&gt;
void calcolosecondo(int val);&lt;br /&gt;
&lt;br /&gt;
int isprime(int a){&lt;br /&gt;
&lt;br /&gt;
	if (!(a % 2)) return 0;&lt;br /&gt;
	int i;&lt;br /&gt;
	for (i = 3; i &amp;lt;= ((a/2)+1); i +=2)&lt;br /&gt;
	if (!(a % i))&lt;br /&gt;
	return 0;&lt;br /&gt;
	return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int calcoloprimo(int val){&lt;br /&gt;
	int trovato=0;&lt;br /&gt;
	&lt;br /&gt;
	while(trovato==0){&lt;br /&gt;
	val--;&lt;br /&gt;
	trovato = isprime(val);&lt;br /&gt;
&lt;br /&gt;
	if (trovato==1){&lt;br /&gt;
		valoreprimo=val;&lt;br /&gt;
		break;&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		calcoloprimo(val);&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
int valoresecondo = valoreinput-valoreprimo;&lt;br /&gt;
&lt;br /&gt;
int trovatosec=0;&lt;br /&gt;
	trovatosec = isprime(valoresecondo);&lt;br /&gt;
	if(trovatosec==1 &amp;amp;&amp;amp; valoreprimo+valoresecondo == valoreinput &amp;amp;&amp;amp; valoresecondo!=1){	&lt;br /&gt;
		return valoresecondo;&lt;br /&gt;
	&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		calcoloprimo(valoreprimo);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]){&lt;br /&gt;
&lt;br /&gt;
valoreinput = atoi(argv[1]);&lt;br /&gt;
valoresecondo=calcoloprimo(valoreinput);&lt;br /&gt;
printf(&amp;quot;%d\n&amp;quot;,valoreprimo);&lt;br /&gt;
printf(&amp;quot;%d\n&amp;quot;,valoresecondo);		&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Il codice è privo di alcuni controlli sull'input, si assume che il valore dato in input sia pari e &amp;gt;=4.&lt;br /&gt;
il problema???? dopo essere arrivati all'input 2996, il costo dell'esecuzione diventa eccessivo.&lt;/div&gt;</summary>
		<author><name>Davide.boldrin</name></author>
	</entry>
</feed>