中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-11-10 12:31
47,815 topics / 349,930 posts / today 0 new / 48,291 members
DOS批处理 & 脚本技术(批处理室) » [Discussion][Exploration] Using batch processing to make interesting math problems
Printable Version  40,591 / 139
Floor46 youxi01 Posted 2006-11-17 02:32
高级用户 Posts 247 Credits 846 From 湖南==》广东
#Serial Number !Solved ?Unsolved

#01 !(Code provided by lxmxn)
Find narcissistic numbers?

Similar type of problem: Find Pythagorean triples? (Code provided by namejm)




#02 !(Code provided by zouzhxi)
There are four numbers. When any three numbers are added together, the resulting sums are 84, 88, 99, and 110 respectively. Find these four numbers?


#03 !
Miss Zhao's age has the following characteristics:
1. Its cube is a four-digit number, and its fourth power is a six-digit number;
2. These four-digit number and six-digit number are exactly composed of the ten digits from 0 to 9.
Ask, what number should this be?

【Problem-solving idea】
Take an unknown number, first obtain the cube and fourth power of this number respectively; then divide the ten digits respectively and define them, and finally check whether all from 0 to 9 have been defined. If all have been defined, then this number meets the requirements; otherwise, there are repeated digits and it does not meet the requirements.



#04 !
A total of 4889 digits were used to number the pages of a dictionary. How many pages does this dictionary have? Answer: 1499

【Problem-solving idea】
The following method is relatively direct. Directly check the size of the number. If it is less than 10, it is a 1-digit number, 10~99 is 2 digits,.... Then add up all the digits.



#05 !
Ah Cong said that he saw a group of camels in the northwest this time. There are 23 humps and 60 feet. How many single-humped and double-humped camels are there respectively?

【Problem-solving idea】
First determine the total number of camels from the number of feet of camels (divided by 4), and then successively check between 1 and 15 for data that meets the requirements;



#06 !
There is a five-digit odd number. Replace all 2s with 5s and all 5s with 2s in this five-digit odd number, and other numbers remain unchanged, to get a new five-digit number. If half of the new five-digit number is still 1 larger than the original five-digit number, what is the original five-digit number?

