New To Ubuntu

Monday, December 11, 2006

Problem 4.8 of A Concise Introduction to Pure Mathmatics

An n-digit positive integer is a Smallbrain number if it is equal to the sum of the nth power of its digits. So for example, 371 is a Smallbrain number, since 371 = 3^3 + 7^3 + 1 ^3
Prove that there are no Smallbrain numbers with 1000 digits (i.e. there is no 1000-digit number that is equal to the sum of 1000th powers of its digits)

This turns out much trivial than I thought:

For a 1000 digit number, the greatest sum we can have for:
a1^1000 + a2^1000 + ...a1000^100
is a1 = a2 = .... = a1000 = 9, so the sum is
1000*9^1000

The smallest 1000 digit number we can have is

1*10^999

The ratio of the two numbers is:

1000*9^1000/10^999 =
9^1000/10^996

Use log to make calculation easier, this will change the ratio but will not change which one is bigger

log(9^1000)/log(10^996) =
1000*log(9)/996 = 0.958 (with a calculator of course)

So for any 1000 digit number, it is always true that

a1^1000 + a2^1000 + .... + a1000^1000 < a1*10^999 + a2*10^998....

Therefore, there is no Smallbrain number with 1000 digit.

It turns out, there are quite a few Smallbrain numbers:

3 digits: 153, 370, 371, 407

4 digits: 1634, 8208, 9474

5 digits: 5 4748, 92727, 93084

This is the C++ code to find Smallbrain numbers:

http://www.box.net/public/zf9114ujjr

Labels:

Sunday, December 03, 2006

Install Extra Codecs (MP3/WMV, etc)

MP3, WMV format does not work on Ubuntu's default installation.

To enable those, follow this guide

http://ubuntuguide.org/wiki/Ubuntu_Edgy#How_to_install_Multimedia_Codecs

sudo apt-get install gstreamer0.10-ffmpeg gstreamer0.10-gl gstreamer0.10-plugins-base \
gstreamer0.10-plugins-good gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse \
gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse libxine-extracodecs w32codecs
If WMV still not working, try this

https://help.ubuntu.com/community/RestrictedFormats#head-6c942d1939d97331f96e42b63774003fde7daed5

wget -c http://www.debian-multimedia.org/pool/main/w/w32codecs/w32codecs_20061022-0.0_i386.deb
sudo dpkg -i w32codecs_20061022-0.0_i386.deb
If still not working, try this

http://ubuntuforums.org/showthread.php?p=1649012

rm -rf ~/.gstreamer-0.10
gst-inspect-0.10

Finally worked for me when I finished the last step.

Labels: