Here's a version of getoeisseries which only returns direct hits and
not cross references:

NB. install 'web/gethttp'
require'regex web/gethttp'

OEIS =: 'http://oeis.org/search?q='  NB. fails with https://... !

getoeisseries=: {{
  a0=. I.'<a 'E.RAW=:gethttp OEIS,commas y
  a1=. I.'</a>'E.RAW
  A=. ,{."1'href="/A\d{6}"'rxmatches RAW
  a=. RAW{L:0~(a0(+i.)&.>a1-a0){~<:a0 I.A
  keep=. -.(1: e. ' title=' E. ])S:0 a
  >(}.~1+i.&'>')&.> keep#a
}}

commas=: rplc&' ,_-'@":

FYI,

-- 
Raul

On Sun, Mar 6, 2022 at 9:06 AM 'Michael Day' via Programming
<programm...@jsoftware.com> wrote:
>
> I don't yet see how to separate the series itself/themselves from
> cross-refs!
> M
>
> On 06/03/2022 12:18, 'Michael Day' via Programming wrote:
> > Late to the power party!
> >
> > This is one way to automate the OEIS look-up - I'm not an expert on
> > parsing the result,  but hunting for 'A', a single digit seems
> > a good starter:
> >
> >    OEIS =: 'http://oeis.org/search?q='  NB. fails with https://... !
> >
> >    getoeisseries =:{{ {{(-.{.) ' ',,/ y&{{~.x{~(i.7)+/~ x I.@:E.~
> > 'A',y}}"0 '0123456789' }} RAW=:gethttp OEIS,commas y}}
> >
> >    getoeisseries 5 9 15 23 33 45 59
> > A027688
> > A002522
> > A007954
> > A176271
> > A118403
> > A118401
> > A118400
> > A118407
> > A118402
> > A134586
> >
> > where commas is what I always use to format series for OEIS searches:
> >
> > commas =: 3 : 0   NB. crude - I forget how to format negatives using -
> > with some ": variant!!!
> >  q   =. 1|.' '-.~,','&,@:":"0 y
> >  if. # imin=. I. q = '_' do.
> >  q   =. '-' imin } q
> >  end.
> > )
> >
> > Not a primitive adverb,  but it's my starter for 10,
> >
> > Mike
> >
> > On 06/03/2022 06:36, Ian Clark wrote:
> >> Let's cheat and look it up in oeis.org …
> >> Skip's sequence is A027688, dropping the first term
> >> A027688 is defined as: (n^2 + n + 3)
> >> but (n*n + n + 3) gives better results with (13 :)
> >>
> >> q=: 13 : '(y*y) + y + 3'
> >>
> >> q
> >>
> >> *~ + 3 + ]
> >>
> >> q >:i.10
> >>
> >> 5 9 15 23 33 45 59 75 93 113
> >>
> >>
> >> Has anyone tried automating OEIS lookup? It could be the basis for a
> >> nifty
> >> new primitive adverb: (...) as in:
> >>
> >> 5 9 15 23 33 ...
> >>
> >> On Sun, 6 Mar 2022 at 02:11, Elijah Stone <elro...@elronnd.net> wrote:
> >>
> >>> Ah, David beat me to it! :)
> >>>
> >>> On Sat, 5 Mar 2022, Elijah Stone wrote:
> >>>
> >>>> Here's how I would do it:
> >>>>
> >>>>     3++/\+:i.10
> >>>> 3 5 9 15 23 33 45 59 75 93
> >>>>
> >>>> This preserves the 'missing' initial term of 3.  If you don't want it,
> >>>> replace i.10 with >:i.10.
> >>>>
> >>>>   -E
> >>>>
> >>>> On Sat, 5 Mar 2022, 'Skip Cave' via Programming wrote:
> >>>>
> >>>>> I have this series:
> >>>>>
> >>>>> 5 9 15 23 33 ....
> >>>>>
> >>>>> 5+4
> >>>>>
> >>>>> 9
> >>>>>
> >>>>> 9+6
> >>>>>
> >>>>> 15
> >>>>>
> >>>>> 15+8
> >>>>>
> >>>>> 23
> >>>>>
> >>>>> 23+10
> >>>>>
> >>>>> 33
> >>>>>
> >>>>>
> >>>>> How can I use the power conjunction to generate this series?
> >>>>>
> >>>>> Is there a more concise method to generate this than the power
> >>> conjunction?
> >>>>>
> >>>>> Skip
> >>>>>
> >>>>>
> >>>>> Skip Cave
> >>>>> Cave Consulting LLC
> >>>>> ----------------------------------------------------------------------
> >>>>>
> >>>>> For information about J forums see
> >>>>> http://www.jsoftware.com/forums.htm
> >>>> ----------------------------------------------------------------------
> >>>> For information about J forums see http://www.jsoftware.com/forums.htm
> >>>>
> >>> ----------------------------------------------------------------------
> >>> For information about J forums see http://www.jsoftware.com/forums.htm
> >>>
> >> ----------------------------------------------------------------------
> >> For information about J forums see http://www.jsoftware.com/forums.htm
> >
> >
>
>
> --
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to