I found some functions in GP work fine when x is the variable, go berserk when a is used instead of x, and provide a shorter (but still incorrect) output when I try to fix this by using the subset function.
I believe the code below is self-explanatory, any help appreciated.
Ewan
GP/PARI CALCULATOR Version 2.5.2 (released)
i386 running darwin (x86-64/GMP-5.0.4 kernel) 64-bit version
compiled: Sep 18 2012, gcc-4.5.4 (MacPorts gcc45 4.5.4_5)
(readline v6.2 enabled, extended help enabled)
Copyright (C) 2000-2011 The PARI Group
PARI/GP is free software, covered by the GNU General Public License, and comes WITHOUT ANY WARRANTY WHATSOEVER.
Type ? for help, \q to quit.
Type ?12 for how to get moral (and possibly technical) support.