Skip to content

Instantly share code, notes, and snippets.

@neoneye
Created June 28, 2022 13:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neoneye/a54947142434492a2e73d2a678be869d to your computer and use it in GitHub Desktop.
Save neoneye/a54947142434492a2e73d2a678be869d to your computer and use it in GitHub Desktop.
PARI/GP create OEIS bfile in browser
bfile(name, v, offset=1, limit=1000)={
my(cur=offset-1,F);
for(i=1,#v,
if (#Str(v[i]) > limit,
print("Next term has "#Str(v[i])" digits; exiting.");
break
);
my(s=Str(cur++, " ", v[i]));
print(s);
);
};
\\ Example of how to use
a(n) = (n+sqrtint(5*n^2))\2;
myvec = [a(n)|n<-[0..100]];
bfile("A066096", myvec, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment