yashsingh1/xdaforums huggingface dataset:
[Off-topic] stephj:
OK. I admit the number puzzle is a bit of a tester, and you may still need a bit of help from a computer to solve it, but thinking about it first, pays dividends and can turn it into a more manageable task. Also approaching the problem from a slightly different angle helps.

A brute force attack will need to examine all combinations of the digits 1 to 9 = 9*8*7*6*5*4*3*2 = 9! = 362880 combinations, but let's think about it first.

As one number is the square of the other, and all digits 1 to 9 must be used, then the number to be squared is 3 digits long and the result is 6 digits long.

So, concentrate your efforts onto the three digit number.

To create at least a six digit square it must be greater than 316. It must also be less than 947, if it is greater than this then the square number will also start with a nine. Numbers outside this range can be ignored.

Any number in this range that has a zero in it, or two or more digits the same can also be discarded.

Also any number in this range that ends in either a one, a five or a six can also be discarded, as it will also result in a square that ends in a one, a five or a six respectively.

In the table below, if the number ends in the first digit below, then the square will end in the second digit.

2->4

3->9

4->6

7->9

8->4

9->1

So, if the the three digit number ends in the first column, but the first or second digit is the same as the associated number in the second column, this number can also be discarded.

Of the 632 trial numbers between 316 and 947, we have now whittled them down to 172. A lot less than 362880!

The file numbers.txt, included, has this list of 172 numbers, and their squares. Two of those numbers are the answer to the original puzzle.

Who is going to spot them?
[Off-topic] 4silvertooth:
^^

//Xda puzzle solver HaHa

#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main ()
{
string line;
ifstream myfile ("numbers.txt");

if (myfile.is_open())
{
while ( myfile.good() )
{
getline (myfile,line); //get one by one all the lines
for(char i='1'; i<='9'; i++) //Iterating all digits.
{
if(line.find(i)!=string::npos)
{
if(i=='9') cout << line << endl; //Found all the digits.
}
else break; //If can not find digit just get out
}
}
myfile.close();
}
else cout << "Unable to open file"; //Where's the numbers.txt
return 0;
}

And the answer is...

567 321489

854 729316
[Off-topic] stephj:
Well done!

Here's the 'C' source to do a brute force attack in one go.

#include <stdio.h>
#include <string.h>

void genanag(char *laststring,char *insert);

char original[]="987654321";

int	length;

main()
{
char start[2];

strncpy(start,original,1);
start[1]='\0';
length=strlen(original);
genanag(start,&original[1]);
return 0;
}

void genanag(char *laststring,char *insert)
{
char newstring[12];
int	i,len;
long x,y,z;

len=strlen(laststring);
for(i=0;i<=len;i++)
{
strncpy(newstring,laststring,i);
newstring[i]=*insert;
newstring[i+1]='\0';
strcat(newstring,&laststring[i]);

if(strlen(newstring)==length)
{
sscanf(newstring,"%ld",&x);
y=x/1000;
z=x%1000;
if(z*z==y)
printf("%ld %ld\n",z,y);

}
else
genanag(newstring,&original[len+1]);
}
}

genanag() is a recursive routine to produce all 9! combinations of the original string. Convert it into a long integer then split it into the 3 and 6 digit numbers. If the 6 is the square of the 3 then print it out.
[Off-topic] stephj:
The reason I wrote it in C/C++, is that I have been coding in it for that long it's second nature. I can almost think in it. It was modified from a chunk of code I wrote years ago.

Here's the VB equivalent........ Not a great deal of difference from the 'C'

Module Module1

Dim Original As String = "987654321"
Dim StrLen As Integer

Sub Main()

Dim Start As String

StrLen = Original.Length
Start = Original.Substring(0, 1)
GenAnag(Start, Original.Substring(1, 1))

End Sub

Sub GenAnag(ByRef LastString As String, ByRef Insert As String)
Dim NewString As String

Dim i, len As Integer
Dim x, y, z As Long

len = LastString.Length

For i = 0 To len
NewString = LastString.Substring(0, i)
NewString += Insert
NewString += LastString.Substring(i)

If (StrLen = NewString.Length) Then
x = Long.Parse(NewString)
y = x \ 1000
z = x Mod 1000
If (z * z = y) Then
Console.WriteLine(z & " " & y)
End If
Else
GenAnag(NewString, Original.Substring(len + 1, 1))
End If
Next
End Sub

