15
1
Introduction
Pareidolia: From Ancient Greek; παρα (para, “concurrent, alongside”) + εἴδωλον (eídōlon, “image”). The tendency to interpret a vague stimulus as something known to the observer, such as interpreting marks on Mars as canals, seeing shapes in clouds, or hearing hidden messages in music. Source: Wiktionary.
For example:
Paralogia: From Ancient Greek; παρα (para, “concurrent, alongside”) + λόγος (lógos, “speech, oration, word, ...”). The tendency to perceive words in arbitrary sequences of characters, such as in code golf programs. Source: yeah, I made that up (actually the word means something else, as pointed out by @Martin).
For example:
df4$/H)hEy_^p2\
jtK2$)look|x1$
Challenge
Write a program that takes a positive integer as input, produces an integer as output, and includes an English word as part of the code. The input-output relationship must correspond to an integer sequence that can be found in OEIS.
Rules
- Only words from this list are allowed. This is admittedly arbitrary, but it's essential that we all agree on which words are accepted; and in that regard this list is probably as good as any other.
- Words need to be formed by concatenating at least two function names or statements. If your language for example has a function called
correlation
it can't be used as is. The concatenation has to be strict: no other symbols should appear between the parts of the word. For example,bro~ken
would not count as a word. - Case is unimportant: both
valid
andvaLiD
are acceptable. - Words within strings do not count. The letters that make up the word need to be functions or statements in the language of choice, that is, something that is actually executed. For example, the following code would not be allowed:
'deoxyribonucleic'~1
, where'...'
is a string,~
discards the previous content, and1
just prints number1
. - Every letter of the word should be necessary. This means that removing a single letter from the word should change the input-output relation. That includes outputting a different sequence, or outputting any other thing(s), or producing no output, or causing an error.
- Any positive integer should be acceptable as an input, and should produce an output, except for data-type or memory restrictions.
- The outputs corresponding to inputs
1
,2
,3
, ... should correspond to a sequence appearing in OEIS. No other output should be produced; only an integer number, possibly with trailing or leading whitespace. - Input and output can be function arguments or stdin/stdout.
Score
The score is computed as total code length minus twice the length of the longest word, in characters. Or equivalently, number of not-in-longest-word characters minus length of longest word.
Lowest score wins.
Examples
Consider an imaginary postfix language that has these functions: c
: input a number; At
: compute square; $
: add 1.
cAt
would be a valid program (its output corresponds to the sequence 1
, 4
, 9
, ..., which is A000290), and it would have score −3.
cAt$
would also be valid (sequence 2
, 5
, 10
, ..., which is A002522), with score −2.
c$At
would not be valid, because the only word here is "At" and is produced by a single function or statement.
I think this should be a popularity contest. – MCMastery – 2016-01-31T01:39:54.303
5@MCMastery This would not make a good popularity contest. (Most challenges wouldn't.) – Alex A. – 2016-01-31T06:21:36.130
This is essentially limited to golfing languages though. – ericw31415 – 2016-05-08T22:05:44.710