We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [sequence]

For challenges involving some sort of sequence.

Filter by
Sorted by
Tagged with
8
votes
21answers
796 views

N-Dimensional Cartesian Product

Introduction The Cartesian product of two lists is calculated by iterating over every element in the first and second list and outputting points. This is not a very good definition, so here are some ...
0
votes
0answers
63 views

Making Fibonacci Cry [duplicate]

Introduction The Fibonacci sequence is a mathematical sequence in which each term is the sum of the \$2\$ terms before it; the first two terms are \$0\$ and \$1\$. The first few terms are \$0, 1, 1, ...
3
votes
5answers
271 views

Trick or Treating

Introduction Little Jimmy is going trick or treating. He lives in an odd neighborhood: some houses give out candy, and some give out toothbrushes. Now, Jimmy does not want to get too many ...
15
votes
17answers
2k views

Plain Hunt Bell-Ringing

Your task is to create a plain hunt (a bell ringing pattern) with n bells. An example with 6 bells: ...
5
votes
6answers
260 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 ...
17
votes
2answers
561 views

Number of distinct tilings of an n X n square with free n-polyominoes

The newest "nice" OEIS sequence, A328020, was just published a few minutes ago. Number of distinct tilings of an n X n square with free n-polyominoes. This sequence counts tilings up to symmetries ...
24
votes
10answers
2k views

Fermat's polygonal number theorem

Fermat's polygonal number theorem states that every positive integer can be expressed as the sum of at most \$n\$ \$n\$-gonal numbers. This means that every positive integer can be expressed as the ...
1
vote
0answers
49 views

Spreadsheet Columns [duplicate]

Spreadsheet Columns In most spreadsheet programs, columns go A, B, C, ... ...
24
votes
25answers
3k views

Print the sequence

21, 21, 23, 20, 5, 25, 31, 24, ? Inspired by this Puzzle, given an integer \$n>0\$ , print out the following sequence until you reach a non-Integer (spoilered, in case you want to solve the puzzle ...
24
votes
20answers
7k views

1, 2, 4, 8, 16, … 33?

Challenge Write a function/program that outputs either the n'th element, or the first n elements, in the well known number ...
18
votes
2answers
502 views

Counting creatures on a hexagonal tiling

This challenge will have you count "creatures" in the tile game Palago. A creature is any closed shape that can be formed by Palago tiles of matching colour in a hexagonal grid. The game Palago ...
17
votes
8answers
1k views

Dividing Divisive Divisors

Given a positive integer \$n\$ you can always find a tuple \$(k_1,k_2,...,k_m)\$ of integers \$k_i \geqslant 2\$ such that \$k_1 \cdot k_2 \cdot ... \cdot k_m = n\$ and $$k_1 | k_2 \text{ , } k_2 | ...
22
votes
19answers
2k views

Bit floating sequence

A bit floats from the LSB to the MSB moving one position each time until it floats to the top of the container: 0000 0001 0010 0100 1000 Once one bit floats to ...
26
votes
17answers
4k views

Infinitely many primes

Since Euclid, we have known that there are infinitely many primes. The argument is by contradiction: If there are only finitely many, let's say \$p_1,p_2,...,p_n\$, then surely \$m:=p_1\cdot p_2\cdot.....
14
votes
16answers
2k views

What's this constructed number's starter?

A number of programming languages construct large integers through 'concatenating' the digit to the end of the existing number. For example, Labyrinth, or Adapt. By concatenating the digit to the end, ...
22
votes
24answers
4k 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.) ...
21
votes
10answers
2k views

Count the number of shortest paths to n

This code challenge will have you compute the number of ways to reach \$n\$ starting from \$2\$ using maps of the form \$x \mapsto x + x^j\$ (with \$j\$ a non-negative integer), and doing so in the ...
10
votes
7answers
242 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 ...
28
votes
29answers
4k views

Inverse Colombian Function

Let's define a sequence: The n digit summing sequence (n-DSS) is a sequence that starts with n. If the last number was k, then the next number is k + digit-sum(k). Here are the first few n-DSS: ...
11
votes
1answer
314 views

Draw Recamán's sequence with ASCII

Recamán's sequence (A005132) is a mathematical sequence, defined as such: $$A(n) = \begin{cases}0 & \textrm{if } n = 0 \\ A(n-1) - n & \textrm{if } A(n-1) - n \textrm{ is positive and not ...
-6
votes
3answers
373 views

Find the hardest OEIS sequence to golf!

Notice: This question originally had people write comments with a shorter program, rather than new answers. This has been changed so that people with shorter programs can get reputation too. Hopefully ...
11
votes
5answers
387 views

Reverse your code, reverse the OEIS

The task here is to write a program that takes an natural number, \$n\$, and produces the \$n\$th term of an OEIS sequence. That sequence should have an identifier in the form of ...
23
votes
24answers
3k views

Robbers: The Hidden OEIS Substring

This is a Cops and Robbers challenge. This is the robber's thread. The cop's thread is here. The cops will pick any sequence from the OEIS, and write a program p that prints the first integer from ...
37
votes
27answers
4k views

Cops: The Hidden OEIS Substring

This is a Cops and Robbers challenge. This is the cop's thread. The robber's thread is here. As a cop, you must pick any sequence from the OEIS, and write a program p that prints the first integer ...
2
votes
0answers
70 views

Mutation chain generator [duplicate]

Given a start word and a target word, print the "mutation chain" that starts at the start word and ends at the target word. You may assume both words are lowercase and only have alphabetic characters....
12
votes
2answers
548 views

