473,545 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Find the number

debasisdas
8,127 Recognized Expert Expert
A ten-digit number contains every digit from 0 to 9. The digits are
arranged so that the number formed by the first two digits, reading from
left to right, is divisible by 2, the number formed by the first 3 digits
is divisible by 3, the first 4 by 4, and so on until the whole number is
divisible by 10.

can you please find the number ...!
Jul 16 '07 #1
5 2552
Stang02GT
1,208 Recognized Expert Top Contributor
im not gonna lie this ones tricky :}
Jul 16 '07 #2
jkmyoung
2,057 Recognized Expert Top Contributor
Let the 10 digits of the number be a-j, eg:
abcdefghij
abcdefghi0 div by 10
abcd5fghi0 div by 5

div by 2
even digits must be in 2, 4, 6, 8, 0
odd digits must be in 1, 3, 5, 7, 9.

div by 3
a+b+c mod 3 = 0
d+e+f mod 3 = 0
g+h+i mod 3 = 0

div by 4
Since c is odd, d must be 2 or 6.
similarly, since g is odd, h must be 2 or 6.
-> b and f are 4 and 8 in some order.

div by 8
Since f is 4 or 8, gh mod 8 = 0. Possibilities for gh:
32, 72, 16, 96

combined with div by 9 (3), the possibilities for ghi:
321, 327, 723, 729, 963,

d + 5 + f (mod 3) = 0
d + f = 1 (mod 3)
possibilities for def, given that f = 4 or 8 and e = 5
654, 258

do div by 7 seperately. So combining the options, and then taking mod of the first 7 digits we have:

987654321 => 5 mod 7
789654321 => 4 mod 7
981654327 => 2 mod 7
189654327 => 5 mod 7
981654723 => 6 mod 7
189654723 => 2 mod 7
183654729 => 6 mod 7
381654729 => 0 mod 7
147258963 => 6 mod 7
741258963 => 2 mod 7

Answer is
3816547290
Jul 16 '07 #3
Stang02GT
1,208 Recognized Expert Top Contributor
wow....very impressive....i dunno if i ever would have figured that out
Jul 16 '07 #4
debasisdas
8,127 Recognized Expert Expert
Answer is
3816547290
thanx for the explanation
Jul 17 '07 #5
Person
67 New Member
[Edit]
Sorry, didn't understand problem (don't know how to delete a post).
Jul 17 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

8
2130
by: Jaime Wyant | last post by:
Will someone explain this to me? >>> "test".find("") 0 Why is the empty string found at position 0? Thanks! jw
2
2197
by: Sigmund Skjelnes | last post by:
Hi! Trying to get a simple cpp program to compile, I'd got the linker complaining it could'nt find eiter cout nor endl or other object which belong to iostream. I'd had to use stdiolib to get the program working. I'd have attached the source code, some of it is Norwegian, but I'd think it will make sense anyway. Do anybody have a clue why...
13
7085
by: CHRISTOF WARLICH | last post by:
Hi, does anyone know of an efficient way to find the number of digits (i.e. the most significant position that is 1) of a binary number? What I found so far is: - digits = (int) log2(number), where log 2 means log for base 2 - shifting until 0: for(j=0; number>>=1; j++); digits = j; - binary search shifting
8
5470
by: jquest | last post by:
Hi Again; I have had help from this group before and want to thank everyone, especially PCDatasheet. My database includes a field called HomePhone, it uses the (xxx)xxx-xxx format to include area code. When a customer calls, I currently use Ctrl F with the HomePhone field highlighted. Then I enter the last 4 digits and use the find next...
13
12294
by: mike | last post by:
I have ListArray with number in Eg: 1, 1.456, 2.43, 4, 6.78 next i have a decimal variable containing one number EG: 1.786 Could someone please tell me how i find the "closest match" number below the decimal variable from the arraylist. Thanks ever so much in advance
21
8122
by: Imran | last post by:
I have a vector of integers, such as and I want to find out the number which occurs most frequently.what is the quick method. My array size is huge. what I am doing is 1. find out the maximum value N 2. loop through 1...N 3. count # times each occurred
1
4203
by: vmoreau | last post by:
I have a text and I need to find a Word that are not enclosed in paranthesis. Can it be done with a regex? Is someone could help me? I am not familar with regex... Example looking for WORD: (there is a WORD in ( my string WORD )) and * WORD * to (find WORD) and * WORD * Should give me the to word between star (star ar not part of string)
3
7554
by: vijaybaskar3108 | last post by:
hi, I just want to know how to find complements for a number. These are the following answers for complements 2's complement(10110)=01010 4's complement(1230)=2110 5's complement(4322)=0123 please tell me how to do it.how this answers comes.This is a global edge question. please also tell me how to find 8's complement(7436) please alos...
0
22435
by: zephyrus360 | last post by:
This is about a technique to find the mod of a very large integer with a normal small integer. I recently encountered this problem when I needed to compute the modulus of a very large number with a normal integer. I needed this in a C++ program running on a 32-bit UNIX platform. The problem was that the number was 28 digits long and no native...
11
10240
by: zj262144 | last post by:
Hi, I'm a C beginner. I want to write a C. The pseudocodes are like this: User enters some numbers (use -1 to end) The compiler find and delete the maximum and minimum numbers Then average remained numbers Finally print the result Thanks in advance!!!
0
7475
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7409
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7771
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5982
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5343
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4958
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3465
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1900
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.