Mathematical puzzle: ten digit lock number
Clash Royale CLAN TAG#URR8PPP
up vote
8
down vote
favorite
A mathematical professor set his lock number, he used mathematics so he would remember the ten digit code. He used all of the numbers from 0-9, every number only once. In his mind the first two numbers of the code became a two-digit-number (XX). If you multiply this number (by some integer) you get a three-digit-number (YYY), which is third, 4th and 5th number of the code. And lastly, if you multiply the first (two-digit-number) with a second (three-digit-number) you get the remaining five numbers of the code (five-digit-number).
In other words, we're looking for
XX-YYY-ZZZZZ
where
XX * ? = YYY
XX * YYY = ZZZZZ
And all digits are unique.
mathematics
New contributor
Dejan Pivk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
8
down vote
favorite
A mathematical professor set his lock number, he used mathematics so he would remember the ten digit code. He used all of the numbers from 0-9, every number only once. In his mind the first two numbers of the code became a two-digit-number (XX). If you multiply this number (by some integer) you get a three-digit-number (YYY), which is third, 4th and 5th number of the code. And lastly, if you multiply the first (two-digit-number) with a second (three-digit-number) you get the remaining five numbers of the code (five-digit-number).
In other words, we're looking for
XX-YYY-ZZZZZ
where
XX * ? = YYY
XX * YYY = ZZZZZ
And all digits are unique.
mathematics
New contributor
Dejan Pivk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2
Could you clarify the question a bit? You wrote "...in his mind the first two numbers of the code became a two-digit-number. If you multiply this number (by what?) you get a three-digit-number..." Are you looking for a solution where you square the first two numbers to get the next three? Are you looking for a solution where you double the first two number to get the next three?
– Hugh
Sep 4 at 17:35
Also, are we allowed to insert leading zeroes? For example, if the two digit number XX times the three digit number XXX, and we get a four digit answer, can we put a 0 in front of it to make it 5 digits?
– Hugh
Sep 4 at 17:53
1
@Dejan Pivk, Welcome to PSE. When you say "I would like to find the answer to", does that mean you don't know the answer to the question? Did you create this puzzle yourself, or did you find it somewhere?
– nikki
Sep 4 at 17:58
add a comment |Â
up vote
8
down vote
favorite
up vote
8
down vote
favorite
A mathematical professor set his lock number, he used mathematics so he would remember the ten digit code. He used all of the numbers from 0-9, every number only once. In his mind the first two numbers of the code became a two-digit-number (XX). If you multiply this number (by some integer) you get a three-digit-number (YYY), which is third, 4th and 5th number of the code. And lastly, if you multiply the first (two-digit-number) with a second (three-digit-number) you get the remaining five numbers of the code (five-digit-number).
In other words, we're looking for
XX-YYY-ZZZZZ
where
XX * ? = YYY
XX * YYY = ZZZZZ
And all digits are unique.
mathematics
New contributor
Dejan Pivk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
A mathematical professor set his lock number, he used mathematics so he would remember the ten digit code. He used all of the numbers from 0-9, every number only once. In his mind the first two numbers of the code became a two-digit-number (XX). If you multiply this number (by some integer) you get a three-digit-number (YYY), which is third, 4th and 5th number of the code. And lastly, if you multiply the first (two-digit-number) with a second (three-digit-number) you get the remaining five numbers of the code (five-digit-number).
In other words, we're looking for
XX-YYY-ZZZZZ
where
XX * ? = YYY
XX * YYY = ZZZZZ
And all digits are unique.
mathematics
New contributor
Dejan Pivk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited Sep 4 at 23:23


