Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > generation of Apocalyptic number

Reply
Thread Tools

generation of Apocalyptic number

 
 
Rajshekhar
Guest
Posts: n/a
 
      09-24-2008
On Sep 24, 4:51*am, Wolfgang Draxinger <(E-Mail Removed)>
wrote:
> Keith Thompson wrote:
> > And Rajshekhar provided a definition, so what's the problem?

>
> He's doing numerology
>
> BTW: I forgot to include 'i' into my set of essential numbers.
>
> >> So if anybody says to me, a number is apocalyptic, I assume
> >> that to be a metaphor for: My program can't deal with that,
> >> due to lack of resolution.

>
> > Your answer is relevant neither to the OP's question nor to C.

>
> Well, the OP's question touches C only insofar, that he is
> actually searching for a certain sequence of digits within the
> (decimal?) representation of a number. If e.g. he'd look at a
> base 5 representation, there would be no occourence of 666 at
> all.
>
> The whole topic is IMHO a waste of time. And if the OP really is
> just looking for such numbers, well, then he might be better of
> with Python, which has big number support built in.
>
> Now I'm getting completely off topic (sorry), this is a Python
> 3-liner, doing exactly what the OP seems to want:
>
> for i in range(500):
> * * if str(2**i).find('666')>=0:
> * * * * print "2^%d is 'apocalyptic': %s" % (i, str(2**i))
>
> running it results in
>
> 2^157 is 'apocalyptic':
> 182687704666362864775460604089535377456991567872
> 2^192 is 'apocalyptic':
> 62771017353866807638357894232076664161023554444640 34512896
> 2^218 is 'apocalyptic':
> 42124916667422874679167211073468172927558038160219 6445017243910144
> 2^220 is 'apocalyptic':
> 16849966666969149871666884429387269171023215264087 85780068975640576
> 2^222 is 'apocalyptic':
> 67399866667876599486667537717549076684092861056351 43120275902562304
> 2^224 is 'apocalyptic':
> 26959946667150639794667015087019630673637144422540 572481103610249216
> 2^226 is 'apocalyptic':
> 10783978666860255917866806034807852269454857769016 2289924414440996864
> 2^243 is 'apocalyptic':
> 14134776518227074636666380005943348126619871175004 951664972849610340958208
> 2^245 is 'apocalyptic':
> 56539106072908298546665520023773392506479484700019 806659891398441363832832
> 2^247 is 'apocalyptic':
> 22615642429163319418666208009509357002591793880007 9226639565593765455331328
> 2^251 is 'apocalyptic':
> 36185027886661311069865932815214971204146870208012 6762623304950024728530124*8
> 2^278 is 'apocalyptic':
> 48566722305643226772986547670587972666060170976303 4880312953102434726071301*302124544
> 2^285 is 'apocalyptic':
> 62165404551223330269422781018352605012557018849668 4646800579971116449371265*66671941632
> 2^286 is 'apocalyptic':
> 12433080910244666053884556203670521002511403769933 6929360115994223289874253*133343883264
> 2^287 is 'apocalyptic':
> 24866161820489332107769112407341042005022807539867 3858720231988446579748506*266687766528
> 2^312 is 'apocalyptic':
> 83436993590660550093555535397248129476668145404556 7488260563128055554580383*0627148527195652096
> 2^355 is 'apocalyptic':
> 73391955711682288371546268649666782105490079653384 9959596028428603815320348*315138582405936995240219 69747968
> 2^361 is 'apocalyptic':
> 46970851655476664557789611935786740547513650978166 3974141458194306441805022*921688692739799676953740 6063869952
> 2^366 is 'apocalyptic':
> 15030672529752532658492675819451756975204368313013 2471725266622178061377607*334940381676735896625196 994043838464
> 2^382 is 'apocalyptic':
> 98505015490986198030697600250359034512699348176163 6166698707335106143044287*430265285356656372122891 0201656997576704
> 2^384 is 'apocalyptic':
> 39402006196394479212279040100143613805079739270465 4466679482934042457217714*972106114142662548849156 40806627990306816
> 2^390 is 'apocalyptic':
> 25217283965692466695858585664091912835251033133097 8858674869077787172619337*582147913051304031263460 1011624191379636224
> 2^394 is 'apocalyptic':
> 40347654345107946713373737062547060536401653012956 6173879790524459476190940*131436660882086450021536 16185987062074179584
> 2^411 is 'apocalyptic':
> 52884477503219887916153224642621683186272374637142 4975427719036219524632989*049076660151368351772227 8780729696200186866434048
> 2^434 is 'apocalyptic':
> 44362715105933037753254626946289339254982993206013 0652027276732898339409248*900099686395904976662332 49558259375382457149263586525184
> 2^443 is 'apocalyptic':
> 22713710134237715329666368996500141698551292521478 6893837965687243949777535*436851039434703348051114 23773828800195818060422956300894208
> 2^478 is 'apocalyptic':
> 78043713757899805784539930744829157643714953566624 2787714789239906342934704*941405030076525765872992 789956732780351655723861993919822071326572544
> 2^497 is 'apocalyptic':
> 40917382598701773375164871210344989402708025575538 3098685411421012016724550*584319360408761540738019 64386083551594500887615215706823567413166606594867 2
> 2^499 is 'apocalyptic':
> 16366953039480709350065948484137995761083210230215 3239474164568404806689820*233727744163504616295207 85754433420637800355046086282729426965266642637946 8*8
>
> But as I said already, this is a total scam, since a simple
> change of base will change the representation, though the
> numbers remain the very same.
>
> Wolfgang Draxinger
> --
> E-Mail address works, Jabber: (E-Mail Removed), ICQ: 134682867



