h1

Goodbye ugly, slow IE

February 19, 2010

 

Do you remember IE? We were suck dorks back then.

I like Microsoft. I really do.

But I HATE Internet Explorer.

Next week Europeans have to choose their Browser.

 

 

http://microsoftontheissues.com/cs/blogs/mscorp/archive/2010/02/19/the-browser-choice-screen-for-europe-what-to-expect-when-to-expect-it.aspx

Microsoft are being forced to implement this.

If IE was better then I’d some sympathy for Microsoft. But it’s not, so I don’t. The Internet is too important to allow people on it with rubbish browsers.

 

Choose anything other than IE

Chrome is lovely

Prettier

Other browsers can make use of prettier CSS. Compare the rounded corners and shadows used in this design with their flat, boxy IE counterparts below.

Mmmmm roundy

Faster

Other browsers are MUCH faster than IE.

For speed, I use Chrome.

When I want to show our software in its best light, I use Chrome.

Buggy piece of slow and ugly crap

I’ll stop before I start ranting.

Help Europeans out!

So c’mon geeks! When Twitter lights up next week, and you start getting calls from your Mom about this "Select your web browser(s)" screen, please don’t let people choose IE8.

I’ll be recommending Chrome. What about you?

Read about Chrome

 

h1

10 shallow thoughts about the big ass iPhone

January 29, 2010

The iPad was announced a couple of days ago.

We have to stay on top of new technologies, but we’d have to be living on the dark side of the moon to miss this one. The iPad was always going to be BIG news.

I haven’t seen or used an iPad – I’m just extrapolating from the fact that it appears to be one big iPod touch. 

I’ve been intrigued by the responses I’ve seen (many by other people who haven’t used one either). But hey! Wouldn’t it be awful if we all shared the same opinion of everything?

We’re mostly a Microsoft shop, but we have to support Apple devices too (esp with our web applications via optimized interfaces).

No Apple fanbois here.

In fact, in the past, we’ve tended to think of Apple fanbois as a bunch of skinny cappuccino (extra froth, extra sprinkles) drinking, low-fat hummus eating, jazz listening, smug and pretentious arses.

1. The name

iPad. Like a tampon. Only more expensive.

The name iPad was no surprise.  Bookies were taking bets on the name. iPad very quickly moved to a 3-1 favourite.  Some people KNEW the name and they wanted to make a few quid (probably through their friends and relatives).

I’m pretty surprised at how many people are still making Beavis and Butthead style jokes about the name [Disclaimer: I've never watched that show, but I believe they're infantile teens].

I can’t help but wonder if these people giggle when they talk about PADlocks or ThinkPADS.

Don’t get me wrong, I haven’t had a complete humour bypass.  I did see a few witty comments about the name and smiled, but I would have hoped the joke would have been considered old after 48 seconds (and not lasted 48 hours).

2. It’s a big ass iPhone/iPod touch

Giant iPhone

YES, AND THAT’S WHY IT’S FANTASTIC!

If you more than double the size of something it becomes something else.

A Shire horse is qualitatively different to a Shetland pony.

I’m not saying bigger is always better, don’t get your five year old daughter a Shire horse. Compact isn’t always better either,  don’t plough a field with a Shetland pony.

Bigger is better for some things, and makes some things possible that would have been difficult before.

I read a lot using my iPhone, but an iPhone is not the perfect size for reading. Something book sized is perfect for reading.

I also write notes on my iPhone, but it’s not the perfect size for jotting down quick notes.  Something book sized would be better.

3. It doesn’t run OS X

No root access. Its not a Mac.

Great! I can recommend one of these to stupid people friends and family and never have to explain keychains, talk them through folder structures or try and work out which browser they’re running.

I’m not picking on OS X. The same thing applies to Windows too.

I love Microsoft, but when I see SteveB showing off a slate running Windows7 I can’t help but cringe.

Many people shouldn’t be let loose with the power of a laptop, for the same reason that I shouldn’t be given a hammer or saw, something will get broken and it’ll need a professional to fix it.

This is the first mainstream device I’ve seen that can be given to almost anyone and allow them to perform 90% of the functions they’d normally have to use a computer for.

It can be a little frustrating to developers to not be able to get at the guts of our equipment, but sometimes I like simple stuff too.

4. It doesn’t handle multitasking

GIZMODO