Rand al'Thor
67.5k13223453
67.5k13223453
New contributor
Dejan Pivk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked Sep 4 at 17:20
Dejan Pivk
411
411
New contributor
Dejan Pivk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Dejan Pivk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Dejan Pivk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2
Could you clarify the question a bit? You wrote "...in his mind the first two numbers of the code became a two-digit-number. If you multiply this number (by what?) you get a three-digit-number..." Are you looking for a solution where you square the first two numbers to get the next three? Are you looking for a solution where you double the first two number to get the next three?
– Hugh
Sep 4 at 17:35
Also, are we allowed to insert leading zeroes? For example, if the two digit number XX times the three digit number XXX, and we get a four digit answer, can we put a 0 in front of it to make it 5 digits?
– Hugh
Sep 4 at 17:53
1
@Dejan Pivk, Welcome to PSE. When you say "I would like to find the answer to", does that mean you don't know the answer to the question? Did you create this puzzle yourself, or did you find it somewhere?
– nikki
Sep 4 at 17:58
add a comment |Â
2
Could you clarify the question a bit? You wrote "...in his mind the first two numbers of the code became a two-digit-number. If you multiply this number (by what?) you get a three-digit-number..." Are you looking for a solution where you square the first two numbers to get the next three? Are you looking for a solution where you double the first two number to get the next three?
– Hugh
Sep 4 at 17:35
Also, are we allowed to insert leading zeroes? For example, if the two digit number XX times the three digit number XXX, and we get a four digit answer, can we put a 0 in front of it to make it 5 digits?
– Hugh
Sep 4 at 17:53
1
@Dejan Pivk, Welcome to PSE. When you say "I would like to find the answer to", does that mean you don't know the answer to the question? Did you create this puzzle yourself, or did you find it somewhere?
– nikki
Sep 4 at 17:58
2
2
Could you clarify the question a bit? You wrote "...in his mind the first two numbers of the code became a two-digit-number. If you multiply this number (by what?) you get a three-digit-number..." Are you looking for a solution where you square the first two numbers to get the next three? Are you looking for a solution where you double the first two number to get the next three?
– Hugh
Sep 4 at 17:35
Could you clarify the question a bit? You wrote "...in his mind the first two numbers of the code became a two-digit-number. If you multiply this number (by what?) you get a three-digit-number..." Are you looking for a solution where you square the first two numbers to get the next three? Are you looking for a solution where you double the first two number to get the next three?
– Hugh
Sep 4 at 17:35
Also, are we allowed to insert leading zeroes? For example, if the two digit number XX times the three digit number XXX, and we get a four digit answer, can we put a 0 in front of it to make it 5 digits?
– Hugh
Sep 4 at 17:53
Also, are we allowed to insert leading zeroes? For example, if the two digit number XX times the three digit number XXX, and we get a four digit answer, can we put a 0 in front of it to make it 5 digits?
– Hugh
Sep 4 at 17:53
1
1
@Dejan Pivk, Welcome to PSE. When you say "I would like to find the answer to", does that mean you don't know the answer to the question? Did you create this puzzle yourself, or did you find it somewhere?
– nikki
Sep 4 at 17:58
@Dejan Pivk, Welcome to PSE. When you say "I would like to find the answer to", does that mean you don't know the answer to the question? Did you create this puzzle yourself, or did you find it somewhere?
– nikki
Sep 4 at 17:58
add a comment |Â
4 Answers
4
active
oldest
votes
up vote
6
down vote
Feel a little bit bad because I just brute-forced it but:
27-594-16038
Explanation:
The two digit number is 27. If you multiply this number (specifically by 22) you can get 594. 27 * 594 = 16,038. All these numbers appended together makes 2759416038 which is a ten digit number that uses each digit only once. It is also the only such number that fits all the prescribed rules.
New contributor
Luke C. J. Currie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Awww what? I just ran my program to solve that :(
– Rohit Jose
Sep 4 at 18:28
add a comment |Â
up vote
5
down vote
I assumed that "multiply this [two-digit] number" means "multiply it by something unknown" and wrote a simple program to see what this unknown could be. I only found one possible value of this unknown:
The statement will read "multiply this number by 22".
In this case the answer is:
2759416038: 27 * 22 = 594, 27 * 594 = 16038
add a comment |Â
up vote
2
down vote
If I understood the riddle correctly we should find ten numbers (a combination for the lock). The first two numbers form a two digit number which multiplied with it self should form another three digit number. And the two-digit number multiplied with the three digit number should form the full lock combination.
XX^2=XXX
XX*XXX=XXXXX
XX XXX XXXXX = combination key
New contributor
JackNicholson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
That's what I thought originally too, but that interpretation has no solutions. The only way I could interpret the riddle to return just one solution is that the first two digit number has to be multiplied by some integer to get the next three digit number.
– Luke C. J. Currie
Sep 4 at 19:53
Yup, I think your solution might be just right. Thank you btw.
– JackNicholson
Sep 4 at 20:00
add a comment |Â
up vote
1
down vote
Checking all possible solutions for this riddle, finally receiving:
XX: 27 , YYY: 594 , ZZZZZ: 16038
x<-0:9
for(i in x)
for(j in x)
if(i!=j)
tmp<-(i*10+j)*1:82
tmph<-tmp%/%100
tmpz<-tmp%/%10-10*tmph
tmpe<-tmp%/%1-100*tmph-10*tmpz
tmpyyy<-tmp[which(!is.element(tmph,c(i,j)) & !is.element(tmpz,c(i,j)) & !is.element(tmpe,c(i,j)) & tmph!=tmpz & tmph!=tmpe &tmpe!=tmpz & tmp>99 & tmp<1000)]
tmp<-(i*10+j)*tmpyyy
tmp2zt<-tmp%/%10000
tmp2t<-tmp%/%1000-10*tmp2zt
tmp2h<-tmp%/%100-10*tmp2t-100*tmp2zt
tmp2z<-tmp%/%10-10*tmp2h-100*tmp2t-1000*tmp2zt
tmp2e<-tmp%/%1-1000*tmp2t-10000*tmp2zt-100*tmp2h-10*tmp2z
tmpzzzzz<-tmp[which(!is.element(tmp2zt,c(i,j)) &!is.element(tmp2t,c(i,j)) & !is.element(tmp2h,c(i,j)) & !is.element(tmp2z,c(i,j)) & !is.element(tmp2e,c(i,j)) & tmp2h!=tmp2z & tmp2h!=tmp2e &tmp2e!=tmp2z & tmp2e!=tmp2t &tmp2e!=tmp2zt &tmp2t!=tmp2z&tmp2zt!=tmp2z &tmp2h!=tmp2t &tmp2h!=tmp2zt &tmp2t!=tmp2zt & tmp>9999 & tmp<100000)]
if(length(tmpyyy)>0 & length(tmpzzzzz)>0)
for(y in tmpyyy)
tmph<-y%/%100
tmpz<-y%/%10-10*tmph
tmpe<-y%/%1-100*tmph-10*tmpz
tmp2zt<-tmpzzzzz%/%10000
tmp2t<-tmpzzzzz%/%1000-10*tmp2zt
tmp2h<-tmpzzzzz%/%100-10*tmp2t-100*tmp2zt
tmp2z<-tmpzzzzz%/%10-10*tmp2h-100*tmp2t-1000*tmp2zt
tmp2e<-tmpzzzzz%/%1-1000*tmp2t-10000*tmp2zt-100*tmp2h-10*tmp2z
tmpres<-tmpzzzzz[which(!is.element(tmp2zt,c(tmph,tmpz,tmpe))& !is.element(tmp2t,c(tmph,tmpz,tmpe)) & !is.element(tmp2h,c(tmph,tmpz,tmpe))&!is.element(tmp2z,c(tmph,tmpz,tmpe)) & !is.element(tmp2e,c(tmph,tmpz,tmpe))& ((i*10+j)*y==tmpzzzzz))]
if(length(tmpres)>0)
cat(paste("XX:",(i*10+j), ", YYY:",y, ", ZZZZZ:",tmpres))
New contributor
alex2006 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Hey, you missed the constrain that that the xx multiplied by yyy makes zzzzz
– Ontamu
Sep 5 at 8:41
Thanks. I recoded it now which reduced the possible solutions.
– alex2006
Sep 5 at 8:53
You might still have some debugging to do on the code. 54*216 = 11664 not 37908. I believe you will end up with only 1 solution if find the error in the code.
– Ontamu
Sep 5 at 8:57
You are right. Thanks a lot.
– alex2006
Sep 5 at 9:12
add a comment |Â
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
Feel a little bit bad because I just brute-forced it but:
27-594-16038
Explanation:
The two digit number is 27. If you multiply this number (specifically by 22) you can get 594. 27 * 594 = 16,038. All these numbers appended together makes 2759416038 which is a ten digit number that uses each digit only once. It is also the only such number that fits all the prescribed rules.
New contributor
Luke C. J. Currie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Awww what? I just ran my program to solve that :(
– Rohit Jose
Sep 4 at 18:28
add a comment |Â
up vote
6
down vote
Feel a little bit bad because I just brute-forced it but:
27-594-16038
Explanation:
The two digit number is 27. If you multiply this number (specifically by 22) you can get 594. 27 * 594 = 16,038. All these numbers appended together makes 2759416038 which is a ten digit number that uses each digit only once. It is also the only such number that fits all the prescribed rules.
New contributor
Luke C. J. Currie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Awww what? I just ran my program to solve that :(
– Rohit Jose
Sep 4 at 18:28
add a comment |Â
up vote
6
down vote
up vote
6
down vote
Feel a little bit bad because I just brute-forced it but:
27-594-16038
Explanation:
The two digit number is 27. If you multiply this number (specifically by 22) you can get 594. 27 * 594 = 16,038. All these numbers appended together makes 2759416038 which is a ten digit number that uses each digit only once. It is also the only such number that fits all the prescribed rules.
New contributor
Luke C. J. Currie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Feel a little bit bad because I just brute-forced it but:
27-594-16038
Explanation:
The two digit number is 27. If you multiply this number (specifically by 22) you can get 594. 27 * 594 = 16,038. All these numbers appended together makes 2759416038 which is a ten digit number that uses each digit only once. It is also the only such number that fits all the prescribed rules.
New contributor
Luke C. J. Currie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited Sep 4 at 19:15
New contributor
Luke C. J. Currie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered Sep 4 at 18:12
Luke C. J. Currie
2315
2315
New contributor
Luke C. J. Currie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Luke C. J. Currie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Luke C. J. Currie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Awww what? I just ran my program to solve that :(
– Rohit Jose
Sep 4 at 18:28
add a comment |Â
Awww what? I just ran my program to solve that :(
– Rohit Jose
Sep 4 at 18:28
Awww what? I just ran my program to solve that :(
– Rohit Jose
Sep 4 at 18:28
Awww what? I just ran my program to solve that :(
– Rohit Jose
Sep 4 at 18:28
add a comment |Â
up vote
5
down vote
I assumed that "multiply this [two-digit] number" means "multiply it by something unknown" and wrote a simple program to see what this unknown could be. I only found one possible value of this unknown:
The statement will read "multiply this number by 22".
In this case the answer is:
2759416038: 27 * 22 = 594, 27 * 594 = 16038
add a comment |Â
up vote
5
down vote
I assumed that "multiply this [two-digit] number" means "multiply it by something unknown" and wrote a simple program to see what this unknown could be. I only found one possible value of this unknown:
The statement will read "multiply this number by 22".
In this case the answer is:
2759416038: 27 * 22 = 594, 27 * 594 = 16038
add a comment |Â
up vote
5
down vote
up vote
5
down vote
I assumed that "multiply this [two-digit] number" means "multiply it by something unknown" and wrote a simple program to see what this unknown could be. I only found one possible value of this unknown:
The statement will read "multiply this number by 22".
In this case the answer is:
2759416038: 27 * 22 = 594, 27 * 594 = 16038
I assumed that "multiply this [two-digit] number" means "multiply it by something unknown" and wrote a simple program to see what this unknown could be. I only found one possible value of this unknown:
The statement will read "multiply this number by 22".
In this case the answer is:
2759416038: 27 * 22 = 594, 27 * 594 = 16038
answered Sep 4 at 18:16
Mariia Mykhailova
447111
447111
add a comment |Â
add a comment |Â
up vote
2
down vote
If I understood the riddle correctly we should find ten numbers (a combination for the lock). The first two numbers form a two digit number which multiplied with it self should form another three digit number. And the two-digit number multiplied with the three digit number should form the full lock combination.
XX^2=XXX
XX*XXX=XXXXX
XX XXX XXXXX = combination key
New contributor
JackNicholson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
That's what I thought originally too, but that interpretation has no solutions. The only way I could interpret the riddle to return just one solution is that the first two digit number has to be multiplied by some integer to get the next three digit number.
– Luke C. J. Currie
Sep 4 at 19:53
Yup, I think your solution might be just right. Thank you btw.
– JackNicholson
Sep 4 at 20:00
add a comment |Â
up vote
2
down vote
If I understood the riddle correctly we should find ten numbers (a combination for the lock). The first two numbers form a two digit number which multiplied with it self should form another three digit number. And the two-digit number multiplied with the three digit number should form the full lock combination.
XX^2=XXX
XX*XXX=XXXXX
XX XXX XXXXX = combination key
New contributor
JackNicholson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
That's what I thought originally too, but that interpretation has no solutions. The only way I could interpret the riddle to return just one solution is that the first two digit number has to be multiplied by some integer to get the next three digit number.
– Luke C. J. Currie
Sep 4 at 19:53
Yup, I think your solution might be just right. Thank you btw.
– JackNicholson
Sep 4 at 20:00
add a comment |Â
up vote
2
down vote
up vote
2
down vote
If I understood the riddle correctly we should find ten numbers (a combination for the lock). The first two numbers form a two digit number which multiplied with it self should form another three digit number. And the two-digit number multiplied with the three digit number should form the full lock combination.
XX^2=XXX
XX*XXX=XXXXX
XX XXX XXXXX = combination key
New contributor
JackNicholson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
If I understood the riddle correctly we should find ten numbers (a combination for the lock). The first two numbers form a two digit number which multiplied with it self should form another three digit number. And the two-digit number multiplied with the three digit number should form the full lock combination.
XX^2=XXX
XX*XXX=XXXXX
XX XXX XXXXX = combination key
New contributor
JackNicholson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited Sep 4 at 20:18


Glorfindel
11.1k34270
11.1k34270
New contributor
JackNicholson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered Sep 4 at 19:47
JackNicholson
291
291
New contributor
JackNicholson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
JackNicholson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
JackNicholson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
That's what I thought originally too, but that interpretation has no solutions. The only way I could interpret the riddle to return just one solution is that the first two digit number has to be multiplied by some integer to get the next three digit number.
– Luke C. J. Currie
Sep 4 at 19:53
Yup, I think your solution might be just right. Thank you btw.
– JackNicholson
Sep 4 at 20:00
add a comment |Â
1
That's what I thought originally too, but that interpretation has no solutions. The only way I could interpret the riddle to return just one solution is that the first two digit number has to be multiplied by some integer to get the next three digit number.
– Luke C. J. Currie
Sep 4 at 19:53
Yup, I think your solution might be just right. Thank you btw.
– JackNicholson
Sep 4 at 20:00
1
1
That's what I thought originally too, but that interpretation has no solutions. The only way I could interpret the riddle to return just one solution is that the first two digit number has to be multiplied by some integer to get the next three digit number.
– Luke C. J. Currie
Sep 4 at 19:53
That's what I thought originally too, but that interpretation has no solutions. The only way I could interpret the riddle to return just one solution is that the first two digit number has to be multiplied by some integer to get the next three digit number.
– Luke C. J. Currie
Sep 4 at 19:53
Yup, I think your solution might be just right. Thank you btw.
– JackNicholson
Sep 4 at 20:00
Yup, I think your solution might be just right. Thank you btw.
– JackNicholson
Sep 4 at 20:00
add a comment |Â
up vote
1
down vote
Checking all possible solutions for this riddle, finally receiving:
XX: 27 , YYY: 594 , ZZZZZ: 16038
x<-0:9
for(i in x)
for(j in x)
if(i!=j)
tmp<-(i*10+j)*1:82
tmph<-tmp%/%100
tmpz<-tmp%/%10-10*tmph
tmpe<-tmp%/%1-100*tmph-10*tmpz
tmpyyy<-tmp[which(!is.element(tmph,c(i,j)) & !is.element(tmpz,c(i,j)) & !is.element(tmpe,c(i,j)) & tmph!=tmpz & tmph!=tmpe &tmpe!=tmpz & tmp>99 & tmp<1000)]
tmp<-(i*10+j)*tmpyyy
tmp2zt<-tmp%/%10000
tmp2t<-tmp%/%1000-10*tmp2zt
tmp2h<-tmp%/%100-10*tmp2t-100*tmp2zt
tmp2z<-tmp%/%10-10*tmp2h-100*tmp2t-1000*tmp2zt
tmp2e<-tmp%/%1-1000*tmp2t-10000*tmp2zt-100*tmp2h-10*tmp2z
tmpzzzzz<-tmp[which(!is.element(tmp2zt,c(i,j)) &!is.element(tmp2t,c(i,j)) & !is.element(tmp2h,c(i,j)) & !is.element(tmp2z,c(i,j)) & !is.element(tmp2e,c(i,j)) & tmp2h!=tmp2z & tmp2h!=tmp2e &tmp2e!=tmp2z & tmp2e!=tmp2t &tmp2e!=tmp2zt &tmp2t!=tmp2z&tmp2zt!=tmp2z &tmp2h!=tmp2t &tmp2h!=tmp2zt &tmp2t!=tmp2zt & tmp>9999 & tmp<100000)]
if(length(tmpyyy)>0 & length(tmpzzzzz)>0)
for(y in tmpyyy)
tmph<-y%/%100
tmpz<-y%/%10-10*tmph
tmpe<-y%/%1-100*tmph-10*tmpz
tmp2zt<-tmpzzzzz%/%10000
tmp2t<-tmpzzzzz%/%1000-10*tmp2zt
tmp2h<-tmpzzzzz%/%100-10*tmp2t-100*tmp2zt
tmp2z<-tmpzzzzz%/%10-10*tmp2h-100*tmp2t-1000*tmp2zt
tmp2e<-tmpzzzzz%/%1-1000*tmp2t-10000*tmp2zt-100*tmp2h-10*tmp2z
tmpres<-tmpzzzzz[which(!is.element(tmp2zt,c(tmph,tmpz,tmpe))& !is.element(tmp2t,c(tmph,tmpz,tmpe)) & !is.element(tmp2h,c(tmph,tmpz,tmpe))&!is.element(tmp2z,c(tmph,tmpz,tmpe)) & !is.element(tmp2e,c(tmph,tmpz,tmpe))& ((i*10+j)*y==tmpzzzzz))]
if(length(tmpres)>0)
cat(paste("XX:",(i*10+j), ", YYY:",y, ", ZZZZZ:",tmpres))
New contributor
alex2006 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Hey, you missed the constrain that that the xx multiplied by yyy makes zzzzz
– Ontamu
Sep 5 at 8:41
Thanks. I recoded it now which reduced the possible solutions.
– alex2006
Sep 5 at 8:53
You might still have some debugging to do on the code. 54*216 = 11664 not 37908. I believe you will end up with only 1 solution if find the error in the code.
– Ontamu
Sep 5 at 8:57
You are right. Thanks a lot.
– alex2006
Sep 5 at 9:12
add a comment |Â
up vote
1
down vote
Checking all possible solutions for this riddle, finally receiving:
XX: 27 , YYY: 594 , ZZZZZ: 16038
x<-0:9
for(i in x)
for(j in x)
if(i!=j)
tmp<-(i*10+j)*1:82
tmph<-tmp%/%100
tmpz<-tmp%/%10-10*tmph
tmpe<-tmp%/%1-100*tmph-10*tmpz
tmpyyy<-tmp[which(!is.element(tmph,c(i,j)) & !is.element(tmpz,c(i,j)) & !is.element(tmpe,c(i,j)) & tmph!=tmpz & tmph!=tmpe &tmpe!=tmpz & tmp>99 & tmp<1000)]
tmp<-(i*10+j)*tmpyyy
tmp2zt<-tmp%/%10000
tmp2t<-tmp%/%1000-10*tmp2zt
tmp2h<-tmp%/%100-10*tmp2t-100*tmp2zt
tmp2z<-tmp%/%10-10*tmp2h-100*tmp2t-1000*tmp2zt
tmp2e<-tmp%/%1-1000*tmp2t-10000*tmp2zt-100*tmp2h-10*tmp2z
tmpzzzzz<-tmp[which(!is.element(tmp2zt,c(i,j)) &!is.element(tmp2t,c(i,j)) & !is.element(tmp2h,c(i,j)) & !is.element(tmp2z,c(i,j)) & !is.element(tmp2e,c(i,j)) & tmp2h!=tmp2z & tmp2h!=tmp2e &tmp2e!=tmp2z & tmp2e!=tmp2t &tmp2e!=tmp2zt &tmp2t!=tmp2z&tmp2zt!=tmp2z &tmp2h!=tmp2t &tmp2h!=tmp2zt &tmp2t!=tmp2zt & tmp>9999 & tmp<100000)]
if(length(tmpyyy)>0 & length(tmpzzzzz)>0)
for(y in tmpyyy)
tmph<-y%/%100
tmpz<-y%/%10-10*tmph
tmpe<-y%/%1-100*tmph-10*tmpz
tmp2zt<-tmpzzzzz%/%10000
tmp2t<-tmpzzzzz%/%1000-10*tmp2zt
tmp2h<-tmpzzzzz%/%100-10*tmp2t-100*tmp2zt
tmp2z<-tmpzzzzz%/%10-10*tmp2h-100*tmp2t-1000*tmp2zt
tmp2e<-tmpzzzzz%/%1-1000*tmp2t-10000*tmp2zt-100*tmp2h-10*tmp2z
tmpres<-tmpzzzzz[which(!is.element(tmp2zt,c(tmph,tmpz,tmpe))& !is.element(tmp2t,c(tmph,tmpz,tmpe)) & !is.element(tmp2h,c(tmph,tmpz,tmpe))&!is.element(tmp2z,c(tmph,tmpz,tmpe)) & !is.element(tmp2e,c(tmph,tmpz,tmpe))& ((i*10+j)*y==tmpzzzzz))]
if(length(tmpres)>0)
cat(paste("XX:",(i*10+j), ", YYY:",y, ", ZZZZZ:",tmpres))
New contributor
alex2006 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Hey, you missed the constrain that that the xx multiplied by yyy makes zzzzz
– Ontamu
Sep 5 at 8:41
Thanks. I recoded it now which reduced the possible solutions.
– alex2006
Sep 5 at 8:53
You might still have some debugging to do on the code. 54*216 = 11664 not 37908. I believe you will end up with only 1 solution if find the error in the code.
– Ontamu
Sep 5 at 8:57
You are right. Thanks a lot.
– alex2006
Sep 5 at 9:12
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Checking all possible solutions for this riddle, finally receiving:
XX: 27 , YYY: 594 , ZZZZZ: 16038
x<-0:9
for(i in x)
for(j in x)
if(i!=j)
tmp<-(i*10+j)*1:82
tmph<-tmp%/%100
tmpz<-tmp%/%10-10*tmph
tmpe<-tmp%/%1-100*tmph-10*tmpz
tmpyyy<-tmp[which(!is.element(tmph,c(i,j)) & !is.element(tmpz,c(i,j)) & !is.element(tmpe,c(i,j)) & tmph!=tmpz & tmph!=tmpe &tmpe!=tmpz & tmp>99 & tmp<1000)]
tmp<-(i*10+j)*tmpyyy
tmp2zt<-tmp%/%10000
tmp2t<-tmp%/%1000-10*tmp2zt
tmp2h<-tmp%/%100-10*tmp2t-100*tmp2zt
tmp2z<-tmp%/%10-10*tmp2h-100*tmp2t-1000*tmp2zt
tmp2e<-tmp%/%1-1000*tmp2t-10000*tmp2zt-100*tmp2h-10*tmp2z
tmpzzzzz<-tmp[which(!is.element(tmp2zt,c(i,j)) &!is.element(tmp2t,c(i,j)) & !is.element(tmp2h,c(i,j)) & !is.element(tmp2z,c(i,j)) & !is.element(tmp2e,c(i,j)) & tmp2h!=tmp2z & tmp2h!=tmp2e &tmp2e!=tmp2z & tmp2e!=tmp2t &tmp2e!=tmp2zt &tmp2t!=tmp2z&tmp2zt!=tmp2z &tmp2h!=tmp2t &tmp2h!=tmp2zt &tmp2t!=tmp2zt & tmp>9999 & tmp<100000)]
if(length(tmpyyy)>0 & length(tmpzzzzz)>0)
for(y in tmpyyy)
tmph<-y%/%100
tmpz<-y%/%10-10*tmph
tmpe<-y%/%1-100*tmph-10*tmpz
tmp2zt<-tmpzzzzz%/%10000
tmp2t<-tmpzzzzz%/%1000-10*tmp2zt
tmp2h<-tmpzzzzz%/%100-10*tmp2t-100*tmp2zt
tmp2z<-tmpzzzzz%/%10-10*tmp2h-100*tmp2t-1000*tmp2zt
tmp2e<-tmpzzzzz%/%1-1000*tmp2t-10000*tmp2zt-100*tmp2h-10*tmp2z
tmpres<-tmpzzzzz[which(!is.element(tmp2zt,c(tmph,tmpz,tmpe))& !is.element(tmp2t,c(tmph,tmpz,tmpe)) & !is.element(tmp2h,c(tmph,tmpz,tmpe))&!is.element(tmp2z,c(tmph,tmpz,tmpe)) & !is.element(tmp2e,c(tmph,tmpz,tmpe))& ((i*10+j)*y==tmpzzzzz))]
if(length(tmpres)>0)
cat(paste("XX:",(i*10+j), ", YYY:",y, ", ZZZZZ:",tmpres))
New contributor
alex2006 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Checking all possible solutions for this riddle, finally receiving:
XX: 27 , YYY: 594 , ZZZZZ: 16038
x<-0:9
for(i in x)
for(j in x)
if(i!=j)
tmp<-(i*10+j)*1:82
tmph<-tmp%/%100
tmpz<-tmp%/%10-10*tmph
tmpe<-tmp%/%1-100*tmph-10*tmpz
tmpyyy<-tmp[which(!is.element(tmph,c(i,j)) & !is.element(tmpz,c(i,j)) & !is.element(tmpe,c(i,j)) & tmph!=tmpz & tmph!=tmpe &tmpe!=tmpz & tmp>99 & tmp<1000)]
tmp<-(i*10+j)*tmpyyy
tmp2zt<-tmp%/%10000
tmp2t<-tmp%/%1000-10*tmp2zt
tmp2h<-tmp%/%100-10*tmp2t-100*tmp2zt
tmp2z<-tmp%/%10-10*tmp2h-100*tmp2t-1000*tmp2zt
tmp2e<-tmp%/%1-1000*tmp2t-10000*tmp2zt-100*tmp2h-10*tmp2z
tmpzzzzz<-tmp[which(!is.element(tmp2zt,c(i,j)) &!is.element(tmp2t,c(i,j)) & !is.element(tmp2h,c(i,j)) & !is.element(tmp2z,c(i,j)) & !is.element(tmp2e,c(i,j)) & tmp2h!=tmp2z & tmp2h!=tmp2e &tmp2e!=tmp2z & tmp2e!=tmp2t &tmp2e!=tmp2zt &tmp2t!=tmp2z&tmp2zt!=tmp2z &tmp2h!=tmp2t &tmp2h!=tmp2zt &tmp2t!=tmp2zt & tmp>9999 & tmp<100000)]
if(length(tmpyyy)>0 & length(tmpzzzzz)>0)
for(y in tmpyyy)
tmph<-y%/%100
tmpz<-y%/%10-10*tmph
tmpe<-y%/%1-100*tmph-10*tmpz
tmp2zt<-tmpzzzzz%/%10000
tmp2t<-tmpzzzzz%/%1000-10*tmp2zt
tmp2h<-tmpzzzzz%/%100-10*tmp2t-100*tmp2zt
tmp2z<-tmpzzzzz%/%10-10*tmp2h-100*tmp2t-1000*tmp2zt
tmp2e<-tmpzzzzz%/%1-1000*tmp2t-10000*tmp2zt-100*tmp2h-10*tmp2z
tmpres<-tmpzzzzz[which(!is.element(tmp2zt,c(tmph,tmpz,tmpe))& !is.element(tmp2t,c(tmph,tmpz,tmpe)) & !is.element(tmp2h,c(tmph,tmpz,tmpe))&!is.element(tmp2z,c(tmph,tmpz,tmpe)) & !is.element(tmp2e,c(tmph,tmpz,tmpe))& ((i*10+j)*y==tmpzzzzz))]
if(length(tmpres)>0)
cat(paste("XX:",(i*10+j), ", YYY:",y, ", ZZZZZ:",tmpres))
New contributor
alex2006 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited Sep 5 at 9:13
New contributor
alex2006 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered Sep 5 at 8:32
alex2006
1115
1115
New contributor
alex2006 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
alex2006 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
alex2006 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Hey, you missed the constrain that that the xx multiplied by yyy makes zzzzz
– Ontamu
Sep 5 at 8:41
Thanks. I recoded it now which reduced the possible solutions.
– alex2006
Sep 5 at 8:53
You might still have some debugging to do on the code. 54*216 = 11664 not 37908. I believe you will end up with only 1 solution if find the error in the code.
– Ontamu
Sep 5 at 8:57
You are right. Thanks a lot.
– alex2006
Sep 5 at 9:12
add a comment |Â
Hey, you missed the constrain that that the xx multiplied by yyy makes zzzzz
– Ontamu
Sep 5 at 8:41
Thanks. I recoded it now which reduced the possible solutions.
– alex2006
Sep 5 at 8:53
You might still have some debugging to do on the code. 54*216 = 11664 not 37908. I believe you will end up with only 1 solution if find the error in the code.
– Ontamu
Sep 5 at 8:57
You are right. Thanks a lot.
– alex2006
Sep 5 at 9:12
Hey, you missed the constrain that that the xx multiplied by yyy makes zzzzz
– Ontamu
Sep 5 at 8:41
Hey, you missed the constrain that that the xx multiplied by yyy makes zzzzz
– Ontamu
Sep 5 at 8:41
Thanks. I recoded it now which reduced the possible solutions.
– alex2006
Sep 5 at 8:53
Thanks. I recoded it now which reduced the possible solutions.
– alex2006
Sep 5 at 8:53
You might still have some debugging to do on the code. 54*216 = 11664 not 37908. I believe you will end up with only 1 solution if find the error in the code.
– Ontamu
Sep 5 at 8:57
You might still have some debugging to do on the code. 54*216 = 11664 not 37908. I believe you will end up with only 1 solution if find the error in the code.
– Ontamu
Sep 5 at 8:57
You are right. Thanks a lot.
– alex2006
Sep 5 at 9:12
You are right. Thanks a lot.
– alex2006
Sep 5 at 9:12
add a comment |Â
Dejan Pivk is a new contributor. Be nice, and check out our Code of Conduct.
Dejan Pivk is a new contributor. Be nice, and check out our Code of Conduct.
Dejan Pivk is a new contributor. Be nice, and check out our Code of Conduct.
Dejan Pivk is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fpuzzling.stackexchange.com%2fquestions%2f71394%2fmathematical-puzzle-ten-digit-lock-number%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
2
Could you clarify the question a bit? You wrote "...in his mind the first two numbers of the code became a two-digit-number. If you multiply this number (by what?) you get a three-digit-number..." Are you looking for a solution where you square the first two numbers to get the next three? Are you looking for a solution where you double the first two number to get the next three?
– Hugh
Sep 4 at 17:35
Also, are we allowed to insert leading zeroes? For example, if the two digit number XX times the three digit number XXX, and we get a four digit answer, can we put a 0 in front of it to make it 5 digits?
– Hugh
Sep 4 at 17:53
1
@Dejan Pivk, Welcome to PSE. When you say "I would like to find the answer to", does that mean you don't know the answer to the question? Did you create this puzzle yourself, or did you find it somewhere?
– nikki
Sep 4 at 17:58