473,396 Members | 2,151 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.

This problem may take some time...and programming.

Hunderpanzer
I was just looking around on this site, and went into the Jobs category.

I clicked on an interesting job advertisement for BitTorrent - I'm sure we all know what that is, and as a test, the employer wanted someone to give the answer to a problem which would prove their understanding of their math (maybe not so much) and python programming skills.

Don't worry, I'm not looking to steal the answer and take the job. I know nothing of Python, but perhaps it can be done in another language ?

Here it is. Let's see some results, and maybe some code used ?



What is the exponent of the largest power of two whose base seven representation doesn't contain three zeros in a row?

Good Luck!
Jul 23 '07 #1
5 1465
MMcCarthy
14,534 Expert Mod 8TB
Since the job is over 2 months old, it's probably not still available anyway.
Jul 23 '07 #2
Since the job is over 2 months old, it's probably not still available anyway.
True, but I've seen some pretty interesting math puzzles in this area of the forum, so I thought it would be cool to share it.
Jul 23 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
True, but I've seen some pretty interesting math puzzles in this area of the forum, so I thought it would be cool to share it.
True, we do have some maths geniuses around.
Jul 23 '07 #4
Banfa
9,065 Expert Mod 8TB
What is the exponent of the largest power of two whose base seven representation doesn't contain three zeros in a row?
Not as easy as it sounds, Python probably unqiuely suited to this problem, this is because most programming languages have a mimited set of integer types, for instance C/C++ typically has

8 bit integers
16 bit integers
32 bit integers
64 bit integers

If you need anything else this needs to be programmed around. This is true for most languages, they have a set of limited integers, however Python has 2 types of integer

32 bit
any size you want

The second type clearly gives a very large problem domain, if you look at the base 7 representations of the first 31 powers of 2 (numbers fitting into a signed 32 bit int) none of them have 3 consecutive zeros.

The first question has to be

Are there any powers of 2 which have 3 consecutive 0s in their base 7 representation?
Assuming the answer to that is yes the question then makes an assumption:
At some value N the base severn representation of 2 ** x for all x >= N contains at least 3 consecutive 0s.
This statement is not self evidently true to me however assuming that it is true then you need to find the minimum value of N and then the answer will be N-1.

Personally I would say thorum solving like this involves mainly maths with little need for programming. In fact I think it would be very hard to write a program to some this to be true, you need to some something to be true for all x >= N not something a computer is very good at doing. Computers are good at doing something for all MIN_LIMIT <= x <= MAX_LIMIT but for this problem there is no max limit, a mathematical proof is required.
Jul 23 '07 #5
Not as easy as it sounds, Python probably unqiuely suited to this problem, this is because most programming languages have a mimited set of integer types, for instance C/C++ typically has

8 bit integers
16 bit integers
32 bit integers
64 bit integers

If you need anything else this needs to be programmed around. This is true for most languages, they have a set of limited integers, however Python has 2 types of integer

32 bit
any size you want

The second type clearly gives a very large problem domain, if you look at the base 7 representations of the first 31 powers of 2 (numbers fitting into a signed 32 bit int) none of them have 3 consecutive zeros.

The first question has to be

Are there any powers of 2 which have 3 consecutive 0s in their base 7 representation?
Assuming the answer to that is yes the question then makes an assumption:
At some value N the base severn representation of 2 ** x for all x >= N contains at least 3 consecutive 0s.
This statement is not self evidently true to me however assuming that it is true then you need to find the minimum value of N and then the answer will be N-1.

Personally I would say thorum solving like this involves mainly maths with little need for programming. In fact I think it would be very hard to write a program to some this to be true, you need to some something to be true for all x >= N not something a computer is very good at doing. Computers are good at doing something for all MIN_LIMIT <= x <= MAX_LIMIT but for this problem there is no max limit, a mathematical proof is required.
I see. Maybe it's not such a great puzzle then.

I'll keep an eye out for others.
Jul 23 '07 #6

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

Similar topics

4
by: vivek | last post by:
Hi all, Here we are conducting a QIP program for teachers in other colleges. I am assigned the job of taking lectures in Python. Although there will be not much time (exactly speaking : 4 hours)...
53
by: Cardman | last post by:
Greetings, I am trying to solve a problem that has been inflicting my self created Order Forms for a long time, where the problem is that as I cannot reproduce this error myself, then it is...
2
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/newsgroup-faq Posting-Frequency: once a week Last-modified: 2004-07-26 Version: 2.00 URL: <http://css.nu/faq/ciwas-mFAQ.html> Maintainer: Jan Roland Eriksson...
6
by: Praveen | last post by:
I am pretty much curious about the authenticity of the following article that I recieved from a friend of mine. It is an interview of Bjarne Stroustrup in 1998. I would appreciate some...
59
by: Alan Silver | last post by:
Hello, This is NOT a troll, it's a genuine question. Please read right through to see why. I have been using Vusual Basic and Classic ASP for some years, and have now started looking at...
17
by: Mike Labosh | last post by:
I can say this: int commandTimeout = Convert.ToInt32(ConfigurationSettings.AppSettings); but I can't say this: int commandTimeout = (int)ConfigurationSettings.AppSettings; Or maybe my VB...
0
by: Samineni | last post by:
Welcome to comp.lang.c++! Read this first. This post is intended to give the new reader an introduction to reading and posting in this newsgroup. We respectfully request that you read all the...
83
by: deppy_3 | last post by:
Hi.I am started learning Programm language C before some time.I am trying to make a programm about a very simple "sell shop".This programm hasn't got any compile problem but when i run it i face...
46
by: ajba74 | last post by:
Hi fellows, I am reading some books to learn the C programming language, and sometimes I have the feeling that when somebody becomes a C expert, he must learn a more modern and object-oriented...
16
by: Stef Mientki | last post by:
This might be a very weird construction, but it's the most easy way in translating another language into Python (for simulation). Although it works, I like to know if this a valid construction: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.