I used to have Windows mobile device.  My most frequently used application was task manager just so I could kill stuff. Seriously.

I rarely have to reboot my iPhone  – and that feels good.

The iPhone/iPod (and I guess iPad) will do some stuff in background. It’ll download email, play music/audiobooks, listen for some notifications. Beyond that it’s nice knowing that when I hit the home button then the app is gone. Dead. Finished. And it won’t come back until I tell it to.

Okay, I’ll concede that there are a few apps that it would be nice to run in background, but not at the cost of CPU cycles and reliability.  Apple are right not to trust developers with the power and responsibility of background processes. I don’t trust developers either.

5. No Flash

engadget

I really don’t get this complaint. It’s like saying it doesn’t have annoying, CPU munching adverts.  Ummm… isn’t that a good thing?

The argument goes something along the lines of this: There are some videos that it won’t display and there are some internet games that can’t be played.

You can’t look at Lolcats videos? Good. My only regret is that it will give you more time to procreate and perpetuate the survival of the fatuous.

…and games?! Have you seen the AppStore? How many bloody games do you want?

Try reading a book instead. It does allow you to do that.

In fairness, there are some "proper" Flash apps out there – but I can usually find App Store or Ajaxed equivalents.

Personally, I think I’d pay extra for the lack of Flash support.

6. It doesn’t make phone calls or fit into my pocket

iPad OR iPhone No. It’s not a phone. If you have this requirement then you need a phone.

No. It’s not a pocket device. If you have this requirement then you need a pocket sized device.

It was always going to be a tablet. What did you expect?

It’s not a replacement for the iPhone (how stupid would Apple have to be to kill the iPhone?), in the same way that it’s not a replacement for your laptop.

7. It doesn’t have a camera

Apple iPad: an Antisocial DeviceNo. You’re right. I think this means some important use cases can’t be  fulfilled.  It is for this reason alone that I think lots of people should wait for version 2 (with their fingers crossed).

For me, it’s not a deal breaker, but it is a little disappointing.

It would be nice to be given a diagram by a client, photograph and annotate it.

I’ve written a couple of augmented reality apps (for my own use) that I won’t be able to run on it (because it doesn’t have a camera pointing forwards).

I understand the frustration that it can’t be used for video conferencing (because it doesn’t have a camera facing backwards). I don’t want to video conference, but it would look cool.

8. ..does mother-in-law/Grandma/Junior still need a computer?

iPad: an Apple for Mom

I hope not, but suspect that I’m wrong.  I believe that it still needs to see iTunes on a desktop or laptop to setup and backups will need a Mac or PC.

This seems like a solvable problem with software. I hope they solve it.

It’s not a problem for those of us that will use this in addition to a laptop, but I also see this as a replacement for the laptop aimed at all those users who don’t write code or use Photoshop.

9. The price

Entry level Wow! This is the biggest innovation of all.

The price of a mini, lots of applications and without the hassle of teaching someone an OS.

Given that laptops for many non-technical users seem to have a lifespan of about 3 years, I would imagine many of these users will get one an iPad instead once upgrade time comes along (or once they’ve installed so much crap that the machine can’t be salvaged without a time consuming rebuild).

10. How I’ll use mine

Mmmm... I spend hours late in the evening reading stuff on my iPhone, but even with iPhone optimized sites it’s like reading contractual small print.

I love being able to wander around reading from my iPhone, but the whole experience would be better if the device was book sized.

Then there’s note taking on client site.  I can take notes on my iPhone. It doesn’t work too badly.  The main drawback is it looks like you’re just pissing about on your phone instead of concentrating on the client.

A device that will make it easier for me to take notes on client site, without looking like bored teenager with an SMS obsession, is going to be great.

Then there’s specification, process documentation and non-coding stuff. The iWork stuff looks like it’ll do the job.

I sometimes sketch out designs on my iPhone or in (paper) notebooks.  The iPhone isn’t quite big enough to do this properly and I usually end up photographing pages from notebooks.  I like to think developers will create some apps to support this now they’ve got some "glass" to work with.

I still couldn’t leave my iPhone. If I’m on the move then I’ll still use my iPhone to quickly check my email or lookup a fact.  The iPad will be for the times when I normally carry a notebook or novel around as well.

Obviously, I can’t ditch my laptops either.

