-
-
Save Hermann-SW/3112d25ede6052df738d8d96651f6d5d to your computer and use it in GitHub Desktop.
#!/bin/bash | |
browser=firefox | |
#browser=chromium-browser | |
$browser https://oeis.org/search?q="$(gp -q < <(echo "$1"))" |
I work with PARI/GP on my smartphone as well, under Termux app.
I do not know how to open a link on smartphone firefox app from termux.
So I installed termux-x11:
https://ivonblog.com/en-us/posts/termux-x11/
Then I started xfce session per that instruction in background in termux:
termux-x11 :0 -xstartup "dbus-launch --exit-with-session xfce4-session" 2>err &
Then I queried -4*n classnumber sequence as before in termux ...
DISPLAY=:0 ./gp_oeis_search 'for(i=1,40,print1(qfbclassno(-4*i),","))'
... and switched to termux x11 app to see below.
Font is a bit small for my 6.67" smartphone display, but on bigger displays of tablets all is fine.
Jus learned from Karim that all can be done from within PARI/GP as well in this thread:
https://pari.math.u-bordeaux.fr/archives/pari-users-2401/msg00000.html
Final version with suppressing "system()" warnings:
pi@raspberrypi5:~ $ BROWSER=firefox gp -q oeis.gp
?
Opens this in browser:
https://oeis.org/search?q=1,1,1,2,2,1,2,2,2,3,2,2,4,
oeis.gp:
oeis(v)={
my(s = ""); for (i=1, #v, s = concat(s, Str(v[i]",")));
system(Str("$BROWSER https://oeis.org/search?q=";, s, ">/dev/null 2>&1 &"))
}
v = vector(40, i, qfbclassno(-4*i)); /* some sequence of interest */
oeis(v[2..14]);
URL opened in browser:
https://oeis.org/search?q=1,1,1,1,2,2,1,2,2,2,3,2,2,4,2,2,4,2,3,4,4,2,3,4,2,6,3,2,6,4,3,4,4,4,6,4,2,6,4,4,