Is it possible to invoke the OEIS from Mathematica?

There is a Mathematica package exactly for this at the OEIS wiki.

Somewhat related: there's also a package for formatting data into the OEIS format.

WolframAlpha also has some of this information, though I'm not sure how to get the $n^{\mathrm{th}}$ term of the sequence.

In[1] := WolframAlpha["A004001", {{"TermsPod:IntegerSequence", 1}, "ComputableData"}]

Out[1] = {1, 1, 2, 2, 3, 4, 4, 4, 5, 6, 7, 7, 8, 8, 8, 8, 9, 10, 11,
          12, 12, 13, 14, 14, 15}

Or:

In[1] := WolframAlpha["A018900", {{"Continuation", 1}, "ComputableData"}]

Out[1] = {3, 5, 6, 9, 10, 12, 17, 18, 20, 24, 33, 34, 36, 40, 48, 65, 66, 68, 72}

A bit of a hack, could do with some polishing, but the basic idea will work:

OEISData[str_] := 
  StringSplit[#, ","] & /@ 
  Select[StringSplit[Import["http://oeis.org/search?q=" <> str]], 
  StringMatchQ[#, __ ~~ ","] &];

OEISData["A004001"][[9]]

If you just want the numbers, it could be even easier to just import from http://oeis.org/A004001/list (assuming that the input is a valid sequence identifier):

OEISSequence[str_] := ToExpression /@ 
        First@StringCases[Import["http://oeis.org/" <> str <> "/list"],
        "[" ~~ x__ ~~ "]" :> StringSplit[x, ","]];

Take[OEISSequence["A004001"], 20]
{1, 1, 2, 2, 3, 4, 4, 4, 5, 6, 7, 7, 8, 8, 8, 8, 9, 10, 11, 12}

I liked Szabolcs’ answer but would like to remind about free form input here. We get so much information using it for very little typing. Plus we get native to M. format. For those who does not know this yet - at the beginning of new input line press equal sign “=” twice to get orange spiky and then type in free form. In this case you see result below. This is NOT web browser but M. notebook. Of course you can get the same on W|A website. But additionally here you can get the data. For example go to “Sequence terms” pod and click “more” to get a few more terms. Then press little plus sign in the top right corner and then and from the menu choose “computable data”. This pastes in M. notebook what you see here at the lower part of the image the image. And this also partially answers Szabolcs’ question about more terms ;-) This is also a good way to learn tricks of WolframAlpha[] function.

enter image description here