Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Sandbox

Comments on OEIS Identification

Post

OEIS Identification

+1
−1

Challenge

Identify as many different OEIS sequences as possible in as few bytes as possible. You can output multiple sequences for one input, and your input is at most 10 values long and at least one. You must not mislabel an input, i.e. 2, 3, 4, 5 cannot be identified as A000040.

A subset of a sequence, i.e. being given 39, 197, 601, 1451, 1907 (all primes, but some are missing) can not be identified as the full sequence (in this case, it's not A000040. No OEIS sequence matches this input). Sequence match must be exact, the input must match the first [input length] terms of a sequence. Sequences with an element larger than $2^{32}-1$ within the first 10 elements, no elements, or fewer than 10 elements are not permitted.

You are obviously not required to output correctly for every single OEIS sequence.

No networking or similar is allowed, you cannot download the OEIS database.

You are not required to handle numbers larger than a 32-bit integer can store, and gain no points for doing so. Make sure float imprecision doesn't result in a mislabeled input.

Scoring

TBD. I'm thinking $b \div m$, where b is byte count and m is the number of matched sequences.

If a sequence is impossible to identify within the rules, it does not count toward the score. There must be some input that gives that sequence as an output.

Input

List of numbers, answer can either be a full program or a function.

Output

Integers describing which sequences were detected, optionally with the A prefix. 40, 000040, and A000040 are all valid ways to identify a sequence.

Advice

Start with simple sequences, like A000012 (1, 1, 1, ...) and A000040 (the primes) Here's a few worth checking out:

  • A000012 All ones sequence
  • A000040 Primes
  • A000027 All positive integers (not zero)
  • A000079 Powers of Two
  • A000045 Fibonacci Sequence This is an optimization challenge, you'll want to be picky about what sequences you take, and it'll often be advantageous to take related sequences.
History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.

1 comment thread

General comments (3 comments)
General comments
dzaima‭ wrote about 4 years ago · edited about 4 years ago

You should mention that there must actually be a valid input corresponding to a claimed sequence (otherwise every answer is valid on at least a thousand sequences); Also, the constant sequences continue up to 32 - A007395 A010701 A010709 A010716 A010722 A010727 A010731 A010734 A{010850-010871} (there's a cool arithmetic progression for sequences 3…9 though its probably useless to use those) at which point adding anything else is probably not gonna be worth it with the b÷m scoring.

moony‭ wrote about 4 years ago · edited about 4 years ago

Can you elaborate on the first point? And yea, i'm aware of those, hence me needing to do more work on scoring. An example for the first point would be nice.

dzaima‭ wrote about 4 years ago · edited about 4 years ago

Example 1 - its first number doesn't fit in a 32-bit integer, so we, by outputting nothing, always identify it correctly. (there are at least a thousand like this, probably many more if looking at the first 5); Example 2 - there are only 4 items, so, again, outputting nothing always correctly identifies it.