Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » dosbert2001's name

This thread is locked; no one can reply to it. rss feed Print
dosbert2001's name
Bruce Perry
Member #270
April 2000

W AH, that's s freaky! In maths club today, I offered that decreasing bases puzzle. They got it with a little (read: lots of) help from me... but then my teacher just came out with 1, 11, 21, ... - that exact same puzzle! I still didn't figure it out without help...
Anyway, here's a little program to churn them out... (my maths teacher thought, if anyone could do it, I could... )
code:
#include <conio.h>
#include <stdio.h>
char str1i[256] = "1";
char str2i[256];
char *str1 = str1i;
char *str2 = str2i;
int main() {
puts(str1);
while (getch() != 27) {
char *p1 = str1;
char *p2 = str2;
char n, c;
while (*p1) {
c = *p1;
n = 0;
while (*p1 == c) {n++; p1++;}
p2[0] = '0' + n;
p2[1] = c;
p2 += 2;
if (p2 - str2 >= 256) {puts("Too long."); return 0;}
}
*p2 = 0;
puts(str2);
(int)str1 ^= (int)str2;
(int)str2 ^= (int)str1;
(int)str1 ^= (int)str2;
}
return 0;
}
Anyway, they thought my puzzle was too hard. Someone offered this puzzle. See if you can get it...
1, 2, 6, ?
This is a set of only four numbers. What is the last number?

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

Bruce Perry
Member #270
April 2000

Quote:

(there also would be an infinite number of prime numbers ,and i heart a rumor somewhere that there aren't any more prime numbers beond 10^10^10^10^10^10 or so,just a rumor,i should ask one of the mathematicians)

Someone like me? :D

Let p1,p2,p3,...,pn be the first n prime numbers (p1=2,p2=3,p3=5,...).

q = p1*p2*p3*...*pn

q is therefore divisible by all the prime numbers up to pn. So q + 1 divided by any prime number up to pn gives a remainder of 1, so q + 1 is prime.

Therefore, given a set of all prime numbers up to a particular size, there will always be another prime number that's greater.

Hence there are an infinite number of primes.

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

23yrold3yrold
Member #1,134
March 2001
avatar

Man, I feel so stupid when someone goes into math theory mode like that. I understand it, but I couldn't have come up with it to save my miserable life.

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

bill_mcniff
Member #1,105
March 2001

I found this cool website with a nice free engine. with similar to C style code its called VERGE maybe some of you have heard of it VERGE ENGINE WEBSITE
The page also has some quality *FINISHED* RPGs. Nice engine I might make a game with it. after I finish with this one

Shade
Member #1,152
April 2001
avatar

bdavis:
let's see
1,2,6,??
that could be 24(row of x!)
that could be 42(next=previous + sqr(previous)
hell i don't know.
quote: quote:
--------------------------------------------------------------------------------
(there also would be an infinite number of prime numbers ,and i heart a rumor somewhere that there aren't any more prime numbers beond 10^10^10^10^10^10 or so,just a rumor,i should ask one of the mathematicians)
--------------------------------------------------------------------------------
Someone like me?
no i meant someone of the mathematicians in my class who went to all courses of philosophy and still remember
greetz
Shade

X-G
Member #856
December 2000
avatar

Umm... 16? (two previous numbers times two.. of course, this assumes the non-existant number before 1 is zero)

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Bruce Perry
Member #270
April 2000

Those solutions are all very well, but they don't explain why the number you have to find is the only other number in the set.

Any more suggestions?

Clue: a kid could do this ;)

23yrold3yrold: Don't worry, I didn't come up with that. I just quoted it :D

:D Hmm, I like this big grin :D

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

Bob
Free Market Evangelist
September 2000
avatar

This is still about 1,2,6...? Ok, I'll give it a shot. I'd say 12, and here's why:
if we divide each number in the series by it's current position (starting at 1), we get:
1/1,2/2,6/3,... = 1,1,2,...
Looks like Fibonacci to me. So of course, then next one is 3, times its position, which is 4. So that's 12.
(edit: spelling)
[ May 22, 2001: Message edited by: Bob ]

--
- Bob
[ -- All my signature links are 404 -- ]

Bruce Perry
Member #270
April 2000

Nope. How can you be sure that's the last number in the set?

Hehe, I seem to have you all baffled. And this is S :o simple! :D You must think in the way you thought when you were THREE (*wink* wink, that has a triple meaning :D :D )

[ May 22, 2001: Message edited by: bdavis ]

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

PrimeSide
Member #687
September 2000

Ooh! ooh! Is it 10? One has three letters, two is the next to have three letters, then six, and lastly ten.

Goodbytes
Member #448
June 2000
avatar

Hey! I get it! The last number is 3! ;)


--
~Goodbytes

Goodbytes
Member #448
June 2000
avatar

Well, PrimeSide seems to have it figured out, so here's a new puzzle that I made up(I feel so special that I made it up )
What is the next number in the series?
51
27
11
This one is really tough(it took me a while to figure out after I invented it ), so I'll give you a cryptic hint or two:
- You have to convert these numbers to a different base.
- Make sure to split the converted numbers into two small bites.


--
~Goodbytes

Bruce Perry
Member #270
April 2000

Congratulations, PrimeSlide!
So the three meanings were:
1. Think like a kid;
2. The words are three letters long;
3. I wrote 'THREE' rather than '3' to suggest writing numbers out.
I had no idea the threefoldness of the meanings would incite Goodbytes to guess 3. I really feel like Commander Data now, with all these conspicuous references to the number 3...

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

Goodbytes
Member #448
June 2000
avatar

bdavis: H3y! I was only joking!!!!!3 ;3


--
~Goodbytes

lambik
Member #899
January 2001
avatar

Heh, I would never have guessed that one.
1 Een
2 Twee
6 Zes
10 Tien

X-G
Member #856
December 2000
avatar

goodbytes:
Blind guess: 5 ?
Since a "bite" is likely a "nibble", which is half a byte, I converted it into binary. Appears the HO nibble was shifting its bits to the right. After decimal 11, which is binary 00001011 (HO nibble rsh:ed all the way), we try shifting the LO nibble, which turns to binary 101 = decimal 5.
edit: typo
[ May 23, 2001: Message edited by: X-G ]

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Shade
Member #1,152
April 2001
avatar

and another one...
Ones upon a time there was a city ,surrounded by a big wall and with only one gate.To enter this city you have to tell the guard the secret number.So to find out what the secret number is you hide yourself in the bushes and listen to what the people and the guard say:
G:5
P1:4
when the next person arives
G:7
P2:5
and the next
G:11
P3:6
and now it's your turn
G:12
YOU:???

and for those of you who can thing multidimensional:How many ribs has a 4-dimensional cube(3D has 12 ribs(ribs=lines between the points of the object,i'm not sure what the actual translation is))?

shade

Shade
Member #1,152
April 2001
avatar

X-G:nemo custudiet ipsos custudes.
i just couldn't resist
Shade

lambik
Member #899
January 2001
avatar

Lucky guess: 7?

Shade
Member #1,152
April 2001
avatar

Nope,it's not seven.
(i forgot to say the people who come at the gate don't know anything about the previous person)
Try again
Shade

Bruce Perry
Member #270
April 2000

Hmm...
Shade: we just call them 'edges'
Let E(n) be the number of edges and V(n) be the number of vertices in an n-dimensional cube.
For n >= 2, we take two (n-1)D hypercubes and connect each vertex in one to the corresponding vertex in the other to create the nD hypercube.
V(n) = 2 V(n-1)
E(n) = 2 E(n-1) + V(n-1)
For n = 1, we have a line connecting two vertices. Thus we can form the sequence:
V(1) = 2, E(1) = 1
V(2) = 4, E(2) = 4
V(3) = 8, E(3) = 12 (as expected for a cube)
V(4) = 16, E(4) = 32
Thus a 4D hypercube has 32 edges.

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

Shade
Member #1,152
April 2001
avatar

thx bdavis,i was also concidering the word verticles(but that would have been really wrong)
anyone else who wants/has multidimensional riddles??
Shade(i really should be studying my astronomy )

Goodbytes
Member #448
June 2000
avatar

X-G: Nope
You were right with the nybbles(it's spelled with a y though I think). You have to convert the numbers into binary, and then separate them into nybbles. The rest should be easy...


--
~Goodbytes

Bruce Perry
Member #270
April 2000

Shade, you're into astronomy? Then I have a question (not a puzzle, a question ;) ):

I have a game where the stars are placed as in real life; all the constellations are there. However, I seriously doubt that my stopgap solution has placed the stars at their correct distances.

So either:

1. Do you know of a downloadable star catalogue containing the distance of each star, or:

2. Do you know of one with sufficient information to work it out, and how would I do this?

Thanks 8-)

[ May 23, 2001: Message edited by: bdavis ]

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

Bruce Perry
Member #270
April 2000

Goodbytes: it seems it's optional; you can have 'nibble' or 'nybble' ;) www.dictionary.com/cgi-bin/dict.pl?term=nybble

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.



Go to: