I had to write some factoring code in order to implement my
algorithm for DZ, but:
#!/usr/bin/python
def factor(n, start=2L):
i = start
while i*i<=n:
if (n%i)==0:
return [i]+factor(n/i, i)
i=i+1
return [n]
def dz(n):
old = 0
sum = 0
prod = 0
for i in factor(n):
if i==old:
prod = prod * i
else:
sum = sum + prod
prod, old = i, i
sum = sum + prod
try:
return int(sum)
except:
return sum
It works, too:
>>> map(dz,range(1,51))
[1, 2, 3, 4, 5, 5, 7, 8, 9, 7, 11, 7, 13, 9, 8, 16, 17, 11, 19, 9, 10, 13, 23,
11, 25, 15, 27, 11, 29, 10, 31, 32, 14, 19, 12, 13, 37, 21, 16, 13, 41, 12, 43,
15, 14, 25, 47, 19, 49, 27]
I tried "map(dz,range(1,20000))", and they totally jump around. Numbers
which have lots of distinct small prime factors have tiny dz values
(e.g. dz(4620)=30), but primes have huge dz values.
Anirvan and I tried to go to Proof, but it was sold out,
so we went book-shopping instead. I got Law's Order by
David Friedman, and Software, Shamans, and Spleens by James Boyle.
(Later, I got The Phantom Tollbooth -- a great book!)
Anirvan helped me set up a program called
Spam Assassin, which
attempts to detect and identify spam. This is useful to me because
I get a lot of spam, although I'm intimidated by the "spam wars".
(It took EFF years, literally years, to reach a
consensus on the organization's position on spam. Even today, we
are getting mail accusing us of doing too little or too much in
the war on spam.) Spam sometimes seems to be an almost unique
problem in the sense of the divisions it can inspire within the
technical and civil liberties communities.
We had lunch and dinner together, in addition to our book-shopping.
Digital files cannot be made uncopyable, any more than water can be
made not wet.
(Bruce
Schneier)
Every time I write about the impossibility of effectively protecting
digital files on a general-purpose computer, I get responses from
people decrying the death of copyright. "How will authors and artists
get paid for their work?" they ask me. Truth be told, I don't know. I
feel rather like the physicist who just explained relativity to a
group of would-be interstellar travelers, only to be asked: "How do
you expect us to get to the stars, then?" I'm sorry, but I don't know
that, either.
(Bruce
Schneier again)
I'm trying to find something that
Seth Finkelstein wrote about
why scientists misunderstand politicians (something to the effect
that scientists mistakenly believe that politicians are actually
trying to find the truth, where the latter are really seeking
a stable consensus).