Wednesday, January 26, 2005

Spring 2005 schedule

another semester starts!

Tuesday, January 25, 2005

linux distributions....which one?

I'm currently using gentoo on my desktop and laptop...
But archlinux sounds tempting and peanut is released.
Peanut is based on slackware 5 and claims it can install slackware 10 packages...and it's livecd...reallly tempting...
But the thing is peanut livecd requires password and no one know it but the author of the distribution....
Vectorlinux is nice also. But i don't really like slackware packages...unless I use swaret, I have to rely on google.com to resolve dependencies...

so, I want to keep gentoo now for my desktop.
but for the laptop, I'll maybe try arch or peanut.
I think peanut is good for live recovery cd....
I might install ubuntu on laptop...

the above pre tag gives validation error...
I don 't know how to resolve it...

Tuesday, January 04, 2005

My java code that creates prime tables...seems to be working...but not sure..

/**
* skynare
* Prime Testing..
* Jan 4 2005
*/
import java.io.*;
public class Prime {
public static boolean isPrime( long p ) {
//long bound = Math.round( Math.sqrt(p) )++;//ceiling of p^(1/2)
//boolean found = false;
for( long i=2; i<=Math.sqrt(p); i++ ) {//starting from the smallest prime
//to the square root of p.
if( p%i == 0 ) {//found divisor of p [2, p^(1/2)]
return false;//so, p is not a prime
}//if
}//for
//not found a divisor of p in [2, p^(1/2)]
return true;//so, p is a prime.
}//isPrime

public static void main ( String args[] ) throws IOException {
String fileName = "primetable.txt";
long bound = Math.round( Math.pow(2, 63) ) - 1;
//long bound = 7919;
PrintWriter output = new PrintWriter( new OutputStreamWriter(
new FileOutputStream(fileName)) );
int count = 0;
for( long i=2; i<=bound; i++ ) {
if( isPrime(i) ) {
output.print(i+"\t");
count++;
}//if
if( count == 10 ) {
output.println();
count = 0;
}//if
}//for
output.close();
}//main
}//Prime

Monday, January 03, 2005

New Year and New Theme

Now, my blog has new theme and new look..
If you click "printable", you can see how the document will print.
But I've never really printed my blog though...
Enjoy and have a great year of 2005 C.E.
Can't believe it's new year already...

find that prime

ok. People concluded that there are infinitely but countably many primes.
Proof: you first construct a finite set which has 'all' primes in the world.
Then you multiply each prime and add 1 to it.
CODE:

int len = fetch primetable.txt from ftp://International Prime Institution.net and calculate # of primes in the table;
unsigned int[] prime_set = new int[len];//let's say that len is 34253252365323
int product = 1;
for( int i=0; i product *= prime_set[i];
}//for
product++;
if( isPrime(product) ) {
System.out.println("IPI owned. I found new prime that doesn't belong to the primetable.txt which they say includes all primes. lol");
}//if
else {
System.out.println("the function isPrime(int) is not working properly. lol");
}//else


And just for fun, I wrote isPriime(int) function:

public static boolean isPrime( int p ) {
int count = 0;
for( int i=1; i<=Math.sqrt(p); i++ ) {
if( p%i == 0 ) {
count++;
}//if
if( count == 3 ) {//p is not prime
return false;
}//if
}//for
return true;
}//isPrime

The function is not tested...maybe it doesn't work...lol; //i'm lame

The thing is, I thought I could generate primes using the proof of infinity of # of primes.
Like: base case is "2 is prime". 2 belongs to the set of primes.
Induction: assume product of the elements in the set of primes + 1 results another prime for |set of primes| <= 1. (or >=1 i don't know...)
Current |set of primes| = 1 and 2+1 = 3 is a prime.
|set of primes| = 2 now. Let's say Set of Primes = P = { 2, 3 }
2*3+1 = 7 is a prime. P = { 2,3,7 }
2*3*7+1 = 43 is a prime!!! I thought I found something at this point...
P is now = { 2,3,7,43 }
2*3*7*43+1 = (43-1)*43+1 = 1807 is NOT a prime.
It took about 3 minuites to get 1807 on the paper ( bad arithmetician).
I thoght 1807 was a prime because it looks like it. But when I checked the web, 1807 wasn't listed as prime....
Ahhhhhh I really thought I figured something out...lol..I'm still lame.