generation of Apocalyptic number

Discussion in 'C Programming' started by Rajshekhar, Sep 23, 2008.

  1. Rajshekhar

    Rajshekhar Guest

    Hi Group,

    I woud like to know how can i store a number generated out of 2 to
    power of 150
    i.e pow(2,150);

    mainly i want to knw how can i get the value a large powers of a
    number....!

    since this crosses all the data type limits ........

    can any one tell me the solution ? or c code to do this which will
    print it.

    cheers
    R
     
    Rajshekhar, Sep 23, 2008
    #1
    1. Advertising

  2. Rajshekhar wrote:

    > Hi Group,
    >
    > I woud like to know how can i store a number generated out of 2
    > to power of 150
    > i.e pow(2,150);
    >
    > mainly i want to knw how can i get the value a large powers of
    > a number....!
    >
    > since this crosses all the data type limits ........
    >
    > can any one tell me the solution ? or c code to do this which
    > will print it.


    Use a big number library.

    You can print it very easily by the way, if binary is ok for you:

    char _149zeros[150];
    int i;
    for(i = 0; i < 149; ++i) {
    _149zeros = '0';
    }
    _149zeros[149] = '\0';
    printf("b%c%s", '1', _149zeros);

    ;-)

    No really, what you're looking for is a library to deal with
    arbitrary large numbers. Google for it, there are plenty of
    them.

    Wolfgang Draxinger
    --
    E-Mail address works, Jabber: , ICQ: 134682867
     
    Wolfgang Draxinger, Sep 23, 2008
    #2
    1. Advertising

  3. Rajshekhar

    Rajshekhar Guest

    On Sep 23, 2:47 pm, Wolfgang Draxinger <>
    wrote:
    > Rajshekhar wrote:
    > > Hi Group,

    >
    > > I woud like to know how can i store a number generated out of 2
    > > to power of 150
    > > i.e pow(2,150);

    >
    > > mainly i want to knw how can i get the value a large powers of
    > > a number....!

    >
    > > since this crosses all the data type limits ........

    >
    > > can any one tell me the solution ? or c code to do this which
    > > will print it.

    >
    > Use a big number library.
    >
    > You can print it very easily by the way, if binary is ok for you:
    >
    > char _149zeros[150];
    > int i;
    > for(i = 0; i < 149; ++i) {
    >         _149zeros = '0';}
    >
    > _149zeros[149] = '\0';
    > printf("b%c%s", '1', _149zeros);
    >
    > ;-)
    >
    > No really, what you're looking for is a library to deal with
    > arbitrary large numbers. Google for it, there are plenty of
    > them.
    >
    > Wolfgang Draxinger
    > --
    > E-Mail address works, Jabber: , ICQ: 134682867


    Hi,

    Thanks for the reply

    "A number of the form 2^n that contains the digits 666 (i.e., the
    beast number) is called an apocalyptic number. is an apocalyptic
    number.
    The first few such powers are 157, 192, 218, 220, ..."

    so to check whether the number has 666 or not first i have to have the
    number stored ??

    thats exactly what i want
    hope u got what i am trying to say..!

    cheers
     
    Rajshekhar, Sep 23, 2008
    #3
  4. Rajshekhar

    jacob navia Guest

    Rajshekhar wrote:
    > Hi Group,
    >
    > I woud like to know how can i store a number generated out of 2 to
    > power of 150
    > i.e pow(2,150);
    >
    > mainly i want to knw how can i get the value a large powers of a
    > number....!
    >
    > since this crosses all the data type limits ........
    >
    > can any one tell me the solution ? or c code to do this which will
    > print it.
    >
    > cheers
    > R


    If you use the lcc-win compiler you do:
    #include <qfloat.h>
    #include <stdio.h>
    int main(void)
    {
    qfloat s = pow(2.0q,150.0q);

    printf("%50.2qf\n",s);
    return 0;
    }

    Output:

    1427247692705959881058285969449495136382746624.00

    You can download lcc-win at the address below:

    --
    jacob navia
    jacob at jacob point remcomp point fr
    logiciels/informatique
    http://www.cs.virginia.edu/~lcc-win32
     
    jacob navia, Sep 23, 2008
    #4
  5. Rajshekhar <> writes:

    > On Sep 23, 2:47 pm, Wolfgang Draxinger <>
    > wrote:
    >> Rajshekhar wrote:

    <snip>
    >> > I woud like to know how can i store a number generated out of 2
    >> > to power of 150
    >> > i.e pow(2,150);

    <snip>
    >> Use a big number library.

    <snip>
    >> Wolfgang Draxinger
    >> --


    Best not to quote sig blocks. Cut them by hand if you need to.

    <snip>
    > "A number of the form 2^n that contains the digits 666 (i.e., the
    > beast number) is called an apocalyptic number. is an apocalyptic
    > number.
    > The first few such powers are 157, 192, 218, 220, ..."


    You mean that contain "666" in decimal or in any base >= 7?

    > so to check whether the number has 666 or not first i have to have the
    > number stored ??


    Well, in some sense yes. But what do you mean by store the number? I
    suspect you mean "I need to store it as a decimal string so I look for
    666". If that is what you mean, then no, you can store the number in
    other forms and still check for it being apocalyptic.

    Posting in comp.programming may be better sine the algorithm is not a C
    question. There may even be a more suitable group -- I don't know.

    --
    Ben.
     
    Ben Bacarisse, Sep 23, 2008
    #5
  6. Rajshekhar <> writes:
    > I woud like to know how can i store a number generated out of 2 to
    > power of 150
    > i.e pow(2,150);
    >
    > mainly i want to knw how can i get the value a large powers of a
    > number....!
    >
    > since this crosses all the data type limits ........
    >
    > can any one tell me the solution ? or c code to do this which will
    > print it.


    If you're only interested in exact powers of 2, you may not need any
    kind of extended precision; ordinary floating-point could do the job.

    You said in a followup that the exponents you were interested in were
    157, 192, 218, and 220. Here's a program that shows 2**n for each of
    those values.

    #include <stdio.h>
    #include <math.h>

    int main(void)
    {
    int expon[] = { 157, 192, 218, 220 };
    int i;
    for (i = 0; i < sizeof expon / sizeof *expon; i ++) {
    printf("%f\n", pow(2.0, expon));
    }
    return 0;
    }

    Typically any power of 2 within the range of a floating-point type can
    be represented exactly. I don't think printf is actually required to
    print such numbers accurately; it does in my implementation. Each
    line of output for the above program, when I run it on my system,
    includes the sequence "666".

    If you need larger exponents, using long double rather than double can
    probably get you some extra range (though that's not guaranteed).

    Note that if you wanted anything other than powers of 2, or if your
    implementation doesn't work the way mine does, the above solution
    won't be particularly useful.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Nokia
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
     
    Keith Thompson, Sep 23, 2008
    #6
  7. Rajshekhar wrote:

    > "A number of the form 2^n that contains the digits 666 (i.e.,
    > the beast number) is called an apocalyptic number. is an
    > apocalyptic number.


    Sorry, I'm not a guy interested in numerology. Number theory yes,
    but that should be probably everybody dealing with computer
    science.

    The only special numbers to me are 0, 1, pi and e. That combined
    with Peano's axioms and Euler's formula e^(i * pi) + 1 = 0.
    Everything else is just a matter of definition.

    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.

    Wolfgang Draxinger
    --
    E-Mail address works, Jabber: , ICQ: 134682867
     
    Wolfgang Draxinger, Sep 23, 2008
    #7
  8. Wolfgang Draxinger <> writes:
    > Rajshekhar wrote:
    >
    >> "A number of the form 2^n that contains the digits 666 (i.e.,
    >> the beast number) is called an apocalyptic number. is an
    >> apocalyptic number.

    >
    > Sorry, I'm not a guy interested in numerology. Number theory yes,
    > but that should be probably everybody dealing with computer
    > science.
    >
    > The only special numbers to me are 0, 1, pi and e. That combined
    > with Peano's axioms and Euler's formula e^(i * pi) + 1 = 0.
    > Everything else is just a matter of definition.


    And Rajshekhar provided a definition, so what's the problem?

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

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Nokia
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
     
    Keith Thompson, Sep 23, 2008
    #8
  9. Rajshekhar

    CBFalconer Guest

    Rajshekhar wrote:
    >
    > I woud like to know how can i store a number generated out of 2
    > to power of 150 i.e pow(2,150);
    >
    > mainly i want to knw how can i get the value a large powers of a
    > number! since this crosses all the data type limits.
    >
    > can any one tell me the solution ? or c code to do this which will
    > print it.


    Try simply using strings. The result will be roughly a 60 char.
    string for positive powers.

    --
    [mail]: Chuck F (cbfalconer at maineline dot net)
    [page]: <http://cbfalconer.home.att.net>
    Try the download section.
     
    CBFalconer, Sep 24, 2008
    #9
  10. 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':
    6277101735386680763835789423207666416102355444464034512896
    2^218 is 'apocalyptic':
    421249166674228746791672110734681729275580381602196445017243910144
    2^220 is 'apocalyptic':
    1684996666696914987166688442938726917102321526408785780068975640576
    2^222 is 'apocalyptic':
    6739986666787659948666753771754907668409286105635143120275902562304
    2^224 is 'apocalyptic':
    26959946667150639794667015087019630673637144422540572481103610249216
    2^226 is 'apocalyptic':
    107839786668602559178668060348078522694548577690162289924414440996864
    2^243 is 'apocalyptic':
    14134776518227074636666380005943348126619871175004951664972849610340958208
    2^245 is 'apocalyptic':
    56539106072908298546665520023773392506479484700019806659891398441363832832
    2^247 is 'apocalyptic':
    226156424291633194186662080095093570025917938800079226639565593765455331328
    2^251 is 'apocalyptic':
    3618502788666131106986593281521497120414687020801267626233049500247285301248
    2^278 is 'apocalyptic':
    485667223056432267729865476705879726660601709763034880312953102434726071301302124544
    2^285 is 'apocalyptic':
    62165404551223330269422781018352605012557018849668464680057997111644937126566671941632
    2^286 is 'apocalyptic':
    124330809102446660538845562036705210025114037699336929360115994223289874253133343883264
    2^287 is 'apocalyptic':
    248661618204893321077691124073410420050228075398673858720231988446579748506266687766528
    2^312 is 'apocalyptic':
    8343699359066055009355553539724812947666814540455674882605631280555545803830627148527195652096
    2^355 is 'apocalyptic':
    73391955711682288371546268649666782105490079653384995959602842860381532034831513858240593699524021969747968
    2^361 is 'apocalyptic':
    4697085165547666455778961193578674054751365097816639741414581943064418050229216886927397996769537406063869952
    2^366 is 'apocalyptic':
    150306725297525326584926758194517569752043683130132471725266622178061377607334940381676735896625196994043838464
    2^382 is 'apocalyptic':
    9850501549098619803069760025035903451269934817616361666987073351061430442874302652853566563721228910201656997576704
    2^384 is 'apocalyptic':
    39402006196394479212279040100143613805079739270465446667948293404245721771497210611414266254884915640806627990306816
    2^390 is 'apocalyptic':
    2521728396569246669585858566409191283525103313309788586748690777871726193375821479130513040312634601011624191379636224
    2^394 is 'apocalyptic':
    40347654345107946713373737062547060536401653012956617387979052445947619094013143666088208645002153616185987062074179584
    2^411 is 'apocalyptic':
    5288447750321988791615322464262168318627237463714249754277190362195246329890490766601513683517722278780729696200186866434048
    2^434 is 'apocalyptic':
    44362715105933037753254626946289339254982993206013065202727673289833940924890009968639590497666233249558259375382457149263586525184
    2^443 is 'apocalyptic':
    22713710134237715329666368996500141698551292521478689383796568724394977753543685103943470334805111423773828800195818060422956300894208
    2^478 is 'apocalyptic':
    780437137578998057845399307448291576437149535666242787714789239906342934704941405030076525765872992789956732780351655723861993919822071326572544
    2^497 is 'apocalyptic':
    409173825987017733751648712103449894027080255755383098685411421012016724550584319360408761540738019643860835515945008876152157068235674131666065948672
    2^499 is 'apocalyptic':
    1636695303948070935006594848413799576108321023021532394741645684048066898202337277441635046162952078575443342063780035504608628272942696526664263794688

    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: , ICQ: 134682867
     
    Wolfgang Draxinger, Sep 24, 2008
    #10
  11. Rajshekhar

    Rajshekhar Guest

    On Sep 24, 4:51 am, Wolfgang Draxinger <>
    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':
    > 6277101735386680763835789423207666416102355444464034512896
    > 2^218 is 'apocalyptic':
    > 421249166674228746791672110734681729275580381602196445017243910144
    > 2^220 is 'apocalyptic':
    > 1684996666696914987166688442938726917102321526408785780068975640576
    > 2^222 is 'apocalyptic':
    > 6739986666787659948666753771754907668409286105635143120275902562304
    > 2^224 is 'apocalyptic':
    > 26959946667150639794667015087019630673637144422540572481103610249216
    > 2^226 is 'apocalyptic':
    > 107839786668602559178668060348078522694548577690162289924414440996864
    > 2^243 is 'apocalyptic':
    > 14134776518227074636666380005943348126619871175004951664972849610340958208
    > 2^245 is 'apocalyptic':
    > 56539106072908298546665520023773392506479484700019806659891398441363832832
    > 2^247 is 'apocalyptic':
    > 226156424291633194186662080095093570025917938800079226639565593765455331328
    > 2^251 is 'apocalyptic':
    > 361850278866613110698659328152149712041468702080126762623304950024728530124­8
    > 2^278 is 'apocalyptic':
    > 485667223056432267729865476705879726660601709763034880312953102434726071301­302124544
    > 2^285 is 'apocalyptic':
    > 621654045512233302694227810183526050125570188496684646800579971116449371265­66671941632
    > 2^286 is 'apocalyptic':
    > 124330809102446660538845562036705210025114037699336929360115994223289874253­133343883264
    > 2^287 is 'apocalyptic':
    > 248661618204893321077691124073410420050228075398673858720231988446579748506­266687766528
    > 2^312 is 'apocalyptic':
    > 834369935906605500935555353972481294766681454045567488260563128055554580383­0627148527195652096
    > 2^355 is 'apocalyptic':
    > 733919557116822883715462686496667821054900796533849959596028428603815320348­31513858240593699524021969747968
    > 2^361 is 'apocalyptic':
    > 469708516554766645577896119357867405475136509781663974141458194306441805022­9216886927397996769537406063869952
    > 2^366 is 'apocalyptic':
    > 150306725297525326584926758194517569752043683130132471725266622178061377607­334940381676735896625196994043838464
    > 2^382 is 'apocalyptic':
    > 985050154909861980306976002503590345126993481761636166698707335106143044287­4302652853566563721228910201656997576704
    > 2^384 is 'apocalyptic':
    > 394020061963944792122790401001436138050797392704654466679482934042457217714­97210611414266254884915640806627990306816
    > 2^390 is 'apocalyptic':
    > 252172839656924666958585856640919128352510331330978858674869077787172619337­5821479130513040312634601011624191379636224
    > 2^394 is 'apocalyptic':
    > 403476543451079467133737370625470605364016530129566173879790524459476190940­13143666088208645002153616185987062074179584
    > 2^411 is 'apocalyptic':
    > 528844775032198879161532246426216831862723746371424975427719036219524632989­0490766601513683517722278780729696200186866434048
    > 2^434 is 'apocalyptic':
    > 443627151059330377532546269462893392549829932060130652027276732898339409248­90009968639590497666233249558259375382457149263586525184
    > 2^443 is 'apocalyptic':
    > 227137101342377153296663689965001416985512925214786893837965687243949777535­43685103943470334805111423773828800195818060422956300894208
    > 2^478 is 'apocalyptic':
    > 780437137578998057845399307448291576437149535666242787714789239906342934704­941405030076525765872992789956732780351655723861993919822071326572544
    > 2^497 is 'apocalyptic':
    > 409173825987017733751648712103449894027080255755383098685411421012016724550­584319360408761540738019643860835515945008876152157068235674131666065948672
    > 2^499 is 'apocalyptic':
    > 163669530394807093500659484841379957610832102302153239474164568404806689820­233727744163504616295207857544334206378003550460862827294269652666426379468­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: , 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':
    163669530394807093500659484841379957610832102302153239474164568404806689820­
    233727744163504616295207857544334206378003550460862827294269652666426379468­
    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 :)
     
    Rajshekhar, Sep 24, 2008
    #11
  12. Rajshekhar

    Rajshekhar Guest

    On Sep 24, 8:48 am, Rajshekhar <> wrote:
    > On Sep 24, 4:51 am, Wolfgang Draxinger <>
    > 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':
    > > 6277101735386680763835789423207666416102355444464034512896
    > > 2^218 is 'apocalyptic':
    > > 421249166674228746791672110734681729275580381602196445017243910144
    > > 2^220 is 'apocalyptic':
    > > 1684996666696914987166688442938726917102321526408785780068975640576
    > > 2^222 is 'apocalyptic':
    > > 6739986666787659948666753771754907668409286105635143120275902562304
    > > 2^224 is 'apocalyptic':
    > > 26959946667150639794667015087019630673637144422540572481103610249216
    > > 2^226 is 'apocalyptic':
    > > 107839786668602559178668060348078522694548577690162289924414440996864
    > > 2^243 is 'apocalyptic':
    > > 14134776518227074636666380005943348126619871175004951664972849610340958208
    > > 2^245 is 'apocalyptic':
    > > 56539106072908298546665520023773392506479484700019806659891398441363832832
    > > 2^247 is 'apocalyptic':
    > > 226156424291633194186662080095093570025917938800079226639565593765455331328
    > > 2^251 is 'apocalyptic':
    > > 361850278866613110698659328152149712041468702080126762623304950024728530124­­8
    > > 2^278 is 'apocalyptic':
    > > 485667223056432267729865476705879726660601709763034880312953102434726071301­­302124544
    > > 2^285 is 'apocalyptic':
    > > 621654045512233302694227810183526050125570188496684646800579971116449371265­­66671941632
    > > 2^286 is 'apocalyptic':
    > > 124330809102446660538845562036705210025114037699336929360115994223289874253­­133343883264
    > > 2^287 is 'apocalyptic':
    > > 248661618204893321077691124073410420050228075398673858720231988446579748506­­266687766528
    > > 2^312 is 'apocalyptic':
    > > 834369935906605500935555353972481294766681454045567488260563128055554580383­­0627148527195652096
    > > 2^355 is 'apocalyptic':
    > > 733919557116822883715462686496667821054900796533849959596028428603815320348­­31513858240593699524021969747968
    > > 2^361 is 'apocalyptic':
    > > 469708516554766645577896119357867405475136509781663974141458194306441805022­­9216886927397996769537406063869952
    > > 2^366 is 'apocalyptic':
    > > 150306725297525326584926758194517569752043683130132471725266622178061377607­­334940381676735896625196994043838464
    > > 2^382 is 'apocalyptic':
    > > 985050154909861980306976002503590345126993481761636166698707335106143044287­­4302652853566563721228910201656997576704
    > > 2^384 is 'apocalyptic':
    > > 394020061963944792122790401001436138050797392704654466679482934042457217714­­97210611414266254884915640806627990306816
    > > 2^390 is 'apocalyptic':
    > > 252172839656924666958585856640919128352510331330978858674869077787172619337­­5821479130513040312634601011624191379636224
    > > 2^394 is 'apocalyptic':
    > > 403476543451079467133737370625470605364016530129566173879790524459476190940­­13143666088208645002153616185987062074179584
    > > 2^411 is 'apocalyptic':
    > > 528844775032198879161532246426216831862723746371424975427719036219524632989­­0490766601513683517722278780729696200186866434048
    > > 2^434 is 'apocalyptic':
    > > 443627151059330377532546269462893392549829932060130652027276732898339409248­­90009968639590497666233249558259375382457149263586525184
    > > 2^443 is 'apocalyptic':
    > > 227137101342377153296663689965001416985512925214786893837965687243949777535­­43685103943470334805111423773828800195818060422956300894208
    > > 2^478 is 'apocalyptic':
    > > 780437137578998057845399307448291576437149535666242787714789239906342934704­­941405030076525765872992789956732780351655723861993919822071326572544
    > > 2^497 is 'apocalyptic':
    > > 409173825987017733751648712103449894027080255755383098685411421012016724550­­58431936040876154073801964386083551594500887615215706823567413166606594867­2
    > > 2^499 is 'apocalyptic':
    > > 163669530394807093500659484841379957610832102302153239474164568404806689820­­23372774416350461629520785754433420637800355046086282729426965266642637946­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: , 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':
    > 163669530394807093500659484841379957610832102302153239474164568404806689820­­
    > 233727744163504616295207857544334206378003550460862827294269652666426379468­­
    > 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 ??
     
    Rajshekhar, Sep 26, 2008
    #12
  13. Rajshekhar <> writes:

    > On Sep 24, 8:48 am, Rajshekhar <> 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.
     
    Ben Bacarisse, Sep 26, 2008
    #13
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dpi

    Random Number Generation

    dpi, Mar 13, 2006, in forum: VHDL
    Replies:
    4
    Views:
    10,231
    vipinlal
    Mar 26, 2010
  2. ANM
    Replies:
    2
    Views:
    1,456
    Thomas Schodt
    Mar 7, 2004
  3. mescaline
    Replies:
    4
    Views:
    1,393
    Cy Edmunds
    Sep 10, 2003
  4. Artyom
    Replies:
    5
    Views:
    541
    David Harmon
    Feb 8, 2004
  5. John W. Long

    HTML Generation (Next Generation CGI)

    John W. Long, Nov 22, 2003, in forum: Ruby
    Replies:
    4
    Views:
    400
    John W. Long
    Nov 24, 2003
Loading...

Share This Page