Thanks for all the replies..

Let me re-frame my question,

Write a program which tests the Apocalyptic number.
An Apocalyptic number is:
"A number of the form 2^n that contains the digits 666 (i.e., the
beast number) is called an apocalyptic number.The first few such
powers are 157, 192, 218, 220, ..."
The list goes on....

Program should only take power(n) as input (which is 2^n ) for any
given values as said above
and the output should whether this power will form apocalyptic number
or not.

So here my data type should be capable enough to hold for any (dynamic
in nature)powered number which may run into 50's
or 100' digits of generated out of 2^n.

FOr example like
2^499 is 'apocalyptic':
16366953039480709350065948484137995761083210230215 3239474164568404806689820*
23372774416350461629520785754433420637800355046086 2827294269652666426379468*
8

P.S: you need to print that value from ur data structure used for
storing it not the direct output of
pow(2,n) !!!

For any clarifications write back

 
Reply With Quote
 
 
 
 
Rajshekhar
Guest
Posts: n/a
 
      09-26-2008
On Sep 24, 8:48*am, Rajshekhar <(E-Mail Removed)> wrote:
> On Sep 24, 4:51*am, Wolfgang Draxinger <(E-Mail Removed)>
> wrote:
>
>
>
>
>
> > Keith Thompson wrote:
> > > And Rajshekhar provided a definition, so what's the problem?

>
> > He's doing numerology

>
> > BTW: I forgot to include 'i' into my set of essential numbers.

>
> > >> So if anybody says to me, anumberisapocalyptic, I assume
> > >> that to be a metaphor for: My program can't deal with that,
> > >> due to lack of resolution.

>
> > > Your answer is relevant neither to the OP's question nor to C.

>
> > Well, the OP's question touches C only insofar, that he is
> > actually searching for a certain sequence of digits within the
> > (decimal?) representation of anumber. If e.g. he'd look at a
> > base 5 representation, there would be no occourence of 666 at
> > all.

>
> > The whole topic is IMHO a waste of time. And if the OP really is
> > just looking for such numbers, well, then he might be better of
> > with Python, which has bignumbersupport built in.

>
> > Now I'm getting completely off topic (sorry), this is a Python
> > 3-liner, doing exactly what the OP seems to want:

>
> > for i in range(500):
> > * * if str(2**i).find('666')>=0:
> > * * * * print "2^%d is 'apocalyptic': %s" % (i, str(2**i))

>
> > running it results in

