473,396 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Find the number

debasisdas
8,127 Expert 4TB
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 2543
Stang02GT
1,208 Expert 1GB
im not gonna lie this ones tricky :}
Jul 16 '07 #2
jkmyoung
2,057 Expert 2GB
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 Expert 1GB
wow....very impressive....i dunno if i ever would have figured that out
Jul 16 '07 #4
debasisdas
8,127 Expert 4TB
Answer is
3816547290
thanx for the explanation
Jul 17 '07 #5
Person
67
[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
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
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...
13
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),...
8
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...
13
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...
21
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...
1
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:...
3
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...
0
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...
11
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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...

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.