ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 29 Mar 2013 09:43:14 +0100Table of primeshttps://ask.sagemath.org/question/9939/table-of-primes/Hello,
I'm trying to create a table (or matrix, what comes first) with the first rank is the primes_range from 2 to 29 and the first column with primes_range from 2 to 29 too.
Then, I want to add i[0] + j[0] = element 4 using the values above.
The reason for that is that I want to create a table of even elements based on Goldbach conjecture that says that an even is the sum of two equal (or different) primes:
4 = 2 + 2
6 = 3 + 3
8 = 3 + 5
The problem is that an even number can be written in several ways, example:
24 = 5 + 19
24 = 7 + 17
24 = 11 + 13 and so on..
The number 200 = 3 + 197 . So, my problem is to 'remember' in a for/loop the number 3. When I'm close to the even 200 the number variable that holds the first prime is far away from 3.
So, I think the solution maybe can be a combination or a value table or a matrix.
Thank you in advance.
P.S.: This is not a homework.Sat, 23 Mar 2013 16:44:58 +0100https://ask.sagemath.org/question/9939/table-of-primes/Comment by Luiz Roberto Meier for <p>Hello,</p>
<p>I'm trying to create a table (or matrix, what comes first) with the first rank is the primes_range from 2 to 29 and the first column with primes_range from 2 to 29 too. </p>
<p>Then, I want to add i[0] + j[0] = element 4 using the values above.</p>
<p>The reason for that is that I want to create a table of even elements based on Goldbach conjecture that says that an even is the sum of two equal (or different) primes:</p>
<p>4 = 2 + 2
6 = 3 + 3
8 = 3 + 5</p>
<p>The problem is that an even number can be written in several ways, example:</p>
<p>24 = 5 + 19
24 = 7 + 17
24 = 11 + 13 and so on..</p>
<p>The number 200 = 3 + 197 . So, my problem is to 'remember' in a for/loop the number 3. When I'm close to the even 200 the number variable that holds the first prime is far away from 3.</p>
<p>So, I think the solution maybe can be a combination or a value table or a matrix.</p>
<p>Thank you in advance.</p>
<p>P.S.: This is not a homework.</p>
https://ask.sagemath.org/question/9939/table-of-primes/?comment=18011#post-id-18011You can think about it as a group too. But, forget. I can learn it alone without your funny help.Wed, 27 Mar 2013 00:09:09 +0100https://ask.sagemath.org/question/9939/table-of-primes/?comment=18011#post-id-18011Comment by fidbc for <p>Hello,</p>
<p>I'm trying to create a table (or matrix, what comes first) with the first rank is the primes_range from 2 to 29 and the first column with primes_range from 2 to 29 too. </p>
<p>Then, I want to add i[0] + j[0] = element 4 using the values above.</p>
<p>The reason for that is that I want to create a table of even elements based on Goldbach conjecture that says that an even is the sum of two equal (or different) primes:</p>
<p>4 = 2 + 2
6 = 3 + 3
8 = 3 + 5</p>
<p>The problem is that an even number can be written in several ways, example:</p>
<p>24 = 5 + 19
24 = 7 + 17
24 = 11 + 13 and so on..</p>
<p>The number 200 = 3 + 197 . So, my problem is to 'remember' in a for/loop the number 3. When I'm close to the even 200 the number variable that holds the first prime is far away from 3.</p>
<p>So, I think the solution maybe can be a combination or a value table or a matrix.</p>
<p>Thank you in advance.</p>
<p>P.S.: This is not a homework.</p>
https://ask.sagemath.org/question/9939/table-of-primes/?comment=18026#post-id-18026What is the question?Sat, 23 Mar 2013 18:11:32 +0100https://ask.sagemath.org/question/9939/table-of-primes/?comment=18026#post-id-18026Comment by DSM for <p>Hello,</p>
<p>I'm trying to create a table (or matrix, what comes first) with the first rank is the primes_range from 2 to 29 and the first column with primes_range from 2 to 29 too. </p>
<p>Then, I want to add i[0] + j[0] = element 4 using the values above.</p>
<p>The reason for that is that I want to create a table of even elements based on Goldbach conjecture that says that an even is the sum of two equal (or different) primes:</p>
<p>4 = 2 + 2
6 = 3 + 3
8 = 3 + 5</p>
<p>The problem is that an even number can be written in several ways, example:</p>
<p>24 = 5 + 19
24 = 7 + 17
24 = 11 + 13 and so on..</p>
<p>The number 200 = 3 + 197 . So, my problem is to 'remember' in a for/loop the number 3. When I'm close to the even 200 the number variable that holds the first prime is far away from 3.</p>
<p>So, I think the solution maybe can be a combination or a value table or a matrix.</p>
<p>Thank you in advance.</p>
<p>P.S.: This is not a homework.</p>
https://ask.sagemath.org/question/9939/table-of-primes/?comment=17993#post-id-17993@LuizRobertoMeier: I deleted your insulting comment. When everyone else except you is finding you unclear, you might want to consider the possibility that it's not that everyone except you is an idiot, it's that you've been more ambiguous than you think. Fri, 29 Mar 2013 09:43:14 +0100https://ask.sagemath.org/question/9939/table-of-primes/?comment=17993#post-id-17993Comment by fidbc for <p>Hello,</p>
<p>I'm trying to create a table (or matrix, what comes first) with the first rank is the primes_range from 2 to 29 and the first column with primes_range from 2 to 29 too. </p>
<p>Then, I want to add i[0] + j[0] = element 4 using the values above.</p>
<p>The reason for that is that I want to create a table of even elements based on Goldbach conjecture that says that an even is the sum of two equal (or different) primes:</p>
<p>4 = 2 + 2
6 = 3 + 3
8 = 3 + 5</p>
<p>The problem is that an even number can be written in several ways, example:</p>
<p>24 = 5 + 19
24 = 7 + 17
24 = 11 + 13 and so on..</p>
<p>The number 200 = 3 + 197 . So, my problem is to 'remember' in a for/loop the number 3. When I'm close to the even 200 the number variable that holds the first prime is far away from 3.</p>
<p>So, I think the solution maybe can be a combination or a value table or a matrix.</p>
<p>Thank you in advance.</p>
<p>P.S.: This is not a homework.</p>
https://ask.sagemath.org/question/9939/table-of-primes/?comment=18015#post-id-18015It is more or less clear what you want to achieve. You just didn't state an explicit question.
Is it about how to create a [matrix](http://www.sagemath.org/doc/reference/matrices/sage/matrix/constructor.html)?
Is it about how to generate lists of [prime](http://combinat.sagemath.org/doc/reference/misc/sage/rings/arith.html#sage.rings.arith.primes) numbers?
What do you mean by shape or color? I'm starting to think a python dict might suit your purposes better.Mon, 25 Mar 2013 10:04:49 +0100https://ask.sagemath.org/question/9939/table-of-primes/?comment=18015#post-id-18015Comment by Luiz Roberto Meier for <p>Hello,</p>
<p>I'm trying to create a table (or matrix, what comes first) with the first rank is the primes_range from 2 to 29 and the first column with primes_range from 2 to 29 too. </p>
<p>Then, I want to add i[0] + j[0] = element 4 using the values above.</p>
<p>The reason for that is that I want to create a table of even elements based on Goldbach conjecture that says that an even is the sum of two equal (or different) primes:</p>
<p>4 = 2 + 2
6 = 3 + 3
8 = 3 + 5</p>
<p>The problem is that an even number can be written in several ways, example:</p>
<p>24 = 5 + 19
24 = 7 + 17
24 = 11 + 13 and so on..</p>
<p>The number 200 = 3 + 197 . So, my problem is to 'remember' in a for/loop the number 3. When I'm close to the even 200 the number variable that holds the first prime is far away from 3.</p>
<p>So, I think the solution maybe can be a combination or a value table or a matrix.</p>
<p>Thank you in advance.</p>
<p>P.S.: This is not a homework.</p>
https://ask.sagemath.org/question/9939/table-of-primes/?comment=18016#post-id-18016I want to create a matrix of prime elements starting, say, from 2 up to 197 OR a matrix of elements starting from 2 up to 200 where the elements that are primes have another shape or color. If you don't understand I can DRAW it to you. Thank you.Mon, 25 Mar 2013 09:03:52 +0100https://ask.sagemath.org/question/9939/table-of-primes/?comment=18016#post-id-18016Comment by vdelecroix for <p>Hello,</p>
<p>I'm trying to create a table (or matrix, what comes first) with the first rank is the primes_range from 2 to 29 and the first column with primes_range from 2 to 29 too. </p>
<p>Then, I want to add i[0] + j[0] = element 4 using the values above.</p>
<p>The reason for that is that I want to create a table of even elements based on Goldbach conjecture that says that an even is the sum of two equal (or different) primes:</p>
<p>4 = 2 + 2
6 = 3 + 3
8 = 3 + 5</p>
<p>The problem is that an even number can be written in several ways, example:</p>
<p>24 = 5 + 19
24 = 7 + 17
24 = 11 + 13 and so on..</p>
<p>The number 200 = 3 + 197 . So, my problem is to 'remember' in a for/loop the number 3. When I'm close to the even 200 the number variable that holds the first prime is far away from 3.</p>
<p>So, I think the solution maybe can be a combination or a value table or a matrix.</p>
<p>Thank you in advance.</p>
<p>P.S.: This is not a homework.</p>
https://ask.sagemath.org/question/9939/table-of-primes/?comment=17995#post-id-17995There is no place for insult here. Moreover with somebody who tries to help and knows Sage much better than you ! As fidelbc said before : there is no question in your post and your aim is unclear.Fri, 29 Mar 2013 08:30:01 +0100https://ask.sagemath.org/question/9939/table-of-primes/?comment=17995#post-id-17995Answer by vdelecroix for <p>Hello,</p>
<p>I'm trying to create a table (or matrix, what comes first) with the first rank is the primes_range from 2 to 29 and the first column with primes_range from 2 to 29 too. </p>
<p>Then, I want to add i[0] + j[0] = element 4 using the values above.</p>
<p>The reason for that is that I want to create a table of even elements based on Goldbach conjecture that says that an even is the sum of two equal (or different) primes:</p>
<p>4 = 2 + 2
6 = 3 + 3
8 = 3 + 5</p>
<p>The problem is that an even number can be written in several ways, example:</p>
<p>24 = 5 + 19
24 = 7 + 17
24 = 11 + 13 and so on..</p>
<p>The number 200 = 3 + 197 . So, my problem is to 'remember' in a for/loop the number 3. When I'm close to the even 200 the number variable that holds the first prime is far away from 3.</p>
<p>So, I think the solution maybe can be a combination or a value table or a matrix.</p>
<p>Thank you in advance.</p>
<p>P.S.: This is not a homework.</p>
https://ask.sagemath.org/question/9939/table-of-primes/?answer=14704#post-id-14704I am not sure what is your aim, but the function prime_range returns you a list of the prime integers below a given bound
sage: prime_range(20)
[2, 3, 5, 7, 11, 13, 17, 19]
sage: prime_range(50)
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]Fri, 29 Mar 2013 08:33:48 +0100https://ask.sagemath.org/question/9939/table-of-primes/?answer=14704#post-id-14704