This replaces my paper notebooks, some reading books and evening iPhone web browsing.

That’s a big part of my life that just got better (and it doesn’t hurt that it looks bloody gorgeous too).

I really can’t believe an old MS warhorse like me looks to Apple for thought leadership.

But if I start drinking cappuccinos or eating hummus then I’m going to blame the Apple iPad.

h1

No drink challenge

September 4, 2009

 

I don’t think I drink a lot (although alcoholics probably say that too), but I do drink regularly.

I’m taking a challenge to not drink alcohol until Christmas. That doesn’t sound too hard. Does it?

Unfortunately, Twitter is my “pub”. Many evenings I sit back with some wine and chat to people on Twitter.  It’s a sort of social drinking.

Cheers Twitter!

Books have the opposite effect.  If I’m reading a good book then my glass of wine will go untouched. I completely lose track of time.

So, until Christmas I’m going to stop tweeting and read more.

It seems like a logical strategy.

This isn’t some sort of major lifestyle change. It’s not like I’m going to start exercising or anything radical like that.

I’m just going to stop drinking. How hard could it be?

h1

Spot the difference (for geeks)

August 22, 2009

The purpose of this post is to give an example of using the ensembl genome database to investigate the genomes by playing spot the difference between species.

Disclaimer

“I don’t know what the hell I’m talking about!” ~ Me, August 2009

I’m not a biologist. Qualification wise I stopped at O level biology (and I don’t think my biology teacher had a good grasp of the subject either).

I’m primarily a software developer and recreational mathematician.  So my job is exploring data, constructing models and testing stuff.

Anti-disclaimer

So what if I’m not a biologist? I’m also not a great fan of accepting opinion on the basis of authority. I read books, magazines and journals. I’m not completely stupid. I do accept expert opinion, but I also like to see data.

This means you shouldn’t take any of my opinions on board, which is just as well because I’m not offering any (did I mention that I don’t know what the hell I’m talking about?).

Objectives

  • I just want to look at some data and use it to influence my opinion. This has got to be better than either “Dawkins” told me or “God” told me.
  • I want people to tell me how to improve my understanding of the Ensembl database (although given the small number of people that look at this blog, that’s probably a tall order!).

(my) methodology

I find this fun but I am a geek and your mileage may vary

Go to http://www.ensembl.org/

image

In the dropdown where it says “All genomes” (which is clearly not ALL genomes, but whatever!) I’ll pick “Human” because I’m human and I guess there’s quite a lot of data in there.

Okay. Now I get this:

image

There are some sample entry points (whatever THAT means). Yeah, like I’ll pick those! The purpose of this is to explore, not follow a map.

Now the search box is pretty cool. You seem to be able to put all sorts of biology stuff in there and get results back.

Pick a "biologyish” word. Haemoglobin, cardio, limbic, … . Choose whatever you want. Some words don’t get many results (lung seemed to be a dead-end, whereas pulmonary wasn’t – the moral of the story might be to use big words).

I’ll choose marrow because it was the first word that popped into my head.

If you ONLY choose marrow too then I’ve failed. The purpose of this is to explore not follow my map (especially as I don’t really know where I’m going).

If your want, choose marrow now, but try other things later.

image

You’ll get something like this back.

image 

You see the little entries at the top? They tend to be dead ends (but I don’t know this to be true).

But the big one at the bottom looks like the database has some info.

Click on that and get a frightening screen.

image

Okay – I want to play spot the difference. See that “Genomic alignments (38)” link? Click on that.

Ah – now we’re getting somewhere.

image

There’re a bunch of letters. I know DNA uses the letters ACG and T. This looks like data.

(bear with me – nearly there)

Now let’s play spot the difference – against the Chimpanzee.

image

Some clever software lines them up against each other (sometimes there are blanks that the software shuffles in for you).

image

See that gene compared with the Chimp and Human? Their DNA is not identical.

Pretty close though. With humans and chimps it’s a bit like playing “Where’s Wally?”

Humans and dogs next.

Some bits are not even close:

image

Some bits are frighteningly close:

image

Next steps

You could ask the system to show you on a graph how close the different species are in terms of shared genome.

But isn’t it so much more fun to look at the streams of letters representing molecules making up the definition of a human and a chimp?

So now, try different genes (I picked genes involved with marrow at random).