Counting generalized polyominoes

This challenge will have you count pseudo-polyforms on the snub square tiling. I think that this sequence does not yet exist on the OEIS, so this challenge exists to compute as many terms as possible ...
24
votes
13answers
4k views

Two palindromes are not enough

Some numbers, such as \$14241\$, are palindromes in base 10: if you write the digits in reverse order, you get the same number. Some numbers are the sum of 2 palindromes; for example, \$110=88+22\$, ...
7
votes
5answers
648 views

Output the nth 'boring' number

There are 9 main types of numbers, if you categorise them by the properties of their factors. Many numbers fall into at least one of these categories, but a few don't. The categories are as follows: ...
17
votes
31answers
3k views

First occurrence in the Sixers sequence

The Sixers sequence is a name that can be given to sequence A087409. I learned about this sequence in a Numberphile video, and it can be constructed as follows: First, take the multiples of 6, ...
41
votes
29answers
6k views

Nth term of Van Eck Sequence

Output the Nth term of the Van Eck Sequence. Van Eck Sequence is defined as: Starts with 0. If the last term is the first occurrence of that term the next term is 0. If the last term has occurred ...
11
votes
21answers
1k views

An OEIS polyglot

This is an answer-chaining challenge relating to the OEIS. Oh, the justification for this is because a company needs one program to print out their OEIS sequences real bad and they have every ...
14
votes
31answers
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 \$...
-4
votes
4answers
1k views

Output first \$n\$ digits of \$\pi^{1/\pi}\$

This challenge is to produce the shortest code for the constant \$\pi^{1/\pi}\$. Your code must output the first \$n\$ consecutive digits of \$\pi^{1/\pi}\$, where \$n\$ is given in the input. ...
18
votes
15answers
2k views

Divisor Rich and Poor Numbers

Introduction In the strange world of integer numbers, divisors are like assets and they use to call "rich" the numbers having more divisors than their reversal, while they call "poor" the ones having ...
20
votes
16answers
3k views

​Cuban​ ​Primes

Given a natural number \$n\$, return the \$n\$-th cuban prime. Cuban Primes A cuban prime is a prime number of the form $$p = \frac{x^3-y^3}{x-y}$$ where \$y>0\$ and \$x = 1+y\$ or \$x = 2+y\$ ...
31
votes
19answers
2k views

Hostile Divisor Numbers

Some divisors of positive integers really hate each other and they don't like to share one or more common digits. Those integers are called Hostile Divisor Numbers (HDN) Examples Number <...
8
votes
9answers
1k views

Shantae Dance Matching

In the original Shantae game, there are transformation dances that you have to input in time using the D-Pad, A, and B. If you complete a predefined sequence while dancing, you will transform into the ...
13
votes
10answers
1k views

New Order #6: Easter Egg

Introduction (may be ignored) Putting all positive integers in its regular order (1, 2, 3, ...) is a bit boring, isn't it? So here is a series of challenges around permutations (reshuffelings) of all ...
26
votes
12answers
2k views

The Nth Gryphon Number

I came up with a series of numbers the other day and decided to check what the OEIS number for it was. Much to my surprise, the sequence did not appear to be in the OEIS database, so I decided to ...
35
votes
20answers
3k views

List *all* the tuples!

Write a program, given an input n, will generate all possible n-tuples using natural numbers. ...
16
votes
5answers
676 views

New Order #5: where Fibonacci and Beatty meet at Wythoff

Introduction (may be ignored) Putting all positive numbers in its regular order (1, 2, 3, ...) is a bit boring, isn't it? So here is a series of challenges around permutations (reshuffelings) of all ...
17
votes
19answers
2k views

New order #4: World

Introduction (may be ignored) Putting all positive numbers in its regular order (1, 2, 3, ...) is a bit boring, isn't it? So here is a series of challenges around permutations (reshuffelings) of all ...
44
votes
41answers
10k views

Patience, young “Padovan”

Everyone knows the Fibonacci sequence: You take a square, attach an equal square to it, then repeatedly attach a square whose side length is equal to the largest side length of the resulting rectangle....
1
vote
0answers
54 views

Count using letters [duplicate]

What to do? Starting from a, count in the sequence: ...
16
votes
6answers
347 views

New Order #3: 5 8 6

Introduction (may be ignored) Putting all positive numbers in its regular order (1, 2, 3, ...) is a bit boring, isn't it? So here is a series of challenges around permutations (reshuffelings) of all ...
13
votes
3answers
370 views

Counting the number of restricted forests on the Möbius ladder of length n

OEIS sequence A020872 counts the number of restricted forests on the Möbius ladder Mn. The Challenge The challenge is to write a program that takes an integer as an input ...
15
votes
11answers
779 views

New Order #2: Turn My Way

Introduction (may be ignored) Putting all positive numbers in its regular order (1, 2, 3, ...) is a bit boring, isn't it? So here is a series of challenges around permutations (reshuffelings) of all ...
12
votes
10answers
589 views

New Order #1: How does this feel?

Introduction Putting all positive numbers in its regular order (1, 2, 3, ...) is a bit boring, isn't it? So here is a series of challenges around permutations (reshuffelings) of all positive numbers. ...
14
votes
11answers
896 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 ...
25
votes
28answers
3k views

Make me a metasequence

Background For this challenge, a 'metasequence' will be defined as a sequence of numbers where not only the numbers themselves will increase, but also the increment, and the increment will increase ...