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

  • 05.25.15
    1

    Local Forecast

    By all indications it appears as though I'm about to go on a sex …
  • 04.23.13
    4

    Tuesday Apr 23, 2013

    Yup. Signed back up. Graduated from school. Got a job to pay for my S…
  • 08.18.12
    0

    Saturday Aug 18, 2012

    No Comment
  • 03.21.12
    6

    Wednesday Mar 21, 2012

    Study for the midterm tomorrow or sex. What would you choose?
  • 11.05.11
    20

    Saturday Nov 05, 2011

    For the record I support #OWS. Here's why.. For some reason youTube …
  • 08.04.11
    3

    Thursday Aug 04, 2011

    I got to hang out with Michelle Tea while a friend helped film segmen…
  • 07.13.11
    1

    Wednesday Jul 13, 2011

    I'm single and I'm only ever around college girls because I am at sch…
  • 05.30.11
    0

    Tuesday May 31, 2011

    Is it me, or is "the social order" just multiplying in dimensions? Mo…
  • 03.30.11
    8

    Thursday Mar 31, 2011

    I don't think there is anytime outside of college (except for celebri…
  • 03.20.11
    0

    Sunday Mar 20, 2011

    Read More

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