Try other stuff too (we’ve only looked at a few of the features of this fantastic site). Explore the site. Have some fun.

Conclusion

Don’t talk saft! I don’t have a conclusion.

Get your own conclusions – that’s the point.

h1

Factorization of Beethoven numbers

July 24, 2009

 

Today, @ViolaMaths introduced me to Beethoven numbers.

They’re not mathematically interesting like other special numbers. They’re just pandigital numbers (without any zeros) in base 10.

Now, it can be seen that the digits sum to a 45, which is divisible by 9.  This means all Beethoven numbers are divisible by 9.

This means that if we to factorize Beethoven numbers we’d see a lot of 3s.

Anyway here are factorizations of the first few Beethoven numbers:

123456789=3 3 3607 3803
123456798=2 3 3 3 3 769 991
123456879=3 3 3 3 3 3 7 13 1861

@ViolaMaths’s Beethoven number factorized is:

396457812=2 2 3 3 37 297641

The largest prime we’d see is 109739359 in:

987654231= 3 x 3 x 109739359

Graphing the frequency

So here’s the frequency of the prime factors for the first few primes:

2 323145
3 909442
5 54148
7 60320
11 34885
13 30083
17 22678
19 20216

 

Looking at all the data and unsurprisingly lower primes are more frequent.

Ummm... where's the graph?

And that graph stretches a LONG way to the right.

Let’s look at that line on the left:

Up then down.

We can see from the mini-table above that there’s a spike at 3 (as expected). I’d guessed that we’d see a number of 2s a bit lower than 9! (362880), the actual number was 323145.

There’s a bit of dip in the 5s, but as we’ve taken out the numbers ending in zero (Beethoven didn’t write a zeroth symphony).

If Beethoven had only written 7 symphonies then we wouldn’t get any 3s.

You’d expect to see effects like that when the numbers have a relationship to the number base.

 No surprise

Conclusion

None really. It allowed me to make some guesses about the frequency before running the test app, and the graph looked pretty much as I expected it to.

A fun exercise – nothing more interesting than that.

h1

Constructing Niven repunit – proofs

July 23, 2009

 

Revisiting the Saturday problem.

Given a number made only out of 1s, when is it exactly divisible by the number of 1s. How do we construct Niven Repunits?

This isn’t a tough problem, but my maths is rusty and I struggled to find a proof. I also wanted a proof that anyone with high school maths could follow.

In previous posts I put down some conjectures – it’s time to show some proofs. I’ve tried to make these as simple as possible.

Definitions

R_{n}^{b}

is a repunit (made of repeated 1s with n digits in number base b).

Algebraically they can be written as

R_{n}^{b}=\sum_{i=0}^{n-1}b^i=\frac{b^n-1}{b-1}

A Niven repunit is divisible by the sum of its digits.  As all the digits are “1” this is equivalent to saying it’s divisible by the number of digits.

ie. A Niven repunit satisfies:

 

R_{n}^{b}\equiv0\pmod{n}

 

A pretty obvious lemma

First we’re going to show if:

a\equiv1\pmod{p}

then:

a^n\equiv1\pmod{p}
Proof (although you probably don’t need it)

When

n=0

 

a^0=1

 

a^0\equiv1\pmod{p}

Using induction

Assume

a^i\equiv1\pmod{p}

 

a^{i+1}=a^ia

 

\equiv1a\pmod{p}

We know:

a\equiv1\pmod{p}

So

1a\equiv1\pmod{p}

 

Easy Niven repunits theorem

This first theorem lets us find our first Niven repunits really easily by just ensuring the number of digits is a factor of one less than the number base.

Theorem

Given a repunit with n digits in base b.

When n is a factor of b-1

The repunit will be exactly divisible by n

IE.

R_n^b\equiv0\pmod{n}

If n is chosen such that

b-1\equiv0\pmod{n}

Proof

Because:

b-1\equiv0\pmod{n}

We know:

b\equiv1\pmod{n}

One definition of a repunit is:

R_n^b=\sum_{i=0}^{n-1}b^i

So using

b\equiv1\pmod{n}

and the lemma we arrive at.

R_n^b\equiv\sum_{i=0}^{n-1}b^i\equiv\sum_{i=0}^{n-1}1\equiv{n}\equiv{0}\pmod{n}

 

Second set of Niven repunits

