Questions pertaining to a sequence within a larger sequence

learn more… | top users | synonyms

13
votes
3answers
230 views

Reverse-Engineer the N-Bonacci sequence[s]

In his "Print the N-Bonacci Sequence" challenge, @DJMcGoathem describes the N-bonacci sequences, wherein the previous N numbers are summed, instead of the traditional 2 of the Fibonacci sequence (said ...
15
votes
1answer
227 views

Know a sequence by its subsequences

Introduction Suppose you and your friend are playing a game. Your friend thinks of some particular sequence of n bits, and your task is to deduce the sequence by asking them questions. However, the ...
20
votes
13answers
837 views

Remove digits, retaining greater number

Introduction This challenge consists in finding the greatest number removing y digits from the original number n which has x digits. Assuming y=2 n=5263 x=4, the possible numbers removing y=2 digits ...
22
votes
5answers
439 views

Fractal Smoke Sequence

Introduction A229037 has a quite intriguing plot (at least for the first few terms): There is the conjecture, that it might indeed have some kind of fractal property. How is this sequence ...
18
votes
1answer
173 views

Maximal Substring Construction

In this challenge, you are passed two things: A string length, N A list of strings, L, each with an assigned point value. Any string that is not passed in has a point value of 0 You need to ...
14
votes
2answers
139 views

Partition into increasing subsequences

Specification This challenge is simple to state: your input is a non-empty array of nonnegative integers, and your task is to partition it into as few increasing subsequences as possible. More ...
19
votes
1answer
193 views

One goes up, the other comes down

Introduction In this challenge, your task is to decide whether a given sequence of numbers can be separated into two subsequences, one of which is increasing, and the other decreasing. As an example, ...
19
votes
0answers
262 views

Four steps to the left: vipers. Four steps to the right: a cliff. Don't die!

Introduction Suppose for a moment that the vipers and cliff are only two steps away, instead of three. o --- Hsss! | ';;' ___ /_\ ___ _ | You ...
8
votes
3answers
246 views

Drop of Chaos (Constructing a Minimally Aperiodic Sequence)

The idea here is to produce an almost repeating pattern. That is, the sequence being constructed changes at the last moment to avoid a repetition of some subsequence. Subsequences of the type AA and ...
8
votes
7answers
388 views

Heaviest increasing subsequence

A subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements. A strictly increasing subsequence is a subsequence ...
11
votes
2answers
489 views

Fastest Longest Common Subsequence Finder

Your task is to solve the Longest Common Subsequence problem for n strings of length 1000. A valid solution to the LCS problem for two or more strings S1, … Sn is any string T of maximal ...
11
votes
5answers
827 views

Shortest Longest Common Subsequence Code

Your task to to solve the SLCSC problem, which consists in finding the shortest possible code to solve the Longest Common Subsequence problem. A valid solution to the LCS problem for two or more ...
32
votes
33answers
3k views

Stretching Words

Write a program or function that duplicates letters in a word, so that all the duplicated letters arranged from left to right in the word would form the input array. For example: input: chameleon, ...
11
votes
3answers
240 views

Wrap-Around Subsequences

Introduction In this challenge, your task is to find generalized subsequences of strings. The subsequences are not necessarily contiguous, and they can also "wrap around" the string, going past its ...
10
votes
1answer
263 views

Generate a Davenport-Schinzel Sequence

Background A Davenport-Schinzel sequence has two positive integer parameters d and n. We will denote the set of all Davenport-Schinzel sequences for given parameters by DS(d,n). Consider all ...
15
votes
1answer
918 views

Fix unbalanced brackets

Consider the alphabet A ="()[]{}<>". Think of the characters in the alphabet as opening and closing brackets of 4 different types. Let's say that a string over the alphabet A is balanced if it ...
7
votes
9answers
326 views

Group adjacent values

The task is to group adjacent values from collection and output it as a new aggregated collection. Consider we have following input: Sequence Number Value ======== ===== 1 9 2 ...
3
votes
11answers
515 views

The group of sequential positive numbers with the highest sum?

Given the following list of numbers, find the group of sequential positive numbers with the highest sum. Example input: 12 2 35 -1 20 9 76 5 4 -3 4 -5 19 80 32 -1 Example output: 131 The most ...
10
votes
10answers
930 views

Find largest sum of subsequence

Given a sequence of integers find the largest sum of a subsequence (integers on consecutive positions) of the sequence. The subsequence can be empty (in which case the sum is 0). Input is read from ...
14
votes
9answers
2k views

Shortest, lexicographically smallest generating string

A string x generates a string y if y is a substring of an infinite repeat of x. For example abc generates bcabcab. Write a program to find the shortest, lexicographically smallest string that will ...
3
votes
3answers
464 views

Finding “sub-palindromes” 2: subsequences.

The same task as Finding "sub-palindromes" but instead of finding substrings you must find subsequences that are not substrings. eg1: input: "12131331" output: "11", "33", "111", "121", "131", ...