End Module
[Off-topic] stephj:
Meanwhile............

Back in post #389 we had the story of the two guards, one of which lies and the other who tells the truth.

On a remote Pacific island, there are three tribes, the Good, the Bad and the Indifferent.

The Good tribe always tell the truth, The Bad tribe always lie, and the Indifferent tribe just couldn't care less, so they lie and tell the truth alternately, although their first statement may be the truth or a lie.

The islanders always wander about in groups of three, one from each tribe.

Your conversation after encountering such a group, and speaking to the first islander of the three, goes as follows:

'Are you Good, Bad or Indifferent?'

'I am Indifferent.'

'And what about your friend here?'

'He's Bad.'

'So your other friend is Good?'

'Of Course.'

Who's who?

1) First islander

2) Friend

3) Other Friend
[Off-topic] Dirk:
I've got:

1) Bad

2) Good

3) Indifferent

Workings out:

1) Ind/Bad

2) Good/Ind

3) Ind

Starting with the premise that the first question was answered with an obvious lie, it narrowed down the first one to two choices. Started with Bad out of the two and process of elimination from there!

Edit: not sure that works thinking about it more...

Edit2 yep still works. First one can't be Good so process of elimination still works!
[Off-topic] stephj:
Correct!

If the first islander is Indifferent, he contradicts himself one way or the other, and he can't be Good because he'd be lying. The rest falls into place.

Well done!
[Off-topic] Dirk:
Q) There are 3 switches downstairs, each corresponding to one of the light bulbs upstairs. How can you figure out which light switch goes to which light bulb by only making 1 trip upstairs?

Answers on a postcard..
[Off-topic] Archer:
With a series of mirrors ;)

Nah, I like this. Gonna get my thinking head on.
[Off-topic] Dirk:
Correct. One light bulb will be cold, one will be warm, and one will be on.

Well done.
[Off-topic] stephj:
On the City and Seaside Railway, every railway station sells its own preprinted tickets.

As an example.

From: Oakwood

To: Chalk Downs

Each ticket has the start and end of the trip printed on it.

Due to the expanding urbanization of the city end of the line, some additional stations were created.

The result was, than 50 extra sets of tickets had to be printed.

How many stations did there used to be, and how many have been added?
[Off-topic] 4silvertooth:
I am assuming for two station there will be two sets of tickets.

1. From: Oakwood To: Chalk Downs

2. From: Chalk Downs To: Oakwood

The R numbers of tickets required will be..

R = required tickets.

S = number of stations.

R = S x (S-1)

(8x(8-1)) - (3x(3-1)) = 50 <- New tickets printed.

^Total........^Old

That turns out to be 3 old stations and 8-3 = 5 new added.
[Off-topic] stephj:
Well spotted, 4silvertooth!

I hadn't noticed that 50 extra sets of tickets would provide another solution, but it does!

An oversight on my part. I didn't test actually adding more stations than you have to start with. My apologies.

Another solution is with 25 stations and adding one, but the problem states that 'stations' were added.

So that leaves us with one more solution, this time revealing far more 'realistic' results....................
[Off-topic] Archer:
There were 12 stations, but there are now 14.

(14 * 13) - (12 * 11) = 182 - 132 = 50
[Off-topic] stephj:
That's the original solution I had in mind. Well done!

The City and Seaside Railway doesn’t carry just passengers, the odd bit of freight trundles along too.

How long does it take two freight trains each 1/6 mile long to pass each other if they are both travelling at 30 mph?

To clarify, it is the time between the locomotives passing each other, and the brake vans passing each other.

If you are more used to U.S. railroad terminology, a brake van is better known as a caboose.
[Off-topic] 4silvertooth:
Let's say the first train is stationary, than the relative speed of second will be 60 MPH or 1 mile in 1 minute, and will have to cover distance 1/6 + 1/6 = 2/6 = 1/3.

At 1 mile per minute to cover 1/3 of mile will require 1/3 of minute.

That's 20 seconds.

Did i miss something. I know there will be some complex way of solving this but i am posting the every hard problem has simple solution type answer.
[Off-topic] stephj:
Well done, and that's as good a way as any to figure it out.

Alternatively, if you were stood at the exact point where the locomotives cross, you would also see the brake vans cross each other, after an interval which the train takes to travel its own length, at 30 mph. The same answer appears, being that of 20 seconds.