This second theorem allows us to create huge Niven repunits based on the first and second type of repunit. e.g. Why repunits with 2,997 are Niven.

Theorem

Given a Niven repunit, a new Niven repunit can created with a number of digits that is obtained by multiplying the number of a digits in the first repunit by any factor of the first repunit.

R_n^b\equiv0\pmod{n}

Choosing a value of p such that:

R_n^b\equiv0\pmod{p}

Then:

R_{np}^b\equiv0\pmod{np}

Proof

By definition of a repunit:

R_{np}^b=\frac{b^{np}-1}{b-1}

Multiplying top and bottom by

b^n-1

 

=\frac{b^n-1}{b^n-1}\frac{b^{np}-1}{b-1}

Rearranging

=\frac{b^n-1}{b-1}\frac{b^{np}-1}{b^n-1}

Moving the powers about

=\frac{b^n-1}{b-1}\frac{{(b^n)}^p-1}{b^n-1}

 

Note that by the definition of repunit:

R_n^b=\frac{b^n-1}{b-1}

and

R_p^{b^n}=\frac{{(b^n)}^p-1}{b^n-1}

So

R_{np}^b=R_{n}^bR_{p}^{b^n}

We know our original repunit was divisible by n (because it was a Niven repunit).

ie.

R_n^b\equiv0\pmod{n}

If we can just prove that the other repunit is divisible by p we’ll be done.

It’s not enough to say the first repunit is divisible by p because p and n could be the same number – so just because the 111 is divisible 3 it doesn’t make 111 divisible by 9 – we need to prove the second p digit repunit in base b^n is also divisible by 3 (in that example).

i.e. if:

R_{p}^{b^n}\equiv0\pmod{p}

then

R_{np}^b\equiv0\pmod{np}

We can use a similar proof to the first theorem:

We know:

R_n^b=\frac{b^n-1}{b-1}

and we chose p to be a factor of this so

\frac{b^n-1}{b-1}\equiv0\pmod{p}

So:

b^n-1\equiv0\pmod{p}

So

b^n\equiv1\pmod{p}

any by definition

R_p^{b^n}=\sum_{i=0}^{p-1}(b^n)^i

Remembering

b^n\equiv1\pmod{p}

R_p^{b^n}\equiv\sum_{i=0}^{p-1}(b^n)^i\equiv\sum_{i=0}^{p-1}(1)^i\equiv{p}\equiv{0}\pmod{p}

 

Which is what we wanted to prove.

So in a nutshell

R_{np}^b\equiv0\pmod{np}

Because

R_{np}^b=R_{n}^bR_{p}^{b^n}

 

R_n^b\equiv0\pmod{n}

and

R_{p}^{b^n}\equiv0\pmod{p}

 

Notes

Given these two theorems we can construct huge Niven repunits in any number base. It does seem a bit odd that if we start with a three digit repunit in base 10 we could end up multiplying it by a 37 digit repunit in base 1000!

But if you think about how base 1000 would be represent in decimal and how long multiplication works you’d see that it was:

111×1001001001001…1001

 

If you did the long multiplication you can see why you’d get another repunit and why it would be Niven.

h1

A fortunately timed trip

July 18, 2009

 

So where are we?

I’m looking at repeated sets of 1s that are divisible by the number of 1’s.

So:

111 is divisible by 3

111,111,111 is divisible by 9

Whereas

11 isn’t divisible by 2

1,111,111 isn’t divisible by 7

..and generalized to different number bases.

e.g. 1,111 in base 3 = 27+9+3+1 = 40 which is divisible by 4.

I called these Saturday numbers. The proper name is a Niven Repunit. Niven because it’s divisible by the sum of its digits and repunit because it’s a repeated unit – repeated 1s.

Defining repunits

Okay – in any number base a repunit is:

R_{n}^{(b)}=\sum_{i=0}^{n-1}b^i=\frac{b^n-1}{b-1}

Where 

b

is the number base and 

n

is the number of digits.

And we want:

R_{n}^{(b)}\pmod{n}\equiv0

Which is a fancy way of saying if you divide it by 

n

you get 0 remainder (so it exactly divides by

n

). Which is exactly what we’re after.

Enter the mathematicians (Peter and Paul)

@PeterRowlett and @paulhertz swim in a sea of mathematics (whereas I swim in a sea of software development), they know how to do this stuff – and importantly where to look things up.

