All Questions

Tagged with
12 questions
866 views

Source permutation

A permutation of a set $S = \{s_1, s_2, \dotsc, s_n\}$ is a bijective function $\pi: S \to S$. For example, if $S = \{1,2,3,4\}$ then the function $\pi: x \mapsto 1 + (x + 1 \mod 4)$ is a ...
2k views

Superpermutations

Introduction You're a criminal tasked with stealing some secret plans from the new tech startup Dejavu. You sneak in over the back wall, but find a door that requires a pin to open it. You recognize ...
177 views

Flattened Spiral Permutation Index

Context Consider square matrices with n columns and rows containing the first n^2 (i.e. n ...
476 views

Smallest unused number sharing a factor

This is a pretty run of the mill question. I will define a sequence and you golf some code to output a entry given a index. The first item in the sequence is 2. The nth item in the sequence is the ...
498 views

Back-To-Front Permutation Index

The Challenge Given the number of items, n, in a non-empty, sorted list output the index, i(n), at which its "Back-To-Front ...
2k views

Compute the Eulerian number

The Eulerian number A(n, m) is the number of permutations of [1, 2, ..., n] in which exactly ...
1k views

Rearranging the sequence

Introduction Let's observe the following sequence (non-negative integers): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, ... For example, let's take the ...
751 views

Spiral Permutation Sequence

We can roll up the natural numbers in a rectangular spiral: ...
2k views

Can you reach this number by doubling and rearranging?

Inspired by this question on Math.SE. Starting with 1 you can repeatedly perform one of the following two operations: Double the number. or Rearrange its digits ...
406 views

Permutations of the Fifteen Puzzle

The Challenge Consider the following diagram of the Fifteen Puzzle in its solved state: ...