Ambrosia Software Web Board: Prime Numbers - Ambrosia Software Web Board

Jump to content

  • 4 Pages +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

Prime Numbers

#1 User is offline   Pallas Athene 

  • Lame space monkey
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,636
  • Joined: 27-February 00
  • Gender:Not Telling
  • Location:Omisha

Posted 02 May 2003 - 09:34 PM

I'd just like to take this opportunity to remind Avatara that 31.257.311 is a prime number.

Note that 31.257.313 is almost a prime number, but it factors into 5437 and 5749.

------------------
"I'm one of those things you'll save forever / but never need / like an old newspaper / no one has time to read
This child has grown into a dead end / since I lost the power to pretend
But it's all right, that's who I am inside
Not much to say, on this non-toxic, ordinary day" -SR-17, "Non-Toxic" (now you see inside)

#2 User is offline   Zortrium 

  • Crazed primate
  • PipPipPipPipPip
  • Group: Members
  • Posts: 3,191
  • Joined: 08-January 02
  • Gender:Male
  • Location:The great intraweb, and maybe New England

Posted 02 May 2003 - 11:32 PM

You know, on non-school days, I try not to learn anything. You just wrecked my day. Posted Image

------------------
[INSERT ZEEKY BOGGY DOOG HERE]
[url="http://"http://albinoblacksheep.com/flash/demented.html"]- The Demented Cartoon Movie[/url]
It's all fun and games until a rampaging mod destroys half your account.
Commander of the AAS and Supreme Ruler of ZAP.

"Bad Avatara."
-- from the topic closings of Sundered Angel, Official Lektorian and founder of SONAH.

#3 User is offline   *suGaR* 

  • Member
  • Group: Members
  • Posts: 78
  • Joined: 21-April 03

Posted 03 May 2003 - 12:00 AM

Who says you had to learn anything?

------------------
From the moment I picked your book up, until I laid it down, I was convulsed with laughter. Someday I intend on reading it.
From the moment I picked your book up, until I laid it down, I was convulsed with laughter. Someday I intend on reading it.

#4 User is offline   Zortrium 

  • Crazed primate
  • PipPipPipPipPip
  • Group: Members
  • Posts: 3,191
  • Joined: 08-January 02
  • Gender:Male
  • Location:The great intraweb, and maybe New England

Posted 03 May 2003 - 12:27 PM

Now I know that 31.257.311 is a prime number...

------------------
[INSERT ZEEKY BOGGY DOOG HERE]
[url="http://"http://albinoblacksheep.com/flash/demented.html"]- The Demented Cartoon Movie[/url]
It's all fun and games until a rampaging mod destroys half your account.
Commander of the AAS and Supreme Ruler of ZAP.

"Bad Avatara."
-- from the topic closings of Sundered Angel, Official Lektorian and founder of SONAH.

#5 User is offline   Jules 

  • this is bat country
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 3,239
  • Joined: 23-July 00
  • Location:ecosse

Posted 03 May 2003 - 12:46 PM

3 is also a prime number Posted Image

ewan

------------------
[url="http://"http://www.evula.org/ewan/"]Ewan's Lair[/url] | [url="http://"http://dreamwave.evula.net"]Dreamwave[/url] | [url="http://"http://www.northernswamp.com"]Northern Swamp[/url] | [url="http://"http://www.evula.com"]EVula's Lair[/url]
"In this world gone mad, we won't spank the monkey - the monkey will spank us!"
In this world gone mad we wont spank the monkey - the monkey will spank us!

#6 User is offline   dude3 

  • Ehhhhh...no?
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 3,501
  • Joined: 10-February 02
  • Location:Anytown, Anystate, USA

Posted 03 May 2003 - 01:01 PM

So is 2.

------------------
dude3 -- a succession of trite homilies and unfortunate metaphors
Quote of the Week- "Let's spank his panties!" -Ryogo
[url="http://"http://www.ambrosiasw.com/webboard/Forum12/HTML/000347.html#"]Stupid Joke of the Day[/url] :: [url="http://"http://www.ambrosiasw.com/cgi-bin/ubb/forumdisplay.cgi?action=topics&forum=Ares+Trash+Talk&number=12&DaysPrune=20&LastLogin="]Support Your Local Undead Webboard![/url]
"For a writing to be a writing it must continue to 'act' and to be readable even when what is called the author of the writing no longer answers for what he has written..."

Jacques Derrida, "Signature Event Context"

#7 User is offline   Zortrium 

  • Crazed primate
  • PipPipPipPipPip
  • Group: Members
  • Posts: 3,191
  • Joined: 08-January 02
  • Gender:Male
  • Location:The great intraweb, and maybe New England

Posted 03 May 2003 - 01:13 PM

1 is debatable.

------------------
[INSERT ZEEKY BOGGY DOOG HERE]
[url="http://"http://albinoblacksheep.com/flash/demented.html"]- The Demented Cartoon Movie[/url]
It's all fun and games until a rampaging mod destroys half your account.
Commander of the AAS and Supreme Ruler of ZAP.

"Bad Avatara."
-- from the topic closings of Sundered Angel, Official Lektorian and founder of SONAH.

#8 User is offline   Pallas Athene 

  • Lame space monkey
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,636
  • Joined: 27-February 00
  • Gender:Not Telling
  • Location:Omisha

Posted 03 May 2003 - 01:14 PM

5.354.228.879 isn't.

------------------
"I'm one of those things you'll save forever / but never need / like an old newspaper / no one has time to read
This child has grown into a dead end / since I lost the power to pretend
But it's all right, that's who I am inside
Not much to say, on this non-toxic, ordinary day" -SR-17, "Non-Toxic" (now you see inside)

#9 User is offline   Pallas Athene 

  • Lame space monkey
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,636
  • Joined: 27-February 00
  • Gender:Not Telling
  • Location:Omisha

Posted 03 May 2003 - 03:16 PM

[0] => 2
[1] => 3
[2] => 5
[3] => 7
[4] => 11
[5] => 13
[6] => 17
[7] => 19
[8] => 23
[9] => 29
[10] => 31
[11] => 37
[12] => 41
[13] => 43
[14] => 47
[15] => 53
[16] => 59
[17] => 61
[18] => 67
[19] => 71
[20] => 73
[21] => 79
[22] => 83
[23] => 89
[24] => 97
[25] => 101
[26] => 103
[27] => 107
[28] => 109
[29] => 113
[30] => 127
[31] => 131
[32] => 137
[33] => 139
[34] => 149
[35] => 151
[36] => 157
[37] => 163
[38] => 167
[39] => 173

.........................

[960] => 7573
[961] => 7577
[962] => 7583
[963] => 7589
[964] => 7591
[965] => 7603
[966] => 7607
[967] => 7621
[968] => 7639
[969] => 7643
[970] => 7649
[971] => 7669
[972] => 7673
[973] => 7681
[974] => 7687
[975] => 7691
[976] => 7699
[977] => 7703
[978] => 7717
[979] => 7723
[980] => 7727
[981] => 7741
[982] => 7753
[983] => 7757
[984] => 7759
[985] => 7789
[986] => 7793
[987] => 7817
[988] => 7823
[989] => 7829
[990] => 7841
[991] => 7853
[992] => 7867
[993] => 7873
[994] => 7877
[995] => 7879
[996] => 7883
[997] => 7901
[998] => 7907
[999] => 7919

.........................

[99960] => 1299173
[99961] => 1299187
[99962] => 1299203
[99963] => 1299209
[99964] => 1299211
[99965] => 1299223
[99966] => 1299227
[99967] => 1299257
[99968] => 1299269
[99969] => 1299283
[99970] => 1299289
[99971] => 1299299
[99972] => 1299317
[99973] => 1299323
[99974] => 1299341
[99975] => 1299343
[99976] => 1299349
[99977] => 1299359
[99978] => 1299367
[99979] => 1299377
[99980] => 1299379
[99981] => 1299437
[99982] => 1299439
[99983] => 1299449
[99984] => 1299451
[99985] => 1299457
[99986] => 1299491
[99987] => 1299499
[99988] => 1299533
[99989] => 1299541
[99990] => 1299553
[99991] => 1299583
[99992] => 1299601
[99993] => 1299631
[99994] => 1299637
[99995] => 1299647
[99996] => 1299653
[99997] => 1299673
[99998] => 1299689
[99999] => 1299709

------------------
"I'm one of those things you'll save forever / but never need / like an old newspaper / no one has time to read
This child has grown into a dead end / since I lost the power to pretend
But it's all right, that's who I am inside
Not much to say, on this non-toxic, ordinary day" -SR-17, "Non-Toxic" (now you see inside)

[This message has been edited by Pallas Athene (edited 05-03-2003).]

#10 User is offline   Blackdog 

  • Member
  • PipPipPipPip
  • Group: Members
  • Posts: 1,512
  • Joined: 06-March 00

Posted 03 May 2003 - 04:21 PM

You FOOLS!

Posted Image

------------------
I was disorientedly changing my body orientation in a clockwise direction while simulateously expressing my appreciation of mikee's humor and watching my posterior disconnect -- ElG7
A witty saying proves nothing.


-- Voltaire

#11 User is offline   dude3 

  • Ehhhhh...no?
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 3,501
  • Joined: 10-February 02
  • Location:Anytown, Anystate, USA

Posted 03 May 2003 - 05:11 PM

Quote

Originally posted by Zortrium:
1 is debatable.



1 is most certainly not prime.

------------------
dude3 -- a succession of trite homilies and unfortunate metaphors
Quote of the Week- "Let's spank his panties!" -Ryogo
[url="http://"http://www.ambrosiasw.com/webboard/Forum12/HTML/000347.html#"]Stupid Joke of the Day[/url] :: [url="http://"http://www.ambrosiasw.com/cgi-bin/ubb/forumdisplay.cgi?action=topics&forum=Ares+Trash+Talk&number=12&DaysPrune=20&LastLogin="]Support Your Local Undead Webboard![/url]
"For a writing to be a writing it must continue to 'act' and to be readable even when what is called the author of the writing no longer answers for what he has written..."

Jacques Derrida, "Signature Event Context"

#12 User is offline   The Journalist 

  • earstwhile
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 7,728
  • Joined: 13-December 01
  • Gender:Male
  • Location:That one place in Nevada.

Posted 03 May 2003 - 05:51 PM

True.

------------------
"It's a tough case...he still thinks he's an accountant"-Airplane 2: The Sequel
Links: [url="http://"http://ambrosiasw.com/games/pop-pop"]pop-pop[/url] [url="http://"http://ambrosiasw.com/webboard/forum12/HTML/000347.html"]Visit Stupid Joke of the Day![/url] [url="http://"http://svt.se/hogafflahage/hogafflaHage_site/Kor/hestekor.html"]Singing Horses/Hogafflahage[/url] That should do it.
Hyperbole is the best thing ever!

#13 User is offline   Avatara 

  • Guardian
  • PipPipPipPipPipPipPip
  • Group: Moderators
  • Posts: 12,036
  • Joined: 05-July 00
  • Gender:Male

Posted 03 May 2003 - 11:34 PM

Aren't numbers only supposed to have at most one decimal?

------------------
"What we do not know, we cannot begin to understand."
"Sometimes I get confused whether I'm posting on ATT or in the War Room. But then I remind myself: If it's moderators acting scatter-brained and foolish, then it's the War Room*.

*Unless it's Avatara, of course."
-- From the memoirs of Sundered Angel

#14 User is offline   dude3 

  • Ehhhhh...no?
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 3,501
  • Joined: 10-February 02
  • Location:Anytown, Anystate, USA

Posted 03 May 2003 - 11:39 PM

Only America (and maybe Britain) use the commas. Everybody else uses periods.

------------------
dude3 -- just a set of intercorrolated coordinates
Quote of the Week- "And what the dickens is 'grimace musically'?" -Portnoy
[url="http://"http://www.ambrosiasw.com/webboard/Forum12/HTML/000347.html#"]Stupid Joke of the Day[/url] :: [url="http://"http://www.ambrosiasw.com/cgi-bin/ubb/forumdisplay.cgi?action=topics&forum=Ares+Trash+Talk&number=12&DaysPrune=20&LastLogin="]Support Your Local Undead Webboard![/url]
"For a writing to be a writing it must continue to 'act' and to be readable even when what is called the author of the writing no longer answers for what he has written..."

Jacques Derrida, "Signature Event Context"

#15 User is offline   Avatara 

  • Guardian
  • PipPipPipPipPipPipPip
  • Group: Moderators
  • Posts: 12,036
  • Joined: 05-July 00
  • Gender:Male

Posted 04 May 2003 - 12:01 AM

This is an American board, last I checked.

But if pallas wants §31 and a quarter, I'm not sure I have a right to complain...

------------------
"What we do not know, we cannot begin to understand."
"Sometimes I get confused whether I'm posting on ATT or in the War Room. But then I remind myself: If it's moderators acting scatter-brained and foolish, then it's the War Room*.

*Unless it's Avatara, of course."
-- From the memoirs of Sundered Angel

#16 User is offline   Pallas Athene 

  • Lame space monkey
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,636
  • Joined: 27-February 00
  • Gender:Not Telling
  • Location:Omisha

Posted 04 May 2003 - 07:11 AM

Quote

Originally posted by Avatara:
This is an American board, last I checked.


...and I was American, last time I checked. Years of playing online games based out of Europe have gotten me used to writing the period instead of the comma. Although apparently Hyp uses the comma... more PAesque-type games seem to rely more on the period.

------------------
"I'm one of those things you'll save forever / but never need / like an old newspaper / no one has time to read
This child has grown into a dead end / since I lost the power to pretend
But it's all right, that's who I am inside
Not much to say, on this non-toxic, ordinary day" -SR-17, "Non-Toxic" (now you see inside)

#17 User is offline   Sundered Angel 

  • Invigilator
  • PipPipPipPipPipPipPip
  • Group: Moderators
  • Posts: 7,372
  • Joined: 25-January 00
  • Location:New York, New York

Posted 04 May 2003 - 08:14 AM

I seem to recall the "modern" thing to do is just use spaces. 132 643 172. But that's never bothered me.

------------------
Sundered Angel,
The One and Only
Ares Webboard Moderator, and all-around Nice Guy
Sundered Angel,
The One and Only

Ares Webboard Moderator, and all-around Nice Guy

#18 User is offline   Lord Commander Anic 

  • Member
  • PipPipPipPip
  • Group: Members
  • Posts: 853
  • Joined: 27-September 00

Posted 04 May 2003 - 12:21 PM

7 is my favourite prime number.

Periods and commas are both valid ways of expressing a decimal place in all jurisdictions.
I use both (commas in Ireland, Periods in Finland). Not only that, but it gets more interesting, in many places where commas are used for decimal places periods are used as incremental separators for thousands and vice versa.

------------------
Oh, so it is another bug hunt then...
Oh, so it is another bug hunt then...

#19 User is offline   Pyro 

  • Member
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,226
  • Joined: 13-July 00

Posted 04 May 2003 - 08:47 PM

Mommy, the crazy guy named Pallas is scaring me.

------------------
The leaves rustling.
When is the last time you heard
that in a city.

.

#20 User is offline   Pallas Athene 

  • Lame space monkey
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,636
  • Joined: 27-February 00
  • Gender:Not Telling
  • Location:Omisha

Posted 04 May 2003 - 10:59 PM

#include <stdio.h>

int main()
{
    int count, test, pc, i;
    long *prime;
    bool isp;

    scanf("%d", &count);

    if (count>0)
    {
        prime = new long[count];
        test = 2;
        pc = 0;

        while (pc < count)
        {
            isp = true;
            for (i=0; i<pc && isp; i++)
            {  
                if (test % prime[i] == 0)
                    isp = false;
            }
            if (isp) 
            {
                prime[pc] = test;
                printf("[%d] => %dn", pc, prime[pc]);
                pc++;
            }
            test++;
        }
    }

    return 0;
}


------------------
"I'm one of those things you'll save forever / but never need / like an old newspaper / no one has time to read
This child has grown into a dead end / since I lost the power to pretend
But it's all right, that's who I am inside
Not much to say, on this non-toxic, ordinary day" -SR-17, "Non-Toxic" (now you see inside)

#21 User is offline   Zortrium 

  • Crazed primate
  • PipPipPipPipPip
  • Group: Members
  • Posts: 3,191
  • Joined: 08-January 02
  • Gender:Male
  • Location:The great intraweb, and maybe New England

Posted 05 May 2003 - 02:42 PM

Programs are more cool if you return 1 instead of 0. Posted Image

------------------
[INSERT ZEEKY BOGGY DOOG HERE]
[url="http://"http://albinoblacksheep.com/flash/demented.html"]- The Demented Cartoon Movie[/url]
It's all fun and games until a rampaging mod destroys half your account.
Commander of the AAS and Supreme Ruler of ZAP.

"Bad Avatara."
-- from the topic closings of Sundered Angel, Official Lektorian and founder of SONAH.

#22 User is offline   Pallas Athene 

  • Lame space monkey
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,636
  • Joined: 27-February 00
  • Gender:Not Telling
  • Location:Omisha

Posted 05 May 2003 - 04:10 PM

... or you give someone a header file with a hidden #define 0 10, so he'd go crazy trying to track down segfaults.

------------------
"I'm one of those things you'll save forever / but never need / like an old newspaper / no one has time to read
This child has grown into a dead end / since I lost the power to pretend
But it's all right, that's who I am inside
Not much to say, on this non-toxic, ordinary day" -SR-17, "Non-Toxic" (now you see inside)

#23 User is offline   Zortrium 

  • Crazed primate
  • PipPipPipPipPip
  • Group: Members
  • Posts: 3,191
  • Joined: 08-January 02
  • Gender:Male
  • Location:The great intraweb, and maybe New England

Posted 05 May 2003 - 10:42 PM

Well now I'm going to show you my Really Cool *cough* Return 1 Program:
#include <iostream.h>
int main()
{
cout<<"This program returns 1 because it's cooler than Pallas' silly program that returns 0.";
return 1;
}


------------------
[INSERT ZEEKY BOGGY DOOG HERE]
[url="http://"http://albinoblacksheep.com/flash/demented.html"]- The Demented Cartoon Movie[/url]
It's all fun and games until a rampaging mod destroys half your account.
Commander of the AAS and Supreme Ruler of ZAP.

"Bad Avatara."
-- from the topic closings of Sundered Angel, Official Lektorian and founder of SONAH.

#24 User is offline   Avatara 

  • Guardian
  • PipPipPipPipPipPipPip
  • Group: Moderators
  • Posts: 12,036
  • Joined: 05-July 00
  • Gender:Male

Posted 05 May 2003 - 11:09 PM

Returning -1 is a bit better.

------------------
"What we do not know, we cannot begin to understand."
"Sometimes I get confused whether I'm posting on ATT or in the War Room. But then I remind myself: If it's moderators acting scatter-brained and foolish, then it's the War Room*.

*Unless it's Avatara, of course."
-- From the memoirs of Sundered Angel

#25 User is offline   Pallas Athene 

  • Lame space monkey
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,636
  • Joined: 27-February 00
  • Gender:Not Telling
  • Location:Omisha

Posted 06 May 2003 - 02:42 PM

If you're going to do that, why not just declare void main()?

How about this one?

#include <stdlib.h>
#include <time.h>

double main()
{
    double *i;
    srand((unsigned)time(NULL));
    i = rand();
    return *i;
}


------------------
"I'm one of those things you'll save forever / but never need / like an old newspaper / no one has time to read
This child has grown into a dead end / since I lost the power to pretend
But it's all right, that's who I am inside
Not much to say, on this non-toxic, ordinary day" -SR-17, "Non-Toxic" (now you see inside)

Share this topic:


  • 4 Pages +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users