Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. When (or not) did you learn about the Sieve of Eratosthenes

When (or not) did you learn about the Sieve of Eratosthenes

Scheduled Pinned Locked Moved The Lounge
javascriptpythoncomalgorithmsquestion
23 Posts 18 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Gary Wheeler

    I never saw it in high school or college. Of course, that was back before Eratosthenes was even born. We did computing on punch cards made from antelope skin where we punched the holes using an awl made from the jawbone of a yak. You don't even want to know what it was like when the reader jammed...

    Software Zen: delete this;

    D Offline
    D Offline
    Daniel Pfeffer
    wrote on last edited by
    #9

    Gary Wheeler wrote:

    You don't even want to know what it was like when the reader jammed...

    Where did you get the jam? Surely this was BS (Before Supermarkets)

    Ad astra - both ways!

    G 1 Reply Last reply
    0
    • M Maximilien

      I just had to google it. That means something, no ?

      I'd rather be phishing!

      D Offline
      D Offline
      Daniel Pfeffer
      wrote on last edited by
      #10

      It means that your knowledge of the Classics could be better...

      Ad astra - both ways!

      1 Reply Last reply
      0
      • OriginalGriffO OriginalGriff

        School I think, certainly well before I met my first computer, or even programmable calculator!

        Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!

        D Offline
        D Offline
        Daniel Pfeffer
        wrote on last edited by
        #11

        Ditto. IIRC, this was not long after we learnt division.

        Ad astra - both ways!

        1 Reply Last reply
        0
        • M Marc Clifton

          Was it in a computer class in high school or college? Did you implement an algorithm? [Sieve of Eratosthenes - Wikipedia](https://en.wikipedia.org/wiki/Sieve\_of\_Eratosthenes) I actually first learned about it from my father when I was 10 or so, and worked it out on paper, haha, for the first 100 or so.

          Latest Article - Building a Prototype Web-Based Diagramming Tool with SVG and Javascript Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #12

          Hmmm, I don't know but for many years from around ~1997-2004 I had about a dozen workstations running the distributed GIMPS client[^]. Best Wishes, -David Delaune

          1 Reply Last reply
          0
          • M Marc Clifton

            Was it in a computer class in high school or college? Did you implement an algorithm? [Sieve of Eratosthenes - Wikipedia](https://en.wikipedia.org/wiki/Sieve\_of\_Eratosthenes) I actually first learned about it from my father when I was 10 or so, and worked it out on paper, haha, for the first 100 or so.

            Latest Article - Building a Prototype Web-Based Diagramming Tool with SVG and Javascript Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

            Kornfeld Eliyahu PeterK Offline
            Kornfeld Eliyahu PeterK Offline
            Kornfeld Eliyahu Peter
            wrote on last edited by
            #13

            Ages ago in school. I remember it was among the first algorithm we implemented when the new Commodore Plus/4 computers arrived at school... After the VIC 20 it was a huge improvement, so we did a lot of graphical presentations of anything in math and physics... But then I got my personal C64...

            "The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge". Stephen Hawking, 1942- 2018

            "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

            1 Reply Last reply
            0
            • M Marc Clifton

              Was it in a computer class in high school or college? Did you implement an algorithm? [Sieve of Eratosthenes - Wikipedia](https://en.wikipedia.org/wiki/Sieve\_of\_Eratosthenes) I actually first learned about it from my father when I was 10 or so, and worked it out on paper, haha, for the first 100 or so.

              Latest Article - Building a Prototype Web-Based Diagramming Tool with SVG and Javascript Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

              C Offline
              C Offline
              CPallini
              wrote on last edited by
              #14

              Eratosthenes told me when I was a little child. However I didn't pay attention to him, playing with marbles was far more fun.

              P 1 Reply Last reply
              0
              • C CPallini

                Eratosthenes told me when I was a little child. However I didn't pay attention to him, playing with marbles was far more fun.

                P Offline
                P Offline
                PIEBALDconsult
                wrote on last edited by
                #15

                And now you've lost your marbles as well?

                C 1 Reply Last reply
                0
                • P PIEBALDconsult

                  And now you've lost your marbles as well?

                  C Offline
                  C Offline
                  CPallini
                  wrote on last edited by
                  #16

                  I miss them.

                  1 Reply Last reply
                  0
                  • M Marc Clifton

                    Was it in a computer class in high school or college? Did you implement an algorithm? [Sieve of Eratosthenes - Wikipedia](https://en.wikipedia.org/wiki/Sieve\_of\_Eratosthenes) I actually first learned about it from my father when I was 10 or so, and worked it out on paper, haha, for the first 100 or so.

                    Latest Article - Building a Prototype Web-Based Diagramming Tool with SVG and Javascript Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                    D Offline
                    D Offline
                    dan sh
                    wrote on last edited by
                    #17

                    About 4 of years back while solving Project Euler problems. I ended up writing this: public class NthPrimeNumber { public string GetNumber() { long number = 0; // All prime numbers are denoted by 6n+1 or 6n-1 format. So, assumming for // 10001st number, n is 100000 (in fact it will be lesser than this) bool[] isComposite = new bool[1000002]; // Since this method will find more than 10001 prime numbers, track how many have been // found already and once we have 10001 as the count, stop int primeNumberCount = 0; int upperBoundRoot = (int)Math.Sqrt(1000001); for (int i = 2; i <= upperBoundRoot; i++) { if (!isComposite[i]) { primeNumberCount++; if (primeNumberCount == 10001) { number = i; break; } for (int k = i * i; k <= 1000001; k += i) isComposite[k] = true; } } // if the count is not 10001 yet, there are more numbers to find for (int i = upperBoundRoot; i < 1000001; i++) { if (!isComposite[i]) { primeNumberCount++; if (primeNumberCount == 10001) { number = i; break; } } } return number.ToString(); } }

                    "It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]

                    1 Reply Last reply
                    0
                    • M Marc Clifton

                      Was it in a computer class in high school or college? Did you implement an algorithm? [Sieve of Eratosthenes - Wikipedia](https://en.wikipedia.org/wiki/Sieve\_of\_Eratosthenes) I actually first learned about it from my father when I was 10 or so, and worked it out on paper, haha, for the first 100 or so.

                      Latest Article - Building a Prototype Web-Based Diagramming Tool with SVG and Javascript Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                      A Offline
                      A Offline
                      Alexander DiMauro
                      wrote on last edited by
                      #18

                      Learned it in Math class. I'm way too old to remember when exactly. :sigh:

                      The world is going to laugh at you anyway, might as well crack the 1st joke! My code has no bugs, it runs exactly as it was written.

                      1 Reply Last reply
                      0
                      • D Daniel Pfeffer

                        Gary Wheeler wrote:

                        You don't even want to know what it was like when the reader jammed...

                        Where did you get the jam? Surely this was BS (Before Supermarkets)

                        Ad astra - both ways!

                        G Offline
                        G Offline
                        Gary Wheeler
                        wrote on last edited by
                        #19

                        The reader was a wooly mammoth in a perpetually bad mood.

                        Software Zen: delete this;

                        1 Reply Last reply
                        0
                        • M Marc Clifton

                          Was it in a computer class in high school or college? Did you implement an algorithm? [Sieve of Eratosthenes - Wikipedia](https://en.wikipedia.org/wiki/Sieve\_of\_Eratosthenes) I actually first learned about it from my father when I was 10 or so, and worked it out on paper, haha, for the first 100 or so.

                          Latest Article - Building a Prototype Web-Based Diagramming Tool with SVG and Javascript Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                          S Offline
                          S Offline
                          sandyson
                          wrote on last edited by
                          #20

                          5th grade math class (1964) what's a computer class? I liked it so much that I would do it to 100 on a blank sheet during idle moments. My other numbers game was doubling from 1 to get powers of 2. That would have been a couple of years earlier.

                          In theory, theory agrees perfectly with practice. In practice, this is virtually never the case. "*the {VOiCE} says: The truth is analog - not digital." - jonathan HICKMAN

                          1 Reply Last reply
                          0
                          • M Marc Clifton

                            Was it in a computer class in high school or college? Did you implement an algorithm? [Sieve of Eratosthenes - Wikipedia](https://en.wikipedia.org/wiki/Sieve\_of\_Eratosthenes) I actually first learned about it from my father when I was 10 or so, and worked it out on paper, haha, for the first 100 or so.

                            Latest Article - Building a Prototype Web-Based Diagramming Tool with SVG and Javascript Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                            V Offline
                            V Offline
                            ventureaaron
                            wrote on last edited by
                            #21

                            I learned about the Sieve of Eratosthenes in my naive past after i thought i had come up with a novel approach at finding primes since you could use part of this sieve approach to compute primes in parallel (don't get me started). When i found out it was just a modified version of his sieve I fell into depression and never tried to do anything novel again. J/K...but seriously.

                            1 Reply Last reply
                            0
                            • M Marc Clifton

                              Was it in a computer class in high school or college? Did you implement an algorithm? [Sieve of Eratosthenes - Wikipedia](https://en.wikipedia.org/wiki/Sieve\_of\_Eratosthenes) I actually first learned about it from my father when I was 10 or so, and worked it out on paper, haha, for the first 100 or so.

                              Latest Article - Building a Prototype Web-Based Diagramming Tool with SVG and Javascript Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                              T Offline
                              T Offline
                              TrinityRaven
                              wrote on last edited by
                              #22

                              From Carl Sagan's Cosmos (original version)

                              1 Reply Last reply
                              0
                              • M Marc Clifton

                                Was it in a computer class in high school or college? Did you implement an algorithm? [Sieve of Eratosthenes - Wikipedia](https://en.wikipedia.org/wiki/Sieve\_of\_Eratosthenes) I actually first learned about it from my father when I was 10 or so, and worked it out on paper, haha, for the first 100 or so.

                                Latest Article - Building a Prototype Web-Based Diagramming Tool with SVG and Javascript Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                                K Offline
                                K Offline
                                Kirk 10389821
                                wrote on last edited by
                                #23

                                So, why did I learn to read more... I was interested in Prime Numbers since I was a kid. When I got my first PC, I decided to write a problem to spin through prime numbers. And I came up with this TOTALLY UNIQUE Idea. Once ANY number becomes prime, all future multiples of that number are no longer prime. (2 being the best example, eliminate every even number in the future) So every number that is not already a multiple of a prime is then prime, etc. And I wrote this, and was amazed that I was able to find primes without division! Mind you: I wrote software to check most of my theory of matrices homework, and Diff Eq stuff... (Because a monochrome computer screen was not good for much else, LOL) So, I explain what I built to my lab partner in crime at University, and he says "Oh, you implemented the Sieve of Eratosthenes..." I was crushed. Then I was excited... (I am only a couple of thousand years behind the greeks... I can catch up)... Then I was crushed... (I had classes). Ah, the good old days...

                                1 Reply Last reply
                                0
                                Reply
                                • Reply as topic
                                Log in to reply
                                • Oldest to Newest
                                • Newest to Oldest
                                • Most Votes


                                • Login

                                • Don't have an account? Register

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • World
                                • Users
                                • Groups