473,407 Members | 2,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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
Sep 23 '08 #1
13 2195
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: he******@jabber.org, ICQ: 134682867

Sep 23 '08 #2
On Sep 23, 2:47*pm, Wolfgang Draxinger <wdraxin...@darkstargames.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
Sep 23 '08 #3
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
Sep 23 '08 #4
Rajshekhar <ra*********@gmail.comwrites:
On Sep 23, 2:47Â*pm, Wolfgang Draxinger <wdraxin...@darkstargames.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.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.
Sep 23 '08 #5
Rajshekhar <ra*********@gmail.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_Keith) ks***@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"
Sep 23 '08 #6
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: he******@jabber.org, ICQ: 134682867

Sep 23 '08 #7
Wolfgang Draxinger <wd********@darkstargames.dewrites:
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) ks***@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"
Sep 23 '08 #8
On Tue, 23 Sep 2008 03:17:22 -0700 (PDT), Rajshekhar
<ra*********@gmail.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 = 18446744073709551616
2**134 = 21778071482940061661655974875633165533184
2**155 = 45671926166590716193865151022383844364247891968
2**164 = 23384026197294446691258957323460528314494920687616
2**188 = 39231885846166754773973683895047915100639721527900 2157056

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
Sep 23 '08 #9
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.
Sep 23 '08 #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':
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 67626233049500247285301248
2^278 is 'apocalyptic':
48566722305643226772986547670587972666060170976303 4880312953102434726071301302124544
2^285 is 'apocalyptic':
62165404551223330269422781018352605012557018849668 464680057997111644937126566671941632
2^286 is 'apocalyptic':
12433080910244666053884556203670521002511403769933 6929360115994223289874253133343883264
2^287 is 'apocalyptic':
24866161820489332107769112407341042005022807539867 3858720231988446579748506266687766528
2^312 is 'apocalyptic':
83436993590660550093555535397248129476668145404556 74882605631280555545803830627148527195652096
2^355 is 'apocalyptic':
73391955711682288371546268649666782105490079653384 99595960284286038153203483151385824059369952402196 9747968
2^361 is 'apocalyptic':
46970851655476664557789611935786740547513650978166 39741414581943064418050229216886927397996769537406 063869952
2^366 is 'apocalyptic':
15030672529752532658492675819451756975204368313013 24717252666221780613776073349403816767358966251969 94043838464
2^382 is 'apocalyptic':
98505015490986198030697600250359034512699348176163 61666987073351061430442874302652853566563721228910 201656997576704
2^384 is 'apocalyptic':
39402006196394479212279040100143613805079739270465 44666794829340424572177149721061141426625488491564 0806627990306816
2^390 is 'apocalyptic':
25217283965692466695858585664091912835251033133097 88586748690777871726193375821479130513040312634601 011624191379636224
2^394 is 'apocalyptic':
40347654345107946713373737062547060536401653012956 61738797905244594761909401314366608820864500215361 6185987062074179584
2^411 is 'apocalyptic':
52884477503219887916153224642621683186272374637142 49754277190362195246329890490766601513683517722278 780729696200186866434048
2^434 is 'apocalyptic':
44362715105933037753254626946289339254982993206013 06520272767328983394092489000996863959049766623324 9558259375382457149263586525184
2^443 is 'apocalyptic':
22713710134237715329666368996500141698551292521478 68938379656872439497775354368510394347033480511142 3773828800195818060422956300894208
2^478 is 'apocalyptic':
78043713757899805784539930744829157643714953566624 27877147892399063429347049414050300765257658729927 89956732780351655723861993919822071326572544
2^497 is 'apocalyptic':
40917382598701773375164871210344989402708025575538 30986854114210120167245505843193604087615407380196 43860835515945008876152157068235674131666065948672
2^499 is 'apocalyptic':
16366953039480709350065948484137995761083210230215 32394741645684048066898202337277441635046162952078 57544334206378003550460862827294269652666426379468 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: he******@jabber.org, ICQ: 134682867

Sep 23 '08 #11
On Sep 24, 4:51*am, Wolfgang Draxinger <wdraxin...@darkstargames.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':
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: 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':
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 :)

Sep 24 '08 #12
On Sep 24, 8:48*am, Rajshekhar <rajshekh...@gmail.comwrote:
On Sep 24, 4:51*am, Wolfgang Draxinger <wdraxin...@darkstargames.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, 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: hexar...@jabber.org, 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 ??
Sep 26 '08 #13
Rajshekhar <ra*********@gmail.comwrites:
On Sep 24, 8:48Â*am, Rajshekhar <rajshekh...@gmail.comwrote:
<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.
Sep 26 '08 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

51
by: Mudge | last post by:
Please, someone, tell me why OO in PHP is better than procedural.
0
by: Rasmus Fogh | last post by:
Someone raised the question of automatic code generation a few weeks back. And yes, we (CCPN) are using automatic Python code generation in a major way. Basically we are making data models in...
10
by: Ioannis Vranos | last post by:
I want to create some random numbers for encryption purposes, and i wonder if the following scheme makes it more hard to guess the underneath number generation pattern, than the plain use of...
11
by: Marco Loskamp | last post by:
Dear list, I'm trying to dynamically generate functions; it seems that what I really want is beyond C itself, but I'd like to be confirmed here. In the minimal example below, I'd like to...
4
by: Dimos | last post by:
Hello All, I need some help with random number generation. What I need exactly is: To create a few thousand numbers, decimal and integers, between 5 and 90, and then to export them as a...
0
by: Dilip | last post by:
hi ppl , i need some help in generating barcode text thro FOP .. i am succesfull in creating a input number as a barcode value.. but the problem is i need the barcode to be displayed vertically...
6
by: kossanah | last post by:
I like to seek to your assistance in any measure.I need your help on how to go about This: I am developing a promotional site where user will be issued a ticket(manually) which will be a...
22
by: gagan.singh.arora | last post by:
Hi there. I want to generate random numbers with a given probability, say 80% even and 20% odd. Is it possible to implement such an algorithm in C?
6
by: Fan924 | last post by:
How do I add random number generation to this background image slide show? Everything I try kills if. TIA _____________________________________ <html> <head> <meta http-equiv="Content-Type"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.