# Maple converter: Convert Frank Luebeck's table of Conway polynomials to OEIS b-files. # Usage (will overwrite the bfiles of the associated numbers as specified at the end): # maple -q this-file-name-here # for example # maple -q a141646.mp # Richard J. Mathar, 2008-09-14 # # Imported below is the file downloaded from # http://www.math.rwth-aachen.de/~Frank.Luebeck/data/ConwayPol/CPimport.txt # See V Jodovic e-mail to seqFan list on 2008-09-14. read "CPimport.txt" : # Function to rephrase the polynomials of one prime from F Luebeck's # table as a b-file (which is overwritten if existing). # The first argument is the prime basis. # The second argument is the OEIS file name (like "bxxxxx.txt") Luebeck2OEIS := proc(p,bfname) # allConwayPolynomials is the Maple array defined in CPimport.txt global allConwayPolynomials ; local n,found,l,nseq,L,i,Anum ; # open the file in "overwrite" mode fopen(bfname,WRITE) ; # First polynomial, x=1, is not explicit part of the # tables but the entry n=0 (offset zero) in OEIS nomenclature. nseq := 0 ; fprintf(bfname,"%d 1\n",nseq) ; nseq := nseq+1 ; # loop over the order of the polynomials for n from 1 do # simple search; we do not assume any particular # order in the data file/array. found := false ; for l in allConwayPolynomials do # input file format is: first p, then n, then the list of coefficients if op(1,l) = p and op(2,l) = n then found := true; L := op(3,l) ; for i from 1 to nops(L) do # The list of coefficents is the revers order of the OEIS (x^0 first # in the list, x^n first in the OEIS). fprintf(bfname,"%d %d\n",nseq,op(-i,L)) ; nseq := nseq+1 ; od: fi; od: if not found then Anum := sscanf(bfname,"%*c%6d") ; Anum := op(1,Anum) ; printf("%%H A%6d R. J. Mathar, F. Luebeck, ",Anum,bfname) ; printf("Table of n, a(n) for n=0,...,%d.\n",nseq-1) ; break; fi; od: fclose(bfname) ; RETURN() ; end: # create the 4 b-files for existing OEIS sequences Luebeck2OEIS(2,"b141646.txt") ; Luebeck2OEIS(3,"b141647.txt") ; Luebeck2OEIS(5,"b141648.txt") ; Luebeck2OEIS(7,"b141649.txt") ; # commented, since the corresponding entries do not yet exist in the OEIS # Luebeck2OEIS(11,"b000001.txt") ; # Luebeck2OEIS(13,"b000002.txt") ; # Luebeck2OEIS(17,"b000003.txt") ; # Luebeck2OEIS(19,"b000004.txt") ; # Luebeck2OEIS(23,"b000005.txt") ; # Luebeck2OEIS(29,"b000006.txt") ; # Luebeck2OEIS(31,"b000007.txt") ; # Luebeck2OEIS(37,"b000008.txt") ; # Luebeck2OEIS(41,"b000009.txt") ; # Luebeck2OEIS(43,"b000010.txt") ; # Luebeck2OEIS(47,"b000011.txt") ; # Luebeck2OEIS(53,"b000012.txt") ; # Luebeck2OEIS(59,"b000013.txt") ; # Luebeck2OEIS(61,"b000014.txt") ; # Luebeck2OEIS(67,"b000015.txt") ; # Luebeck2OEIS(71,"b000016.txt") ; # Luebeck2OEIS(73,"b000017.txt") ; # Luebeck2OEIS(79,"b000018.txt") ; # Luebeck2OEIS(83,"b000019.txt") ; # Luebeck2OEIS(89,"b000020.txt") ; # Luebeck2OEIS(97,"b000021.txt") ; # Luebeck2OEIS(101,"b000022.txt") ; # Luebeck2OEIS(103,"b000023.txt") ; # Luebeck2OEIS(107,"b000024.txt") ; # Luebeck2OEIS(109,"b000025.txt") ; # Luebeck2OEIS(113,"b000026.txt") ; # Luebeck2OEIS(127,"b000027.txt") ; # Luebeck2OEIS(131,"b000028.txt") ; # Luebeck2OEIS(137,"b000029.txt") ; # Luebeck2OEIS(139,"b000030.txt") ;