Paul did a search and found this:

Niven Repunits

Which looks promising.

Niven Repunits.  That’s exactly what I’m looking for!

Peter did a search and found that Fibonacci Quarterly is at the British Library:

British library

My trip

As it happens, I’m in London on business next week.  I can quite easily make a detour to the British Library to look this up.

But it is helpful to define success/fail criteria before doing things, so these are my criteria for success/failure next week (wrt library trip – success for the business trip will be defined by the quality of the business requirements!).

 

What I hope I find

I hope to get a better understand of numbers, and why (whether?) my original conjectures are true.

What I don’t hope to find

The title of the article is Niven Repunits and

10^n\equiv1

Now if all the article tells me is that Niven Repunits are values of 

n

that satisfy

10^n\equiv1

then it’s just restating the problem.

 

Why?

 

R_{n}^{(b)}=\frac{b^n-1}{b-1}

 

Well if

\frac{b^n-1}{b-1}\pmod{n}\equiv0

Then

a\frac{(b^n-1)}{b-1}\pmod{n}\equiv0

Where

a\in\mathbb{N}_0

Let

a=b-1

Then

b^n-1\pmod{n}\equiv0

or

b^n\pmod{n}\equiv1

 

Neater (but still obvious)

So saying a repunit is a Niven number (in base b) when:

b^n\pmod{n}\equiv1

is really just restating the original problem.

I hope I don’t find this – because even I can already see that!

 

Undue pessimism?

I’m fairly sure that getting something published in any maths journal takes more than a fairly obvious restatement of the problem.

I’m probably reading too much into the title. I don’t expect they publish the question and the conclusion on the same line!

I’ll post an update next week.

h1

Twitter to the rescue

July 15, 2009

I asked my followers on twitter to help me in my search to understand what I’d called Saturday numbers better (I now have a proper name for them. More on that later).

@paulhertz replied an gave me some helpful links.

Firstly – a name

What I’ve been calling a Saturday number in base b is a b-Niven repunit.

How cool does that sound?

I didn’t spend the weekend messing about with some problem I heard on a podcast. I was investigating b-Niven repunits. I now what that means, but it still sounds awfully impressive.

A Niven number is one that is divisible by the sum of it’s digits (so 18 is divisible by 1+9 so is a Niven number, 19 isn’t divisible by 1+9 so it isn’t one).(Read more on Wikipedia).

A repunit has repeated digits. (Read more on Wikipedia).

That’s why my Saturday numbers are called b-Niven repunits (for base b).

Proper maths

Because @paulhertz also sent me some references and I’ve been following them up:

image

..which appears to be a bit of a dead end. I might have been able to track it down back when I was at University. But you might be surprised to know that I don’t have a 1989 copy of Fibonacci Quarterly on my shelves.

And this:

image

http://www.maths.tcd.ie/pub/ims/bull59/R5901.pdf

That’s more like it!

I’m going to look forward to reading this one.

h1

Revisiting Saturday’s problem

July 14, 2009

The problem

We’re looking at numbers all made of “1”s that have a special property.

They are made of repeated 1s (repunit) and are exactly divisible by the number of 1s.

111 (3 1s) is divisible by 3

111,111,111 (9 1s) is divisible by 9

111,111,111,111,111,111,111,111,111 (27 1s) is divisible by 27

..but not all repunits have this property.

11 (2 1s) isn’t divisible by 2

1111 (4 1s) isn’t divisible by 4

I need a name for this special property. I’m going to call numbers with this property Saturday numbers (because Peter’s podcast was on a Saturday).  We’ll define it more formally later.  If anybody knows a proper name for these then let me know. Let me know if Saturday number means some else too.

Note, whether something is a Saturday number depends on the number base you’re writing it in.  We’ll consider this too below.

Following the examples?

You’ll probably want to use Wolfram|Alpha.

Open it up now.

I’ll wait.

So here’s a sample Wolfram|Alpha query:

(b^n -1)/(n*(b-1)) ,b=10,n=9

Change b and n to see if you get a whole number (a Saturday number).

If you’re really cruel try:

(b^n -1)/(n*(b-1)) ,b=10,n=27*757

to test a 20,439 digit long Saturday number.

Check in Wolfram|Alpha?

Heh – image that:

