Login
Forgot Password?

OR

Login with Google Login with Twitter Login with Facebook
  • Join
  • Profiles
  • Groups
  • SuicideGirls
  • Photos
  • Videos
  • Shop
Vital Stats

magni

Member Since 2004

Followers 126 Following 194

  • Everything
  • Photos
  • Video
  • Blogs
  • Groups
  • From Others

Sunday Apr 02, 2006

Apr 2, 2006
0
  • Facebook
  • Tweet
  • Email
Can anyone write a nested loop that uses only the conditions of the loop and one line of code within each loop (okay maybe two in the outer loop, one for iteration one for reassignment) that uses the Sieve of Eratosthenes to calculate the highest prime number less than x and stop there?

No arrays and no excessive flags. Just loop conditions.

umm unna quit trying soon. um too dumm.

bok bok bok bok bok bok bok bok bok bok bok bok bok bok bok bok bok bok bok bok bok bok bok

Edit: finally did it. I'm such a sloth brain. I need to get back in to practice using my noggin.

let x be the highest number
let y be the square root of x as an integer (rounded down)
let z be an iterating divisor

Do While z > 1

z = y

Do While x Mod z > 0 And z > 1
z = z - 1
Loop

x = x - 1
Loop

the resulting x will be the highest prime number.
olsen:
biggrin

I actually was worried that K might genuinely be hurt/upset. But I couldn't lie when she asked directly, so....crisis averted?
Apr 2, 2006

More Blogs

  • 03.02.08
    1

    Sunday Mar 02, 2008

    Okay so next weekend is "break the porn fast" day. I have the ergonom…
  • 02.26.08
    9

    Tuesday Feb 26, 2008

    I feel like going back in time. Anyone want to join me?
  • 02.07.08
    11

    Thursday Feb 07, 2008

    I love you all! All you bitches!
  • 02.06.08
    2

    Wednesday Feb 06, 2008

    Breaking News
  • 02.03.08
    5

    Sunday Feb 03, 2008

    Read More
  • 01.28.08
    1

    Monday Jan 28, 2008

    I'm going to bed. G'night!blorp gloop
  • 01.22.08
    6

    Tuesday Jan 22, 2008

    Read More
  • 01.02.08
    7

    Thursday Jan 03, 2008

    If you only had one day to spend in Milan what would you do? SPOIL…
  • 12.08.07
    7

    Saturday Dec 08, 2007

    The rumors are true. It looks like I will be changing Tom's lightbulb…
  • 12.03.07
    6

    Monday Dec 03, 2007

    I don't know if you might find this interesting or not but I've decid…

We at SuicideGirls have been celebrating alternative pin-up girls for:

23
years
10
months
21
days
  • 5,509,826 fans
  • 41,393 fans
  • 10,327,617 followers
  • 4,600 SuicideGirls
  • 1,114,946 followers
  • 14,947,706 photos
  • 321,315 followers
  • 61,460,371 comments
  • Join
  • Profiles
  • Groups
  • Photos
  • Videos
  • Shop
  • Help
  • About
  • Press
  • LIVE

Legal/Tos | DMCA | Privacy Policy | 18 U.S.C. 2257 Record-Keeping Requirements Compliance Statement | Contact Us | Vendo Payment Support
©SuicideGirls 2001-2025

Press enter to search
Fast Hi-res

Click here to join & see it all...

Crop your photo