With this problem, all rails lead to Rome, as it were.
[Off-topic] Dirk:
Q) What was the first man-made object to travel at the speed of sound?
[Off-topic] newter55:
A whip?

10 char
[Off-topic] husam666:
a scream, talking...etc
[Off-topic] Dirk:
Correct!

Actually, more correct when you think about it! Man makes sound. Sound travels at speed of sound, ergo, correct! :cool:
[Off-topic] husam666:
or maybe waving a stick is prior to the whip :p
[Off-topic] newter55:
I liked husam's answer as well, even though our voices are not "objects". Creative thinking!
[Off-topic] Dirk:
What does everyone make of this..?
[Off-topic] Archer:
First off, you need to figure the correct answer. Since there are 4 answers that means you have a 1 in 4 chance of being correct. Therefore, the answer is either A or D, but that then means you have a 50% chance of being correct, so the answer is B, but that means there is only one correct answer, so the answer is either A or D, but that then means you have a 50% chance of being correct, so the answer is B, but that means there is only one correct answer, so the answer is either A or D, but that then means you have a 50% chance of being correct, so the answer is B, but that means there is only one correct answer, so the answer is either A or D, but that then means you have a 50% chance of being correct, so the answer is B, but that means there is only one correct answer, so the answer is either A or D, but that then means you have a 50% chance of being correct, so the answer is B, but that means there is only one correct answer, so the answer is either A or D, but that then means you have a 50% chance of being correct, so the answer is B, but that means there is only one correct answer, so the answer is either A or D, but that then means you have a 50% chance of being correct, so the answer is B, but that means there is only one correct answer, so the answer is either A or D, but that then means you have a 50% chance of being correct, so the answer is B, but that means there is only one correct answer, so my head explodes.
[Off-topic] xaccers:
You are evil
[Off-topic] Dirk:
Lulz, mine too! :D

:D

It's gotta be a nonsense puzzle though, right? I think Archer managed to demonstrate that well. Perhaps it was used to explain some sort of paradox?
[Off-topic] xaccers:
There is probably a mathematical formula to answer it, but it's beyond me.
[Off-topic] stephj:
On the City and Seaside Railway, the final section is a length of single track. Because of a slight operational error, they have run into the following situation:

--|
/
------aaA-------------------Bbb-------

Eastbound train A with its two coaches (aa), has met westbound train B with its two coaches (bb), either side of a short siding.

Access into the siding is via a single set of points, (US-Switch), only from the west->east direction.

The siding is just long enough to accomodate the locomotive and one coach.

How do you get the trains past each other, within the track section depicted above?
[Off-topic] Archer:
Can A & B pull as well as push (I assume they can)?
[Off-topic] Dirk:
...

Edit: Hang on, there's a flaw in my solution..

Edit 2: Nice puzzle btw!
[Off-topic] stephj:
To make this reply at least 10 characters long, the answer is yes.
[Off-topic] Dirk:
Am i right in assuming that the engines need to end up with the carriages they originally started with?
[Off-topic] stephj:
Affirmative.
[Off-topic] Archer:
AHHH!!!! I need an abacus to work this out. I get so far in my head and then lose track. Paper and pen is definitely needed.

Edit: Can they end up pushing, or do they need to end up exactly the same as they started?
[Off-topic] stephj:
They can pull and push coaches about, but they end up like this.

--|
/
------Bbb-------------------aaA-------
[Off-topic] Dirk:
I've already gone through a ream of paper on this... :o

I've got it but i don't know how to explain it without going on forever...

Edit: goddam it, i've got my workings out on paper but trying to explain it the whole process has gone right out of my head. Now it just looks like a bunch of gobbledegook. :mad:

*sigh.
[Off-topic] stephj:
It can be done in around 10 movements, a movement being a single run forward or backward.
[Off-topic] Dirk:
Ok, i've done it again on paper, once i managed to get my brain back on task, and again it works, but i still can't write it out without my brain losing the plot!!

If you can make head or tail of what i did there you will see that the end result is correct.

It's the same problem i always have in processing thought. Everything works fine in my brain, but i seem to have an impediment translating thoughts to speech, which is why my posts often have a weird kinda cadence to them.

Edit: It's basically a speech impediment, right? It's bugging me now coz it's something i've always had but never dealt with. A complete inability to engage brain and mouth at the same time. The more i have to think about something the harder it is for me to vocalise it. If you guys had any idea how much i have to re-edit my posts to make them sound coherent some times...:mad:

