All Questions
24 questions
14
votes
5
answers
452
views
Generate a subgroup of a free group
In group theory, the free group with \$n\$ generators can be obtained by taking \$n\$ distinct symbols (let's call them \$a, b, c ...\$ etc), along with their inverses \$ a^{-1},b^{-1},c^{-1} ...\$ . ...
18
votes
20
answers
2k
views
Complement an infinite list
In this challenge, we define the complement of a list of positive integers as all positive integers not included in that list. For example, the complement of the even numbers ...
8
votes
33
answers
1k
views
Keep elements in sequence that have a letter repeated at least 3 times
Challenge:
Given the input array l with a list of strings, only keep the elements in the sequence that have a letter that's repeated at least 3 times. Like ...
14
votes
35
answers
819
views
Create \$n\$ sublists with the powers of two (1, 2, 4, 8, 16...)
Challenge:
Given the input number n. It should give me nested sublists of n layers with the power of two numbers for each level. ...
6
votes
5
answers
903
views
What is the longest trampoline?
In this challenge we are going to consider lists of integers such that for every member \$x\$ at index \$i\$ then the indexes \$i+x\$ and \$i-x\$ have the value \$x+1\$ or are out of bounds for the ...
24
votes
31
answers
3k
views
"-rot" transform
Background
-rot transform (read as "minus-rot transform") is a sequence transformation I just invented. This transform is done by viewing the sequence as a stack in Forth or Factor (first ...
23
votes
53
answers
2k
views
Generate list of numbers and their negative counterparts
A recent SO question asks for a convenient one-liner to generate a list of numbers and their negative counterparts in Python.
Given two integers \$1≤a≤b\$, generate all the integers \$x\$ such that \$...
6
votes
6
answers
591
views
Explore a Klarner-Rado sequence [duplicate]
One of the Klarner-Rado sequences is defined as follows:
the first term is \$1\$
for all subsequent terms, the following rule applies: if \$x\$ is present, so are \$2x+1\$ and \$3x+1\$
the sequence ...
27
votes
29
answers
5k
views
Count the number of triangles
Given a list of positive integers, find the number of triangles we can form such that their side lengths are represented by three distinct entries of the input list.
(Inspiration comes from CR.)
...
11
votes
7
answers
365
views
Crossing sequences
Crossing Sequences
Given a list of positive integers A, call it an increasing sequence if each element is greater than or equal to the previous one; and call it a ...
18
votes
36
answers
2k
views
Incremental Ranges!
Your task is to, given two positive integers, \$x\$ and \$n\$, return the first \$x\$ numbers in the incremental ranges sequence.
The incremental range sequence first generates a range from one to \$...
19
votes
25
answers
1k
views
Get the sequence steps
Challenge
Given a sequence of numbers, create a function which returns the sequence steps.
Assume a sequence will be N >= 3
Sequence will repeat it steps at ...
13
votes
16
answers
895
views
Alternested numbers
Consider the array of positive integers:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, ...
Then, concatenate them:
...
8
votes
7
answers
504
views
Fill the steps (randomly)!
This is Hole-9 from The Autumn Tournament of APL CodeGolf. I am the original author of the problem there, and thus allowed to re-post it here.
Given a simple (rectangular, non-jagged) Boolean array (...
19
votes
6
answers
1k
views
Kolakoski-like self-referencing sequences
This is how the Kolakoski sequence (OEIS A000002) is defined:
The Kolakoski sequence is a sequence that contains 1 and 2, and ...