“Think of a 20,439 digit number where all the digits are the same but not zero. Divide it by the sum of the digits. The answer is:”

A really big number

…and on and on for a whole load more digits. Check out out the scroll thumb on the right of that screenshot – ouch!

…maybe not such a good puzzle to pose your friends… 

 

Definitions

Repunit

R_n^{(b)}

I mean an “n” digit repunit in base b.

A repunit can be written as:

R_{n}^{(b)}=\sum_{i=0}^{n-1}b^i=<br />
\frac{b^n-1}{b-1}” title=”R_{n}^{(b)}=\sum_{i=0}^{n-1}b^i=<br />
\frac{b^n-1}{b-1}” /></div>
</p>
<blockquote><p>Example:</p>
<div style=R_{3}^{(10)}

means a number with three 1s in base ten (the number at the bottom is the number of digits the number in brackets at the top is the number base).

R_{3}^{(10)}=10^2+10^1+10^0=100+10+1=111

or

R_3^{(10)}=\frac{10^3-1}{10-1}=\frac{999}{9}=111

 

If you don’t like to think of this as number bases then pretend I’m taking about the expression below instead. I’ll be doing all my working out in base 10 anyway, so trying to think in crazy number bases would just confuse the situation.

\sum_{i=0}^{n-1}b^i

Saturday number

So a number

R_{n}^{(b)}

is a Saturday number if satisfies this condition:

R_{n}^{(b)}\pmod{n}\equiv0

The first cases – 1st conjecture

Let:

b-1=\prod{p_i^{\alpha_i}}

When

n=\prod{p_j^{\beta_j}}

and

\{p_j\}\subseteq\{p_i\}

Then

R_{n}^{(b)}\pmod{n}\equiv0

 

What I’m trying to say is:

When n is a product of powers from the set of prime factors of b-1 it will be a Saturday number.

 

Example
Base 10

Firstly we find the prime factors of one less than our number base.

10-1=9=3^2

So 3 is our prime factor. When n is a power of 3

R_3^{(10)},R_{3^2}^{(10)},R_{3^3}^{(10)},...R_{3^j}^{(10)}

Will all be Saturday numbers.

That is to say in base 10: 3,9,27,81,243 etc digit numbers will be Saturday numbers (divisible by the number of digits in the number).

Base 13

13-1=12=2^23

So when n is a product of powers of 2 and/or 3 it will give us a Saturday number

R_2^{(13)},R_{3}^{(13)},R_{2^j3^k}^{(13)}

That is to say in base 13: 2,3,4,8,9 etc digit numbers will be Saturday numbers.

 

The second cases – 2nd conjecture

These second cases mean that if we have a Saturday number (and the first case gives us some trivial cases to work from) we can find a bunch more more surprising Saturday numbers.

Let

Q_n^{(b)}=\frac{R_n^{(b)}}{n}

Where

R_{n}^{(b)}\pmod{n}\equiv0

ie.

R_{n}^{(b)}

    is a Saturday number.

(by the definition of a Saturday number we know

Q_n^{(b)}

    is an integer)

Factorising:

Q_n^{(b)}=\prod{q_i^{\beta_i}}

Then:

R_{m}^{(b)}\pmod{m}\equiv0

When:

m=n\prod{q_j^{\gamma_j}}

That is if you multiply n by any combination of powers of prime factors of

Q_n^{(b)}

then you will get another Saturday number.

 

Base 10

 

Example 1:

The first Saturday number n=3 (prime factors of 10-1=3 x 3)

R_3^{(10)}=111

Q_3^{(10)}=\frac{111}{3}=37

Check in Wolfram|Alpha?

Therefore

R_{3\times37}^{(10)}\pmod{3\times37}\equiv0

That is

R_{3\times37}^{(10)}

Is also a Saturday number.

Check in Wolfram|Alpha?

So an 111 digit number will be a new Saturday number (note unlike the first case it isn’t a simple power of 3), as will 3×37x37 digit numbers etc.

This makes Peter’s original podcast puzzle even more interesting. 37 isn’t just the result of the curiosity, it’s the source of a new one.

 

Example 2:

R_9^{(10)}=111111111

Q_3^{(10)}=\frac{111111111}{9}=12345679=37\times333667

So the 9 digit base 10 Saturday number generated some new Saturday numbers for us:

R_{9\times37}^{(10)}\pmod{9\times37}\equiv0