【Problem-solving idea】
The clear idea is: the first digit must be 2, and the last digit must be 5 (because it was originally odd, but later can have "half", indicating it is even, so it can be determined that the last digit is 5, which was later replaced with 2.



#07 !
The sum of five consecutive natural numbers can be divisible by 2, 3, 4, 5, and 6 respectively. Find the smallest set of numbers that meets this condition.

【Problem-solving idea】
There is no particular skill. Use the arithmetic sequence formula, first calculate the sum of 5 numbers, and then check whether it can be divisible by 4, 5, 6.




#08 !
I am a three-digit number. There is one digit that is "3", another digit is "1", and the other digit is unknown. If "3" is changed to "4" and "1" is changed to "3", then the original me will be 9 less than half of the assumed me. Do you know what the original number is?

【Problem-solving idea】
Using the method of proof by contradiction, it can be known that the first digit must be 1, so the arrangement of the number may be: 1*3 or 13*, and then check.



#09 !
Farmer Jones said to his wife: "Hey, Maria, if we sell 75 chicks according to my method, then our chicken feed can last for 20 days. However, if we follow your suggestion and buy 100 more chicks, then the chicken feed will only last for 15 days."
"Ah, dear," she replied, "then how many chicks do we have now?"
The problem is here. How many chicks do they have exactly?

【Problem-solving idea】
Throughout the process, the amount of feed the chicks eat is unchanged. Suppose there are X chicks, then there should be: (x-75)*20=(x+100)*15, and then write a loop to see which number is appropriate?!



#10 !
Among all five-digit numbers, how many have exactly two 3s?

【Problem-solving idea】
The following idea is relatively novel. Its principle is: replace all 3s in the number with empty, and the detection method is illustrated by an example:
For example: 75332 becomes 752 after replacement, which is a number with less than 4 digits. Just check its size to meet the requirements of the question.



#11 !
Divide 17 into the sum of several natural numbers, and find the maximum product of these natural numbers?

【Problem-solving idea】
Using high school mathematics knowledge, it can be proved that any number greater than or equal to 4 can be split into two numbers: their sum is equal to the number, and the product is greater than or equal to the number. According to this inference, all numbers will eventually be split into such forms: A*A*A*A....A is 2 or 3 (because only 2 and 3 cannot be split, and the remaining must be only 2 and 3).
For example: 8 can be split like this (without 3):
num1=2*2*2*2 or can be split into (with 2 threes): num2=2*3*3, then just compare the sizes of the two nums!



#12 !
Multiply natural numbers 2, 3...... together. The last 6 digits of their product are exactly all 0s. What is the minimum possible value of the last natural number?



#13 !
The sum of the dividend, divisor, and quotient is 181, and the quotient is 12. Find the dividend.



#14 !
There are six boxes of goods in the store, weighing 15, 16, 18, 19, 20, and 31 kilograms respectively. Two customers bought five of them. It is known that the weight of the goods bought by one customer is twice that of the other customer. Then, what is the weight of the remaining box of goods in the store?

【Problem-solving idea】
A known condition that can be quickly inferred is: the total mass of the two bags of goods bought by the two customers can be divisible by 3, and the other customer's can be divisible by 2.......



#15 !
A number has a remainder of 2 when divided by 3 and a remainder of 1 when divided by 5. What is the remainder when this number is divided by 15?



#16 !
1. p is a prime number, and p×p+1 is also a prime number. Find 2006×p.
2. What is the remainder when the product of 2006 2s is divided by 7?

【Problem-solving idea】
1> PxP+1 is a prime number, so PxP+1 is odd (except 2), then P×P is even, so P must be even, then P=2
2> 2^2006 can be written in the form: 2^2006=8^668×2×2=(7+1)^668×4. According to the binomial theorem, the remainder of 2^2006 divided by 7 is: 4



#17 !
It is said that in a holy temple in India, there is a brass plate with three gem needles inserted on it. On the first gem needle, from bottom to top, there are 64 golden plates with holes in the center, arranged from largest to smallest. The monks in the temple move the plates according to the following rules: only one plate can be moved at a time, and the small plate must always be placed on the large plate. At that time, it was said that when all 64 golden plates were moved to another gem needle, the world would be destroyed in a thunderclap. How many times does it take to move 64 golden plates to another gem needle? This is a very large number!
Answer: 18446744073709551615

【Problem-solving idea】According to relevant knowledge such as geometric sequences, it is known that the total number of times required is: 2^64-1. This number is extremely large, and direct calculation is definitely not feasible. Then we have to adopt the method of "segmented calculation in a clock-like manner". If it is not original, please forgive my rudeness!

The following code divides the data into 6 segments, each with 6 digits to save respectively. Its basic principle is: when the last segment of data is multiplied by 2, if its value is greater than 1000000, carry over, add the carried data to the previous segment of data, and so on. This segment of code currently supports the continuous multiplication of 200 2s. Of course, you can "modify" it to calculate more massive numbers.




#18 !
There are ten RMB notes with denominations of 1 cent, 2 cents, 5 cents, 1 jiao, 2 jiao, 5 jiao, 1 yuan, 2 yuan, 5 yuan, and 10 yuan. How many different denominations can be formed?

【Problem-solving idea】According to the relevant knowledge of permutations and combinations, it is known that the total number of combinations may be: num=C(10,1)+C(10,2)+..+C(10,10)

Floor47 namejm Posted 2006-11-17 02:45
荣誉版主 Posts 1,737 Credits 5,226 From 成都
Since there are already codes in the previous post, there should be no need to start a new post to summarize, because this will be suspected of content duplication and will also occupy too much forum resources. Moreover, new questions may be raised at any time in the top post of that thread. It can be considered to merge with the post opened by zouzhxi. zouzhxi is responsible for collecting all the codes and placing them as an attachment package in the top post of the thread for everyone to download. At the same time, the links to the codes that solve each problem should also be posted in the top post of the thread. What do you think, Brother youxi01?
Floor48 youxi01 Posted 2006-11-17 02:53
高级用户 Posts 247 Credits 846 From 湖南==》广东
No problem, it's all for the convenience of everyone!~
Floor49 NaturalJ0 Posted 2006-11-17 03:01
银牌会员 Posts 533 Credits 1,181
I missed out = =b
On the first day I came in and took a look, and found only narcissistic numbers and the Pythagorean theorem, so I didn't come back in.
Today I thought it was strange: how could narcissistic numbers and the Pythagorean theorem be discussed for three pages? So I came in again to take a look, and found there were actually so many fun problems.

Looking at these problems reminded me of one I did when I was little.
There are two basins of water, one cold and one hot. There is a thermometer in the cold-water basin. Use a small cup to get a cup of hot water and pour it into the cold water, and the temperature rises by 5 degrees. Pour in another cup of hot water, and it rises by another 3 degrees. If you pour in one more cup, how many more degrees will it rise?
Floor50 zouzhxi Posted 2006-11-17 03:59
中级用户 Posts 177 Credits 430 From 广东深圳
Re 46F:
I put your topic on the top floor...
Floor51 zouzhxi Posted 2006-11-17 04:12
中级用户 Posts 177 Credits 430 From 广东深圳
Okay, I'll collect the code issues and put them up later...
Floor52 youxi01 Posted 2006-11-17 06:12
高级用户 Posts 247 Credits 846 From 湖南==》广东
Moderator namejm, should you delete this question?
Floor53 不得不爱 Posted 2006-11-17 09:32
超级版主 Posts 2,044 Credits 5,310 From 四川南充
Should this topic be deleted or merged? If merging is needed, I can handle it!
Floor54 youxi01 Posted 2006-11-17 10:30
高级用户 Posts 247 Credits 846 From 湖南==》广东
Merge them, thanks~
Floor55 namejm Posted 2006-11-17 11:32
荣誉版主 Posts 1,737 Credits 5,226 From 成都
Actually, Brother 3742668's essence-addition operation should be based on certain rules. When willsort was in office before, relevant rules had already been formulated. Please see here. It's actually me who is online almost every day but forgot to add essence, which is really dereliction of duty, sweat~.

To zouzhxi:

It feels that the post at the top of the building by Brother has some places that are not very convenient for retrieval in terms of typesetting, and posting my plan seems very wordy, and it may not be able to be accurately conveyed. So I want to directly modify the post at the top of your building to facilitate future retrieval. I want to ask for your opinion.
Floor56 zouzhxi Posted 2006-11-17 21:10
中级用户 Posts 177 Credits 430 From 广东深圳
Okay, as long as everyone finds it convenient, that's fine... Don't change it too drastically either. Hehe.
Floor57 NaturalJ0 Posted 2006-11-17 22:22
银牌会员 Posts 533 Credits 1,181
It's a very interesting set of questions. I carefully looked through all the questions today. ^_^
PS: Question 20 seems to be to find the greatest common divisor of three numbers
Floor58 不得不爱 Posted 2006-11-17 23:55
超级版主 Posts 2,044 Credits 5,310 From 四川南充
——————————————————Moderation Records——————————————————
Executor: Must Love
Operation: Merge topics into posts 46, 47, 48, 51, 52, 53
Explanation: The original topic "{ Use Batch Scripts to Make Fun Math Problems (Summary)}" and the topic "{ Use Batch Scripts to Make Fun Math Problems}" have a contextual relationship
————————————————————————————————————————
Floor59 NaturalJ0 Posted 2006-11-18 05:16
银牌会员 Posts 533 Credits 1,181
It seems that the essence post has been merged?
Floor60 namejm Posted 2006-11-18 05:27
荣誉版主 Posts 1,737 Credits 5,226 From 成都
Probably a certain moderator made a misoperation and removed the essence, and now it is re-added as essence. However, there is a slight regret that the original poster of this post was zouzhxi, but when returning to the post list interface, it has become youxi01. Hehe, hope the two don't mind.
Prev  1 2 3 4 5 6 7 … 10  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023