>
> > 2^157 is 'apocalyptic':
> > 182687704666362864775460604089535377456991567872
> > 2^192 is 'apocalyptic':
> > 62771017353866807638357894232076664161023554444640 34512896
> > 2^218 is 'apocalyptic':
> > 42124916667422874679167211073468172927558038160219 6445017243910144
> > 2^220 is 'apocalyptic':
> > 16849966666969149871666884429387269171023215264087 85780068975640576
> > 2^222 is 'apocalyptic':
> > 67399866667876599486667537717549076684092861056351 43120275902562304
> > 2^224 is 'apocalyptic':
> > 26959946667150639794667015087019630673637144422540 572481103610249216
> > 2^226 is 'apocalyptic':
> > 10783978666860255917866806034807852269454857769016 2289924414440996864
> > 2^243 is 'apocalyptic':
> > 14134776518227074636666380005943348126619871175004 951664972849610340958208
> > 2^245 is 'apocalyptic':
> > 56539106072908298546665520023773392506479484700019 806659891398441363832832
> > 2^247 is 'apocalyptic':
> > 22615642429163319418666208009509357002591793880007 9226639565593765455331328
> > 2^251 is 'apocalyptic':
> > 36185027886661311069865932815214971204146870208012 6762623304950024728530124**8
> > 2^278 is 'apocalyptic':
> > 48566722305643226772986547670587972666060170976303 4880312953102434726071301**302124544
> > 2^285 is 'apocalyptic':
> > 62165404551223330269422781018352605012557018849668 4646800579971116449371265**66671941632
> > 2^286 is 'apocalyptic':
> > 12433080910244666053884556203670521002511403769933 6929360115994223289874253**133343883264
> > 2^287 is 'apocalyptic':
> > 24866161820489332107769112407341042005022807539867 3858720231988446579748506**266687766528
> > 2^312 is 'apocalyptic':
> > 83436993590660550093555535397248129476668145404556 7488260563128055554580383**0627148527195652096
> > 2^355 is 'apocalyptic':
> > 73391955711682288371546268649666782105490079653384 9959596028428603815320348**31513858240593699524021 969747968
> > 2^361 is 'apocalyptic':
> > 46970851655476664557789611935786740547513650978166 3974141458194306441805022**92168869273979967695374 06063869952
> > 2^366 is 'apocalyptic':
> > 15030672529752532658492675819451756975204368313013 2471725266622178061377607**33494038167673589662519 6994043838464
> > 2^382 is 'apocalyptic':
> > 98505015490986198030697600250359034512699348176163 6166698707335106143044287**43026528535665637212289 10201656997576704
> > 2^384 is 'apocalyptic':
> > 39402006196394479212279040100143613805079739270465 4466679482934042457217714**97210611414266254884915 640806627990306816
> > 2^390 is 'apocalyptic':
> > 25217283965692466695858585664091912835251033133097 8858674869077787172619337**58214791305130403126346 01011624191379636224
> > 2^394 is 'apocalyptic':
> > 40347654345107946713373737062547060536401653012956 6173879790524459476190940**13143666088208645002153 616185987062074179584
> > 2^411 is 'apocalyptic':
> > 52884477503219887916153224642621683186272374637142 4975427719036219524632989**04907666015136835177222 78780729696200186866434048
> > 2^434 is 'apocalyptic':
> > 44362715105933037753254626946289339254982993206013 0652027276732898339409248**90009968639590497666233 249558259375382457149263586525184
> > 2^443 is 'apocalyptic':
> > 22713710134237715329666368996500141698551292521478 6893837965687243949777535**43685103943470334805111 423773828800195818060422956300894208
> > 2^478 is 'apocalyptic':
> > 78043713757899805784539930744829157643714953566624 2787714789239906342934704**94140503007652576587299 2789956732780351655723861993919822071326572544
> > 2^497 is 'apocalyptic':
> > 40917382598701773375164871210344989402708025575538 3098685411421012016724550**58431936040876154073801 96438608355159450088761521570682356741316660659486 7*2
> > 2^499 is 'apocalyptic':
> > 16366953039480709350065948484137995761083210230215 3239474164568404806689820**23372774416350461629520 78575443342063780035504608628272942696526664263794 6*8*8

>
> > But as I said already, this is a total scam, since a simple
> > change of base will change the representation, though the
> > numbers remain the very same.

>
> > Wolfgang Draxinger
> > --
> > E-Mail address works, Jabber: (E-Mail Removed), ICQ: 134682867

>
> Thanks for all the replies..
>
> Let me re-frame my question,
>
> Write a program which tests theApocalypticnumber.
> AnApocalypticnumberis:
> * * "Anumberof the form 2^n that contains the digits 666 (i.e., the
> beastnumber) is called anapocalypticnumber.The first few such
> powers are 157, 192, 218, 220, ..."
> The list goes on....
>
> Program should only take power(n) as input (which is 2^n ) for any
> given values as said above
> and the output should whether this power will formapocalypticnumber
> or not.
>
> So here my data type should be capable enough to hold for any (dynamic
> in nature)powerednumberwhich may run into 50's
> or 100' digits of generated out of 2^n.
>
> FOr example like
> 2^499 is 'apocalyptic':
> 16366953039480709350065948484137995761083210230215 3239474164568404806689820**
> 23372774416350461629520785754433420637800355046086 2827294269652666426379468**
> 8
>
> P.S: you need to print that value from ur data structure used for
> storing it not the direct output of
> pow(2,n) !!!
>
> For any clarifications write back - Hide quoted text -
>
> - Show quoted text -


any solutions ??
 
Reply With Quote
 
 
 
 
Ben Bacarisse
Guest
Posts: n/a
 
      09-26-2008
Rajshekhar <(E-Mail Removed)> writes:

> On Sep 24, 8:48┬*am, Rajshekhar <(E-Mail Removed)> wrote:

<snip>
>> Let me re-frame my question,
>>
>> Write a program which tests theApocalypticnumber.
>> AnApocalypticnumberis:
>> ┬* ┬* "Anumberof the form 2^n that contains the digits 666 (i.e., the
>> beastnumber) is called anapocalypticnumber.The first few such
>> powers are 157, 192, 218, 220, ..."

<snip>
> any solutions ??


Yes, how about you? (We don't do coursework on demand.)

--
Ben.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Random Number Generation dpi VHDL 4 03-26-2010 10:31 AM
OT: Number Nine, Number Nine, Number Nine Frisbee« MCSE 37 09-26-2005 04:06 PM
Need Help With Random Number Generation Between Upper and Lower Bound ANM Java 2 03-07-2004 07:18 AM
HTML Generation (Next Generation CGI) John W. Long Ruby 4 11-24-2003 04:24 AM
random number generation and Monte Carlo simulation in C++ mescaline C++ 4 09-10-2003 09:01 PM



Advertisments