It gets worse when i'm trying to relate something to somebody, and it's like my thoughts run into a brick wall. I stop in the middle of a sentence and can't for the life of me get another word out. My train of thought completely derails, compounded by the embarassment of being in that situation, so that i usually end up re-forming a thought on the fly in terms that made me sound like a pre-schooler.

This is why i'm really quiet in real life. People think i'm aloof, which i am, but really it's because i can't have a conversation. Whatever insightful comments i may make as a contribution get completely lost in translation. Herp Derp is the usual outcome. I sound like a moron.

At least online i get the chance to edit a post into something resembling real English without people knowing i did it. Editing your sentences on the fly in the real world doesn't work so well!
[Off-topic] xaccers:
Do you also get it when writting with a pen? Find yourself starting a word 2nd letter in?

It's a sign of a fast brain, your body can't keep up with it.

Typing helps because it's fingers on keys so is much quicker.

Here's a puzzle.

A man lives on the 84th floor of a tower block.

Each morning he gets in the lift, goes down to the lobby and heads off to work.

At the end of the day he takes the lift and goes up to the 64th floor, gets out and walks the rest of the way up the stairs.

Why?
[Off-topic] Dirk:
That puzzle is a part of my Lateral Puzzle reportoire, so i'll let somebody else have a stab at it.

Don't know about fast brain. It's more like an inability to think and speak simultaneously. Writing too. Words flow when i don't think about what i'm writing. Engage brain and it goes to ****. I can write a great novel in my head but put pen to paper and i'll re-write a paragraph a hundred times before it comes out the same.

Some of it is confidence/being self-conscious. Chicken and egg now though. Which came first? Alcohol helps, at least with the last part. There's been a few drunken times where i've been the polar opposite and found myself entertaining a large group of people at parties and having them eating out of my hand. Very rare now, especially as i don't socialise at all any more.

In the real world it's a huge challenge. On the rare occassion where i'm engaging to talk to people come to expect that level of conversation all the time. It usually goes the other way and people think i've gotten 'strange' with them. It's been the doom of all my relationships. I end up with someone i just can't talk to for love or money. Same with friends and family. I have none of the former and i never speak to the latter.

Probably more to that than speech impediments though. Therapists wet dream i should expect! Anyway, i have my online friends and i can edit to my hearts content without appearing like a total dumbass, so yeay for teh internetz! :)
[Off-topic] Archer:
Bit of a guess here, but I do notice that you don't say what floor he gets in the lift. Is it that the lift doesn't go up to the top and he actually walks down to the 64th floor each morning?
[Off-topic] Archer:
Most people think in words in their head, as if they're speaking things aloud. That slows the thought process to that of speech and it makes it easier for them to express their thoughts coherently. Some of us (it sounds like you and I know I do it) think thought instead, and that's too fast for our bodies to keep up with. A lot of people will be thinking "Eh? What's he on about", and to those people I would suggest just trying to think to yourself without using words. You can do whole paragraphs in split seconds!
[Off-topic] xaccers:
Nope, sorry, he gets in the lift on the 84th floor, there are an irrelevant number of floors above his and the lift goes to every floor and never breaks down.
[Off-topic] Dirk:
That explains it a little, i.e i see a concept in an instant that would take a paragraph to explain. My English is excellent. I know a vast spectrum of words and i think using them. Try to put vocalise the same and i'm back to pre school level. There's some serious wiring problems there.

Here's a puzzle of sorts. Perhaps some of you would be kind enough to take the test and report your results?

http://www.wired.com/wired/archive/9.12/aqtest.html

I'll tell you now, that having found this test from another forum, the average results on that forum thread were slightly off from the norm. I explain that by reason of tech forumites may have slightly anti-social/anal/OCD tendencies as a whole.

My personal result was way off the curve. I'll tell you what i score at once a few of you have taken the test for yourselves. If you'll be so kind...

Edit: This deserves a fun thread of it's own....
[Off-topic] newter55:
42 here dirk. :/
[Off-topic] stephj:
What we may need, is some form of notation that allows to present this stuff.

Using a similar method to the original post, here are the the first two movements.

I have used the Code tag, because it automatically presents the text in a fixed width font.

--|
/
------aaA-------------------Bbb-------

