Questions tagged [sequence]

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

934 questions
Filter by
Sorted by
Tagged with
1k views

Output a 1-2-3-5-7... sequence

Follow-up of my previous challenge, inspired by @emanresu A's question, and proven possible by @att (Mathematica solution linked) For the purposes of this challenge, a 1-2-3-5-7... sequence is an ...
• 1,805
2k views
+200

Output a 1-2-3 sequence

For the purposes of this challenge, a 1-2-3 sequence is an infinite sequence of increasing positive integers such that for any positive integer $n$, exactly one of $n, 2n,$ and $3n$ appears in ...
• 1,805
2k views

Odds for second smallest prime factor

Given a prime number $p$ output the asymptotic density of the set of positive integers which have $p$ as their second-smallest distinct prime factor Input/Output Input: one of the following ...
• 10.6k
188 views

Rank poker High Card hands [closed]

In the poker game there are 1277 unique 'High Card' ranks. It's 1287 (13 over 5) if we include all straights. The challenge is to write a function which returns an integer value corresponding to the ...
• 123
2k views

How quickly can you type this unary string?

If I want to type the string aaa, the least keystrokes I can type it in is 3: a a a. But if I want to type the string ...
• 37.8k
1k views

Pretty Palintiples

Imagine you have a positive integer number $n$. Let $m$ be the number obtained by reversing $n$'s digits. If $m$ is a whole multiple of $n$, then $n$ is said to be a reverse divisible ...
• 487
1k views

Enumerate the Phat-fingered-lights-out numbers

Even though the concept of phat-fingered-lights-out number should be pretty self-explanatory here is a definition: Given a nonnegative integer in binary representation a phat-fingered double-bit-flip ...
• 16.7k
1 vote
288 views

• 2,083
605 views

Binary Expansion Counting Sequence

I found another sequence not yet in the OEIS The binary expansion sequence is defines as follows, assuming 0 indexing: The even numbers of the sequence are how often 0 has appeared in the binary ...
• 12.5k
2k views

Mousetail's Sequence

I define mousetail's sequence as follows: If the nth element of the sequence is q, then n+1 must appear q times in the sequence The sequence is weakly monotonically increasing (i.e. no lower number ...
• 12.5k
1 vote
147 views

Exact Sum of 1/2 to 1/n [duplicate]

Consider the sequence 1/2, 1/3 + 1/2, 1/4 + 1/3 + 1/2, and so on. In mathematical symbols, this is $$S(n)=\sum_{m=2}^{n+1}\frac{1}{m}$$ where S is the function that makes the sequence. Outputting this ...
• 335
1k views

How many Carlitz compositions are there?

OEIS sequence A003242 comprises the numbers of Carlitz compositions for any given positive integer. This is the number of integer partitions of the integer for which no two adjacent parts are equal. ...
• 21.1k
977 views

Output an infinitely proportional sequence

In this challenge, an infinitely proportional sequence is defined as a infinite sequence of positive integers such that: All positive integers are contained infinitely many times within the sequence. ...
• 37.8k
2k views

Test whether a sequence is bitonic

You know what a monotonic sequence is: each element is bigger than its predecessor (monotonically rising) or as its successor (monotonically falling). Bitonic means you have two arms of the sequence, ...
• 2,501
262 views

Construct the Constructability sequence

Consider compass-and-straightedge construction, where you can construct new points from existing ones by examining intersections of straight lines and circles constructed with one of the following two ...
• 49.9k
2k views

Rudin-Shapiro sequence

The Rudin-Shapiro sequence is a sequence of $1$s and $-1$s defined as follows: $r_n = (-1)^{u_n}$, where $u_n$ is the number of occurrences of (possibly overlapping) $11$ in the binary ...
• 48k
2k views

Monotone sequence beatitude

Provided that the input is a monotone sequence of three or more integers: Output -2 if the sequence strictly decreases. Example: [7,4,3,2] Output -1 if the ...
• 5,941
4k views

Minecraft XP Orb Amounts

In the video game Minecraft, the player can obtain experience points (XP) from various activities. In the game, these are provided as XP "orbs" of various sizes, each of which give the ...
• 7,101
2k views

Divisor chain counts (1 3 3 7 ...)

The divisors of a natural number form a poset under the relation of "a divides b?", $a | b$. This challenge is to produce the number, $C$, of non-empty chains of such posets for natural ...
• 106k
2k views

Diagonal Binary Sequence

Challenge: Given a positive number $n$, convert it to binary, and output a sequence where all 1s form a top-left to bottom-right diagonal line, including a ...
• 126k
2k views

Make a super fair number

An even distribution number is a number such that if you select any of it's digits at random the probability of it being any particular value (e.g. 0 or ...
• 98.5k
1k views

The multiples are missing

Given a number $n$, you are to compute the sequence of positive numbers where for each number $a$, the $n$-times multiple $n\cdot a$ is missing. Example We always start with the sequence of ...
• 26.2k
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 ...
• 37.8k
754 views

Longest sequence of Egyptian fractions with n as denominator

Background From Wikipedia: An Egyptian fraction is the sum of distinct unit fractions. That is, each fraction in the expression has a numerator equal to 1 and a denominator that is a positive integer, ...
• 203
1k views

Find the longest permutations of integers from 1..k such that all neighbouring pairs sum to a square

OEIS A090461 details the ‘numbers k for which there exists a permutation of the numbers 1 to k such that the sum of adjacent numbers is a square’. This has also been the subject of Matt Parker’s ...
• 21.1k
1k views

Numbers with distinct decimal digits

Write a program or function that outputs all positive integers with distinct decimal digits (OEIS: A010784) Examples: ...
• 6,015
2k views

Golf the fast growing hierarchy

The fast growing hierarchy is a way of categorizing how fast functions are growing, defined the following way (for finite indices): $f_0(n)=n+1$ $f_k(n)=f_{k-1}^n(n)$ with $f^n$ meaning ...
• 6,015
1 vote
61 views

How Many Staircases [duplicate]

Problem You're a staircase engineer on a house and realize you only have n rectangles to create a staircase. So you are tasked with finding the number of ways to ...
• 383
741 views

Otteretto Classic game scoring method

Brief description of the game In the game Otteretto Classic (which you can test directly in your browser; try it!) the player has to form palindromic sequences using adjacent cells on a square grid. ...
• 104k
1k views

• 49.9k
1k views

Repeating occupied pattern in Hilbert's hotel

Imagine a countable infinite amount of empty rooms. When an infinite amount of guests come, they occupy the 1st, 3rd, 5th...(all odd) empty rooms. Therefore there's always an infinite amount of empty ...
• 23.9k
2k views

Make a k-skip-j range

On the Mathematica Stack Exchange, 100xln2 asks: I need a list of integers […] The list contains integers and is characterized by [three] parameters, lets call them k and j [and listmax], which ...
• 68.7k
2k views

Print all Polynomials

The set of all polynomials with integer coefficients is countable. This means that there is a sequence that contains each polynomial with integer coefficients exactly once. Your goal is it to write a ...
• 6,015
3k views

Numbers that can be negated by reading backwards

Balanced ternary is a modified version of ternary (base 3), using the three digits 1,0 and -1...
• 6,015
Inspired by the fact that a few related challenges to this could be answered by Vyxal in 0 Bytes using a special flag combination. Given only one input integer $n$, calculate $f(n,n)$ where  f(x,...