Check in Wolfram|Alpha?

and

R_{9\times333667}^{(10)}\pmod{9\times333667}\equiv0

and

R_{9\times37^i\times333667^j}^{(10)}\pmod{9\times37^i\times333667^j}\equiv0

etc.

 

Example 3:

R_{27}^{(10)}=111111111111111111111111111

Q_{27}^{(10)}=\frac{111111111111111111111111111}{27}

=4115226337448559670781893

=37\times757\times333667\times440334654777631

So:

R_{27\times37}^{(10)},R_{27\times757}^{(10)},R_{27\times333667}^{(10)},R_{27\times440334654777631}^{(10)},R_{27\times757\times333667}^{(10)}

are all Saturday numbers.

So if you have a number with 20,439 (27×757) digits (all 1) then it will be divisible by 20,439.

These numbers become unimaginably large quite quickly – although some are testable. I have run up to 100,000 digit numbers and found this to be true. Let’s look at some other number bases.

Base 4

In base 4, our 1st cases will also be powers of 3.

All numbers will be represented in base 10 for simplicity.

Example 1:

R_3^{(4)}=21

Q_3^{(4)}=\frac{21}{3}=7

Giving us

R_{3\times7}^{(4)},R_{3\times7^2}^{(4)}

as new Saturday numbers.

Check 21 digit base 4 numbers in Wolfram|Alpha?

Check 147 digit base 4 numbers in Wolfram|Alpha?

 

Example 2

R_9^{(4)}=87381

Q_9^{(4)}=\frac{87381}{9}=9709

9709=7\times19\times73

So

R_{9\times7}^{(4)},R_{9\times19}^{(4)},R_{9\times73}^{(4)},R_{9\times7\times73}^{(4)}

etc are all Saturday numbers.

Base 3

Over the last week we’ve been looking at the “funny case” of 20 digit repunits in base 3 and scratching our heads.

Now we can see why it happens.

Start with the trivial cases n=4

R_4^{(3)}=40

Q_4^{(3)}=\frac{40}{4}=10=2\times5

Giving us

R_{4\times5}^{(3)}=R_{20}^{(3)}

as another Saturday number.

Check in Wolfram|Alpha?

Note that you can also construct new Saturday numbers from 2nd case Saturday numbers.

That’s your lot – 3rd conjecture

All Saturday numbers are either 1st or 2nd case Saturday numbers.

h1

Reflection

July 13, 2009

Time to reflect on what I’ve learnt:

  1. I’m becoming quite comfortable with LaTeX – It’s always been a struggle in the past, but I think I’m getting the hang of it and I’m starting to appreciate what an elegant language it is.
  2. The BigInteger class rocks for investigating this sort of stuff.
  3. I remembered how hard it is to express your ideas in maths notation. With whiteboards at work, we tend to scribble, draw lines and talk.  This doesn’t work remotely.  Also, at work we rarely have to really formally prove.
  4. WolframAlpha isn’t as pointless as I first thought.  I tended to write code for real investigation but it was useful to test the output from the code.
  5. Collaborating using twitter and blogs is HARD!  I think this would have helped:
    • A shared workspace – like a blog (with LiveWriter support and supported LaTeX)  – but not a blog.  A shared, rich editing space.
    • The ability to add notes and comments to lines in the blogs (e.g. Peter is a much better mathematician than I am. I would have liked to add notes questioning where he was going (or if he could give a specific example)).
    • You’d probably need read, read/comment & read/write on a per problem basis. I don’t want to give anyone full access to my blog and they probably would feel the same. Besides – I’m not sure a blog is the right metaphor.
    • Twitter helped for quick observations and conjectures (like n will never share a prime factor with x), but these tweets can get lost and confused other followers.
  6. Nobody else joined in.  It would be nice if they had, but it probably isn’t everyone’s cup of tea.  In saying that, if mathematicians could see other maths problems that were being discussed they might join in (although I suspect for serious stuff they’d be careful about losing control).
  7. This shit is addictive.  I used to lose weeks on these sorts of things when I was younger, I could easily see myself going the same way over this weekend.
  8. Peter Rowlett is a very nice chap.  His job is to promote mathematics, but teaching us one person at a time probably doesn’t scale well!

To finish with – here’s a picture I generated whilst looking at the problem.

 Not the world's most interesting chart