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.15.11
    0

    Tuesday Mar 15, 2011

    How's it going? It seems like the college girls are stalking me, find…
  • 03.02.11
    1

    Wednesday Mar 02, 2011

    Maybe this is a good time to start blogging again. I can't express h…
  • 03.01.11
    2

    Tuesday Mar 01, 2011

    Read More
  • 12.28.10
    1

    Tuesday Dec 28, 2010

    Hello good friends of SG clan!
  • 12.19.10
    0

    Monday Dec 20, 2010

    Wow..if everybody is a dick..what kind of world would this be? What i…
  • 12.19.10
    0

    Monday Dec 20, 2010

    I think Im going to get a bit misanthropic.
  • 12.19.10
    0

    Monday Dec 20, 2010

    Is there any point to being hot at my age?
  • 12.18.10
    1

    Saturday Dec 18, 2010

    Wow! I feel really alone. I never knew it could be like this. Fuck…
  • 12.16.10
    0

    Friday Dec 17, 2010

    Longest stretch between posts yet! Dark Matter rules. The universe w…
  • 08.04.09
    13

    Tuesday Aug 04, 2009

    I had amazing super nostalgia last night rereading my old blog posts.…

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

23
years
10
months
18
days
  • 5,509,826 fans
  • 41,393 fans
  • 10,327,617 followers
  • 4,599 SuicideGirls
  • 1,114,448 followers
  • 14,944,928 photos
  • 321,315 followers
  • 61,453,983 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