--|
/
------aaA--Bb-----------------b-------

Bb|
/
------aaA---------------------b-------
[Off-topic] Dirk:
Not far from me!

Nothing to panic over though. Just means our strengths differ from the norm. In my experience it means that you are way better at some things than 99% of the general population. If you know what those things are you are well on the way to being a success.

Steve Jobs, for example, showed classic signs of Autism if you look hard enough. If you look in the right places you could say the same for any number of driven and successful people. Being able to focus on one single thing can make you an expert in any field, and experts make money!
[Off-topic] newter55:
Meh, not panicking. Realized long ago that I am not "normal". The main problem I have is after focusing intently on doing something well, I get bored and want to do something entirely different. Antisocial issues are overcome with some alcohol when I need to. :)
[Off-topic] Dirk:
Isaac Newton focused on Alchemism when he wasn't busy working out the Laws Of Motion, and 'discovering' Gravity. He never had much success turning Lead into Gold but he did pretty well with the rest of it!

He was regarded as a pretty odd fish by the establishment too. :)
[Off-topic] 4silvertooth:
If 25% is the correct answer you have 50% chance to be correct.

Else 25% chance of being correct.
[Off-topic] 4silvertooth:
Answer to the train shunting puzzle.

--|
/
------aaA-------------------Bbb-------

--|
/
------aaA--Bb-----------------b-------

Bb|
/
------aaA---------------------b-------

Bb|
/
------------------aaA---------b-------

--|
/
------Bb----------aaA---------b-------

--|
/
------Bb--aaA-----------------b-------

--|
/
-------Bb-aa-----------------Ab-------

Ab|
/
-------Bb-aa--------------------------
-b|
/
-------Bb-aaA-------------------------

-b|
/
-------Bb--------aaA------------------

-b|
/
-------------------Bb-------aaA-------

Bb|
/
--------------------b-------aaA-------

--|
/
------------------Bbb-------aaA-------

---------- Post added at 11:21 AM ---------- Previous post was at 11:09 AM ----------

My AQ score is 26 is it bad?
[Off-topic] Dirk:
Perhaps slightly above normal, but healthy enough! :)
[Off-topic] 4silvertooth:
Maybe he is short in height and can reach 64 button.
[Off-topic] xaccers:
Correct :)
[Off-topic] stephj:
That's near enough. Well done!

In practice a locomotive can both pull and push at the same time, so you would not disconnect rolling stock, if you don't need to do it. Too much like hard work!

Note that train A stays intact throughout.

--|
/
------aaA-------------------Bbb-------

--|
/
------aaA--Bb-----------------b-------

Bb|
/
------aaA---------------------b-------

Bb|
/
---------------------------aaAb-------

--|
/
------Bb-------------------aaAb-------

--|
/
------Bb-aaAb-------------------------

-b|
/
------Bb-aaA--------------------------

-b|
/
------Bb--------------------aaA-------

--|
/
------Bbb-------------------aaA-------
[Off-topic] 4silvertooth:
But that way the engine at one point is in middle of boogies, i discarded that situation.
[Off-topic] Dirk:
Familial relations.

My Mothers Brother-in law is also her Father-in law.

Explain!
[Off-topic] hiu115:
Incest. The end.
[Off-topic] stephj:
The dispatcher on the City and Seaside Railway, appears to have slipped up yet gain.

He has let westbound freight train F, with its five freight cars (fffff) depart before the much faster passenger service (P) with its six coaches (pppppp).

In the UK, passenger trains have priority, and it has caught up the freight train, in the same area of single track as the previous puzzle.

--|
/
-----------------------------Ffffff-------------------Ppppppp-------

Access into the siding is via a single set of points, (US-Switch), only from the west to east direction.

The siding is just long enough to accomodate any two items of rolling stock at a time. A locomotive counts as one item of rolling stock.

So, how do you get the passenger train past the freight train, allowing it to continue unhindered, and all within the track section depicted above?
[Off-topic] 4silvertooth:
I give up.. May be i don't understand the question.
[Off-topic] stephj:
The final position required is as follows, with the passenger train free to continue its journey unhindered, by the slower freight train.

--|
/
----------Ppppppp---------------------------Ffffff------------------

I'll post the solution in just over 24 hrs.
[Off-topic] Archer:
Isn't this just an expanded version of the previous one though? Surely the answer lies in that question.