[seqfan] id:A059404

Donald Alan Morrison donmorrison at gmail.com
Sat Sep 4 21:23:58 CEST 2010


Here's a program for a different sequence; but I'm not sure if it's
correct, because I may have misinterpreted the definition of the
sequence.  The author is BCC'd in case he's not on the list.

http://www.research.att.com/~njas/sequences/A059404

%time
# python 2.6.X, sage 4.5.2, seq id:A059404
from os.path import expanduser
lo = 2
hi = 3 * 10^4
mixed = []
for a in xrange(lo,hi+1):
    if is_prime(a): # very fast check for a < 2^64
        continue
    lst = list(factor(a))
    if len(lst)==1:
        continue
    firste = lst[0][1]
    if any(map(lambda b:b[1]!=firste, lst)):
        mixed.append(a)
with open(expanduser("~/B059404.txt"), 'w') as fp:
    for i in xrange(10^4):
        print >> fp, "%d %d" % (i+1, mixed[i])
fp.close()
del(fp)




More information about the SeqFan mailing list