generation of Apocalyptic number

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rajshekhar

    #1

    generation of Apocalyptic number

    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
  • Wolfgang Draxinger

    #2
    Re: generation of Apocalyptic number

    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[i] = '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: hexarith@jabber .org, ICQ: 134682867

    Comment

    • Rajshekhar

      #3
      Re: generation of Apocalyptic number

      On Sep 23, 2:47 pm, Wolfgang Draxinger <wdraxin...@dar kstargames.de>
      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[i] = '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: hexar...@jabber .org, 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

      Comment

      • jacob navia

        #4
        Re: generation of Apocalyptic number

        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:

        142724769270595 988105828596944 949513638274662 4.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

        Comment

        • Ben Bacarisse

          #5
          Re: generation of Apocalyptic number

          Rajshekhar <rajshekhar3@gm ail.comwrites:
          On Sep 23, 2:47 pm, Wolfgang Draxinger <wdraxin...@dar kstargames.de>
          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.programmin g may be better sine the algorithm is not a C
          question. There may even be a more suitable group -- I don't know.

          --
          Ben.

          Comment

          • Keith Thompson

            #6
            Re: generation of Apocalyptic number

            Rajshekhar <rajshekhar3@gm ail.comwrites:
            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[i]));
            }
            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_Keit h) kst-u@mib.org <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"

            Comment

            • Wolfgang Draxinger

              #7
              Re: generation of Apocalyptic number

              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: hexarith@jabber .org, ICQ: 134682867

              Comment

              • Keith Thompson

                #8
                Re: generation of Apocalyptic number

                Wolfgang Draxinger <wdraxinger@dar kstargames.dewr ites:
                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_Keit h) kst-u@mib.org <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"

                Comment

                • Tony Mc

                  #9
                  Re: generation of Apocalyptic number

                  On Tue, 23 Sep 2008 03:17:22 -0700 (PDT), Rajshekhar
                  <rajshekhar3@gm ail.comwrote:

                  "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..!
                  This calls for wisdom. The definition of an apocalyptic number might
                  need to be updated since the discovery that the number of the beast
                  was 616 not 666 in the Oxyrhynchus Papyrus p115, the earliest evidence
                  for the text of Rev. 13:18 (3rd century). If we are looking for the
                  first few powers of 2 that contain the substring "616" in their
                  decimal representation, the values are:

                  2**64 = 184467440737095 51616
                  2**134 = 217780714829400 616616559748756 33165533184
                  2**155 = 456719261665907 161938651510223 838443642478919 68
                  2**164 = 233840261972944 466912589573234 605283144949206 87616
                  2**188 = 392318858461667 547739736838950 479151006397215 279002157056

                  I calculated those with a few lines of ruby, but I figure that is ok
                  because wisdom is more precious than rubies (Prov. 8:11).

                  Tony

                  Comment

                  • CBFalconer

                    #10
                    Re: generation of Apocalyptic number

                    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.

                    Comment

                    • Wolfgang Draxinger

                      #11
                      Re: generation of Apocalyptic number

                      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':
                      182687704666362 864775460604089 535377456991567 872
                      2^192 is 'apocalyptic':
                      627710173538668 076383578942320 766641610235544 4464034512896
                      2^218 is 'apocalyptic':
                      421249166674228 746791672110734 681729275580381 602196445017243 910144
                      2^220 is 'apocalyptic':
                      168499666669691 498716668844293 872691710232152 640878578006897 5640576
                      2^222 is 'apocalyptic':
                      673998666678765 994866675377175 490766840928610 563514312027590 2562304
                      2^224 is 'apocalyptic':
                      269599466671506 397946670150870 196306736371444 225405724811036 10249216
                      2^226 is 'apocalyptic':
                      107839786668602 559178668060348 078522694548577 690162289924414 440996864
                      2^243 is 'apocalyptic':
                      141347765182270 746366663800059 433481266198711 750049516649728 49610340958208
                      2^245 is 'apocalyptic':
                      565391060729082 985466655200237 733925064794847 000198066598913 98441363832832
                      2^247 is 'apocalyptic':
                      226156424291633 194186662080095 093570025917938 800079226639565 593765455331328
                      2^251 is 'apocalyptic':
                      361850278866613 110698659328152 149712041468702 080126762623304 950024728530124 8
                      2^278 is 'apocalyptic':
                      485667223056432 267729865476705 879726660601709 763034880312953 102434726071301 302124544
                      2^285 is 'apocalyptic':
                      621654045512233 302694227810183 526050125570188 496684646800579 971116449371265 66671941632
                      2^286 is 'apocalyptic':
                      124330809102446 660538845562036 705210025114037 699336929360115 994223289874253 133343883264
                      2^287 is 'apocalyptic':
                      248661618204893 321077691124073 410420050228075 398673858720231 988446579748506 266687766528
                      2^312 is 'apocalyptic':
                      834369935906605 500935555353972 481294766681454 045567488260563 128055554580383 062714852719565 2096
                      2^355 is 'apocalyptic':
                      733919557116822 883715462686496 667821054900796 533849959596028 428603815320348 315138582405936 995240219697479 68
                      2^361 is 'apocalyptic':
                      469708516554766 645577896119357 867405475136509 781663974141458 194306441805022 921688692739799 676953740606386 9952
                      2^366 is 'apocalyptic':
                      150306725297525 326584926758194 517569752043683 130132471725266 622178061377607 334940381676735 896625196994043 838464
                      2^382 is 'apocalyptic':
                      985050154909861 980306976002503 590345126993481 761636166698707 335106143044287 430265285356656 372122891020165 6997576704
                      2^384 is 'apocalyptic':
                      394020061963944 792122790401001 436138050797392 704654466679482 934042457217714 972106114142662 548849156408066 27990306816
                      2^390 is 'apocalyptic':
                      252172839656924 666958585856640 919128352510331 330978858674869 077787172619337 582147913051304 031263460101162 4191379636224
                      2^394 is 'apocalyptic':
                      403476543451079 467133737370625 470605364016530 129566173879790 524459476190940 131436660882086 450021536161859 87062074179584
                      2^411 is 'apocalyptic':
                      528844775032198 879161532246426 216831862723746 371424975427719 036219524632989 049076660151368 351772227878072 969620018686643 4048
                      2^434 is 'apocalyptic':
                      443627151059330 377532546269462 893392549829932 060130652027276 732898339409248 900099686395904 976662332495582 593753824571492 63586525184
                      2^443 is 'apocalyptic':
                      227137101342377 153296663689965 001416985512925 214786893837965 687243949777535 436851039434703 348051114237738 288001958180604 22956300894208
                      2^478 is 'apocalyptic':
                      780437137578998 057845399307448 291576437149535 666242787714789 239906342934704 941405030076525 765872992789956 732780351655723 861993919822071 326572544
                      2^497 is 'apocalyptic':
                      409173825987017 733751648712103 449894027080255 755383098685411 421012016724550 584319360408761 540738019643860 835515945008876 152157068235674 131666065948672
                      2^499 is 'apocalyptic':
                      163669530394807 093500659484841 379957610832102 302153239474164 568404806689820 233727744163504 616295207857544 334206378003550 460862827294269 652666426379468 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: hexarith@jabber .org, ICQ: 134682867

                      Comment

                      • Rajshekhar

                        #12
                        Re: generation of Apocalyptic number

                        On Sep 24, 4:51 am, Wolfgang Draxinger <wdraxin...@dar kstargames.de>
                        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':
                        182687704666362 864775460604089 535377456991567 872
                        2^192 is 'apocalyptic':
                        627710173538668 076383578942320 766641610235544 4464034512896
                        2^218 is 'apocalyptic':
                        421249166674228 746791672110734 681729275580381 602196445017243 910144
                        2^220 is 'apocalyptic':
                        168499666669691 498716668844293 872691710232152 640878578006897 5640576
                        2^222 is 'apocalyptic':
                        673998666678765 994866675377175 490766840928610 563514312027590 2562304
                        2^224 is 'apocalyptic':
                        269599466671506 397946670150870 196306736371444 225405724811036 10249216
                        2^226 is 'apocalyptic':
                        107839786668602 559178668060348 078522694548577 690162289924414 440996864
                        2^243 is 'apocalyptic':
                        141347765182270 746366663800059 433481266198711 750049516649728 49610340958208
                        2^245 is 'apocalyptic':
                        565391060729082 985466655200237 733925064794847 000198066598913 98441363832832
                        2^247 is 'apocalyptic':
                        226156424291633 194186662080095 093570025917938 800079226639565 593765455331328
                        2^251 is 'apocalyptic':
                        361850278866613 110698659328152 149712041468702 080126762623304 950024728530124 ­8
                        2^278 is 'apocalyptic':
                        485667223056432 267729865476705 879726660601709 763034880312953 102434726071301 ­302124544
                        2^285 is 'apocalyptic':
                        621654045512233 302694227810183 526050125570188 496684646800579 971116449371265 ­66671941632
                        2^286 is 'apocalyptic':
                        124330809102446 660538845562036 705210025114037 699336929360115 994223289874253 ­133343883264
                        2^287 is 'apocalyptic':
                        248661618204893 321077691124073 410420050228075 398673858720231 988446579748506 ­266687766528
                        2^312 is 'apocalyptic':
                        834369935906605 500935555353972 481294766681454 045567488260563 128055554580383 ­06271485271956 52096
                        2^355 is 'apocalyptic':
                        733919557116822 883715462686496 667821054900796 533849959596028 428603815320348 ­31513858240593 699524021969747 968
                        2^361 is 'apocalyptic':
                        469708516554766 645577896119357 867405475136509 781663974141458 194306441805022 ­92168869273979 967695374060638 69952
                        2^366 is 'apocalyptic':
                        150306725297525 326584926758194 517569752043683 130132471725266 622178061377607 ­33494038167673 589662519699404 3838464
                        2^382 is 'apocalyptic':
                        985050154909861 980306976002503 590345126993481 761636166698707 335106143044287 ­43026528535665 637212289102016 56997576704
                        2^384 is 'apocalyptic':
                        394020061963944 792122790401001 436138050797392 704654466679482 934042457217714 ­97210611414266 254884915640806 627990306816
                        2^390 is 'apocalyptic':
                        252172839656924 666958585856640 919128352510331 330978858674869 077787172619337 ­58214791305130 403126346010116 24191379636224
                        2^394 is 'apocalyptic':
                        403476543451079 467133737370625 470605364016530 129566173879790 524459476190940 ­13143666088208 645002153616185 987062074179584
                        2^411 is 'apocalyptic':
                        528844775032198 879161532246426 216831862723746 371424975427719 036219524632989 ­04907666015136 835177222787807 296962001868664 34048
                        2^434 is 'apocalyptic':
                        443627151059330 377532546269462 893392549829932 060130652027276 732898339409248 ­90009968639590 497666233249558 259375382457149 263586525184
                        2^443 is 'apocalyptic':
                        227137101342377 153296663689965 001416985512925 214786893837965 687243949777535 ­43685103943470 334805111423773 828800195818060 422956300894208
                        2^478 is 'apocalyptic':
                        780437137578998 057845399307448 291576437149535 666242787714789 239906342934704 ­94140503007652 576587299278995 673278035165572 386199391982207 1326572544
                        2^497 is 'apocalyptic':
                        409173825987017 733751648712103 449894027080255 755383098685411 421012016724550 ­58431936040876 154073801964386 083551594500887 615215706823567 413166606594867 2
                        2^499 is 'apocalyptic':
                        163669530394807 093500659484841 379957610832102 302153239474164 568404806689820 ­23372774416350 461629520785754 433420637800355 046086282729426 965266642637946 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: hexar...@jabber .org, 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':
                        163669530394807 093500659484841 379957610832102 302153239474164 568404806689820 ­
                        233727744163504 616295207857544 334206378003550 460862827294269 652666426379468 ­
                        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 :)

                        Comment

                        • Rajshekhar

                          #13
                          Re: generation of Apocalyptic number

                          On Sep 24, 8:48 am, Rajshekhar <rajshekh...@gm ail.comwrote:
                          On Sep 24, 4:51 am, Wolfgang Draxinger <wdraxin...@dar kstargames.de>
                          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, anumberisapocal yptic, 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 bignumbersuppor t 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':
                          182687704666362 864775460604089 535377456991567 872
                          2^192 is 'apocalyptic':
                          627710173538668 076383578942320 766641610235544 4464034512896
                          2^218 is 'apocalyptic':
                          421249166674228 746791672110734 681729275580381 602196445017243 910144
                          2^220 is 'apocalyptic':
                          168499666669691 498716668844293 872691710232152 640878578006897 5640576
                          2^222 is 'apocalyptic':
                          673998666678765 994866675377175 490766840928610 563514312027590 2562304
                          2^224 is 'apocalyptic':
                          269599466671506 397946670150870 196306736371444 225405724811036 10249216
                          2^226 is 'apocalyptic':
                          107839786668602 559178668060348 078522694548577 690162289924414 440996864
                          2^243 is 'apocalyptic':
                          141347765182270 746366663800059 433481266198711 750049516649728 49610340958208
                          2^245 is 'apocalyptic':
                          565391060729082 985466655200237 733925064794847 000198066598913 98441363832832
                          2^247 is 'apocalyptic':
                          226156424291633 194186662080095 093570025917938 800079226639565 593765455331328
                          2^251 is 'apocalyptic':
                          361850278866613 110698659328152 149712041468702 080126762623304 950024728530124 ­­8
                          2^278 is 'apocalyptic':
                          485667223056432 267729865476705 879726660601709 763034880312953 102434726071301 ­­302124544
                          2^285 is 'apocalyptic':
                          621654045512233 302694227810183 526050125570188 496684646800579 971116449371265 ­­66671941632
                          2^286 is 'apocalyptic':
                          124330809102446 660538845562036 705210025114037 699336929360115 994223289874253 ­­133343883264
                          2^287 is 'apocalyptic':
                          248661618204893 321077691124073 410420050228075 398673858720231 988446579748506 ­­266687766528
                          2^312 is 'apocalyptic':
                          834369935906605 500935555353972 481294766681454 045567488260563 128055554580383 ­­0627148527195 652096
                          2^355 is 'apocalyptic':
                          733919557116822 883715462686496 667821054900796 533849959596028 428603815320348 ­­3151385824059 369952402196974 7968
                          2^361 is 'apocalyptic':
                          469708516554766 645577896119357 867405475136509 781663974141458 194306441805022 ­­9216886927397 996769537406063 869952
                          2^366 is 'apocalyptic':
                          150306725297525 326584926758194 517569752043683 130132471725266 622178061377607 ­­3349403816767 358966251969940 43838464
                          2^382 is 'apocalyptic':
                          985050154909861 980306976002503 590345126993481 761636166698707 335106143044287 ­­4302652853566 563721228910201 656997576704
                          2^384 is 'apocalyptic':
                          394020061963944 792122790401001 436138050797392 704654466679482 934042457217714 ­­9721061141426 625488491564080 6627990306816
                          2^390 is 'apocalyptic':
                          252172839656924 666958585856640 919128352510331 330978858674869 077787172619337 ­­5821479130513 040312634601011 624191379636224
                          2^394 is 'apocalyptic':
                          403476543451079 467133737370625 470605364016530 129566173879790 524459476190940 ­­1314366608820 864500215361618 598706207417958 4
                          2^411 is 'apocalyptic':
                          528844775032198 879161532246426 216831862723746 371424975427719 036219524632989 ­­0490766601513 683517722278780 729696200186866 434048
                          2^434 is 'apocalyptic':
                          443627151059330 377532546269462 893392549829932 060130652027276 732898339409248 ­­9000996863959 049766623324955 825937538245714 9263586525184
                          2^443 is 'apocalyptic':
                          227137101342377 153296663689965 001416985512925 214786893837965 687243949777535 ­­4368510394347 033480511142377 382880019581806 042295630089420 8
                          2^478 is 'apocalyptic':
                          780437137578998 057845399307448 291576437149535 666242787714789 239906342934704 ­­9414050300765 257658729927899 567327803516557 238619939198220 71326572544
                          2^497 is 'apocalyptic':
                          409173825987017 733751648712103 449894027080255 755383098685411 421012016724550 ­­5843193604087 615407380196438 608355159450088 761521570682356 741316660659486 7­2
                          2^499 is 'apocalyptic':
                          163669530394807 093500659484841 379957610832102 302153239474164 568404806689820 ­­2337277441635 046162952078575 443342063780035 504608628272942 696526664263794 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: hexar...@jabber .org, ICQ: 134682867
                          >
                          Thanks for all the replies..
                          >
                          Let me re-frame my question,
                          >
                          Write a program which tests theApocalypticn umber.
                          AnApocalypticnu mberis:
                              "Anumberof the form 2^n that contains the digits 666 (i.e., the
                          beastnumber) is called anapocalypticnu mber.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 formapocalyptic number
                          or not.
                          >
                          So here my data type should be capable enough to hold for any (dynamic
                          in nature)poweredn umberwhich may run into 50's
                          or 100' digits of generated out of 2^n.
                          >
                          FOr example like
                          2^499 is 'apocalyptic':
                          163669530394807 093500659484841 379957610832102 302153239474164 568404806689820 ­­
                          233727744163504 616295207857544 334206378003550 460862827294269 652666426379468 ­­
                          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 ??

                          Comment

                          • Ben Bacarisse

                            #14
                            Re: generation of Apocalyptic number

                            Rajshekhar <rajshekhar3@gm ail.comwrites:
                            On Sep 24, 8:48 am, Rajshekhar <rajshekh...@gm ail.comwrote:
                            <snip>
                            >Let me re-frame my question,
                            >>
                            >Write a program which tests theApocalypticn umber.
                            >AnApocalypticn umberis:
                            >    "Anumberof the form 2^n that contains the digits 666 (i.e., the
                            >beastnumber) is called anapocalypticnu mber.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.

                            Comment

                            Working...