# Questions tagged [sequence]

For challenges involving sequences, typically of numbers following some pattern.

934 questions
Filter by
Sorted by
Tagged with
2k views

### Palindromic Powers

Powers We define an important power as a number that can be represented as $x^y$ where $x ≥ 2$ and $y ≥ 2$. Palindrome We define an ...
• 1,548
2k views

### Infinite Candle Sequence

I have a cake shop that specialises in birthday cakes. The cakes that I sell must have candles placed in a circle. You would probably think I can just divide 360° by the number of candles, but the ...
• 2,317
995 views

### Sequence of integers not the sum of powers of earlier terms

Starting with 1, output the sequence of integers which cannot be represented as the sum of powers of earlier terms. Each previous term can be used at most once, and the exponents must be non-negative ...
• 430
2k views

### The Binary Eyes

A binary eye is an odd set of digits, with all of its digits except the center one set to 1 or 0, and the center one set to the opposite of the others. Thus, there are two binary eyes for a given odd ...
• 420
3k views

• 1,943
1k views

### How many blocks make a "truncated square-pyramid garden"?

A truncated square-pyramid of height $h$ has $h$ square layers where each layer has a side $1$ greater than the one above it, apart from the top layer which is a square of blocks with a given ...
• 106k
840 views

### All sequences as substrings

Make a program that outputs a sequence of integers so that every finite sequence of positive integers is a substring (continuous subsequence) of the output. For example, the following sequence ...
• 7,878
601 views

### Probability breaking sequences

If we have a finite list of elements we can determine the probability of any one element being drawn at random as the number of times it occurs divided by the total number of elements in the list. For ...
• 98.7k
1k views

### Square-free words of a length

A square-free word is a word consisting of arbitrary symbols where the pattern $XX$ (for an arbitrary non-empty word $X$) does not appear. This pattern is termed a "square". For example, ...
• 49.9k
2k views

### Output every sublist ... eventually

You will be given as input an infinite stream of positive integers. Your task is to write a program which outputs an infinite sequence of lists with two requirements: All lists in the output are ...
• 98.7k
358 views

### Universal Command Sequence

Universal Command Sequence Definition An $n$-maze is a $n\times n$ chessboard which has "walls" on some edges, and a "king" on the board that can move to the 4 adjacent cells, ...
• 487
799 views

### Generate Fmbalbuena Numbers

My user id is 106959 How to check if the number is Fmbalbuena number? First Step: Check if the number of digits is a multiple of 3: ...
• 3,847
1k views

### Slater-Velez permutation

Let's build a sequence of positive integers. The rule will be that the next number will be the smallest number which: It hasn't already appeared in the sequence Its absolute difference from the ...
• 98.7k
156 views

### Indices of square numbers that are also pentagonal [closed]

First 15 numbers of the A046173: ...
• 5,079
760 views

### Mutually recursive lists

Let's define a simple function $f$ which takes an integer and produces a list: $f(n) = [g(1),g(2),\dots,g(n)] \\ g(n) = [f(0),f(1),\dots,f(n-1)]$ We can then calculate the first couple of values ...
• 98.7k
2k views

### Next Greater Number

Given an integer n, find the next number that follows the following requirements: The next greater number is a number where each digit, from left to right, is ...
• 5,079
1k views

### Number of complete rhyme schemes

A rhyme scheme is the pattern of rhymes at the end of the lines in a poem. They are typically represented using letters, like ABAB. We consider two rhyme schemes ...
• 23.7k
992 views

### Counting universal n-ary logic gates

Background A classical logic gate is an idealized electronic device implementing a Boolean function, i.e. one that takes a certain number of Boolean inputs and outputs a Boolean. We only consider two-...
• 76.1k
2k views

### An ASCII self-referential sequence

The sequence A109648 starts with the following numbers ...
• 76.1k
296 views

### Multiplicity of Shared Totients

Euler's totient function, $\varphi(n)$, counts the number of integers $1 \le k \le n$ such that $\gcd(k, n) = 1$. For example, $\varphi(9) = 6$ as $1,2,4,5,7,8$ are all coprime to $9$. ...
• 49.9k
602 views

### The Most Wanted Prime Numbers

Output a sequence of all the primes that are of the following form: 123...91011...(n-1)n(n-1)..11109...321. That is, ascending decimal numbers up to some ...
• 7,878
1k views

### Nth FizzBuzz Number

Introduction Everyone knows the FizzBuzz sequence. It goes something like this: 1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz . . . In case you don't ...
• 4,173
604 views

### AoCG2021 Day 17: Langton's Hexa-Virus

The story continues from AoC2017 Day 22, Part 2. The damn virus that was infecting a grid computing cluster now has jumped to a hexagonal computing cluster! In this cluster, the computers are ...
• 76.1k
2k views

• 193
1k views

### Self-referential triangle sequence

Output the flattened version of the sequence A297359, which starts like the following: ...
• 76.1k
1k views

• 8,679
961 views

### Maybe fractal sequence?

Background A fractal sequence (Wikipedia; MathWorld) is an infinite sequence of positive integers meeting the following conditions: Each positive integer appears infinitely many times in the sequence....
• 76.1k
2k views

• 98.7k
2k views

### Greedy queens sequence

Challenge Implement the "greedy queens" sequence (OEIS: A065188). Details Taken from the OEIS page. This permutation [of natural numbers] is produced by a simple greedy algorithm: starting ...
• 16k
940 views

### Non-sums of distinct positive powers

There are 31 positive integers that cannot be expressed as the sum of 1 or more distinct positive squares: ...
• 49.9k