Karim Belabas on Mon, 01 Jan 2024 19:21:30 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: gp_oeis_search (Search integer sequence specified by short PARI/GP script on oeis.org)


* hermann@stamm-wilbrandt.de [2024-01-01 18:27]:
> Dear Karim,
> 
> On 2024-01-01 15:14, Karim Belabas wrote:
> > Dear Hermann,
> > 
> > Another interesting option is to do it all from gp:
> > 
> >   oeis(v)=
> >   { my(s = ""); for (i=1, #v, s = concat(s, Str(v[i]",")));
> >     extern(Str("$BROWSER https://oeis.org/search?q=";, s))
> >   }
> > 
> >   v = vector(40, i, qfbclassno(-4*i)); /* some sequence of interest */
> >   oeis(v);
> > 
> > I happen to have a BROWSER environment variable, but you could of course
> > replace $BROWSER by a hardcoded path to your favourite browser.
> > 
> I stored that GP script on x86_64 Ubuntu 22.04 desktop system and it just
> worked.
> 
> But the aarch64 GP runs into an error, although it does show the correct
> page in firefox.
> What might be the problem?

Sorry. Just use 'system' instead of 'extern': ѕtandard error/output are
simply printed (with extern, stdout is run as gp commands).

Another possibility in this context is to use 'externstr'; then standard
error is still printed but standard output is returned as a gp vector of
strings.

Cheers,

    K.B.
-- 
Pr. Karim Belabas, U. Bordeaux, Vice-président en charge du Numérique
Institut de Mathématiques de Bordeaux UMR 5251 - (+33) 05 40 00 29 77
http://www.math.u-bordeaux.fr/~kbelabas/