This challenge is inspired by this other challenge, which you may want to read first for some context. However, a competitive answer is likely to look very different, so after reading some posts on Meta I decided it was best posted as a separate question.
The goal here is to write a polyglot program; that is, a program that works in multiple languages. However, typically polyglot challenges are answered via some standard techniques (listed below). I think it's much more interesting if the standard techniques are avoided, and thus this challenge has a number of restrictions that your program must obey; each restriction is designed to close a standard loophole (although if you can somehow exploit the loophole while remaining within the restriction, go ahead). Here are the restrictions, and the reasons behind them:
Deleting any non-whitespace character from your program must cause it to fail to function in all your languages. Your program may not read its own source.
One of the most common tricks for creating polyglots is to hide code intended for one language inside syntax that's a comment block in each other language. In order to define "comments" (and other non-coding syntax, which similarly needs to be disallowed) in a language-independent way, we define a character to be part of a comment if it could be deleted without affecting the operation of the program. (This definition was based on that in nneonneo's challenge, linked above; not counting the removal of whitespace isn't quite loophole-free as some languages have particularly significant whitespace, but in general it's hard to find a lot of languages which use it for computation, and I don't want the focus of the challenge to be on minor details about which languages require whitespace where.)
To clarify "failing to function", the intention is that the program works like this: deleting a character from the program causes it to break at least one of the other restrictions (e.g. it errors out, or prints the output that does nor comply with the specification).
It's fairly clear that a program could work around the spirit of this restriction via examining its own source code (e.g. via opening the file that stores it on disk, or using a command similar to Befunge's
g); as such, doing that is banned too. To be precise, you may not use language features that would act differently if a comment were added to the source code.
The program may not error out, either at run time or (if applicable) at compile time.
A common trick with polyglots is to not worry about executing parts of the program intended for other languages that aren't valid in one of the languages; you just write them anyway, then let the program crash. Banning errors closes the loophole. Warning messages are acceptable, unless the language is one that downgrades situations that would be errors in most typical languages (e.g. invalid syntax) as warnings.
The program must not use any language features that return the name or version of the language in use.
For example, no using
$]in a submission that's intended to work in Perl. A common trick when answering polyglot questions is to take two languages which are very similar (such as Python 2 and Python 3) and claim that a program is a polyglot in both of them; however, if the languages are that similar, it makes the programs much easier to write and is uninteresting in a way. This restriction requires any solution to the problem that uses similar languages to focus on the differences between them, rather than the similarities.
When executed, the program must: print the name of the language it is executing in; print the name (e.g. "A000290") of a sequence from OEIS; then print the sequence itself. The sequence must be different for each language.
One final trick for writing polyglots is to write a very simple program that uses only code constructs which have the same meaning in a wide range of languages, such as
print(1)(which is a complete program that outputs
1in sufficiently many languages that it or something like it would probably win without this loophole being closed). As such, there's a requirement here for the program to do a nontrivial amount of work. The program must calculate the sequence elements, not just produce hardcoded output (i.e. do not exploit this standard loophole). If the sequence you choose is an infinite one, this means that the program should run forever producing more and more terms.
There's a large enough variety of sequences in OEIS that you should be able to find something that's relatively easy to implement in each of the languages you use, so long as your construction can handle some nontrivial code in addition to just printing constant strings.
This requirement also closes another standard loophole for implementing polyglots: observing that a file is missing a marker such as
<?phpand thus echoes itself, and claiming that that's a valid program. (Deleting a character would definitely change the result then!) Forcing the program to calculate something prevents that.
Note: this isn't really a challenge about implementing bignums, so it's OK if the output becomes incorrect after a while or even if the program errors out due to things like word size concerns, so long as you don't try to abuse this by picking a language with very small integers. Likewise, there aren't any hard requirements on the output format. You can output in unary for all I care.
Incidentally, the requirement to print the sequence number is to prevent a solution accidentally becoming invalid because deleting a character changes the sequence that's printed without changing anything else (and therefore is there to make the first restriction easier to comply with).
The winner will be the answer that works in the most languages, making this a code-challenge. If there's a tie, the tiebreak is to favour the submission that was posted earlier. Unlike many challenges on this site, there's no benefit to writing a short program, so feel free to make it as readable as the restrictions allow (which, admittedly, is probably still not very readable). Good luck!