for challenges involving some sort of sequence.

learn more… | top users | synonyms

-2
votes
0answers
43 views

Selecting movie times at the cinema [on hold]

Suppose that I am planning a trip to the cinema. I have a list of n movies (where n > 2) that I want to see, along with lists of their start times and lengths, and an idea of how long the ads and ...
-6
votes
3answers
144 views

Challenge to generate a mathematical sequence [on hold]

I challenge you to generate the following sequence. 1 2 3 4 5 11 17 23 29 35 76 117 158 199 240 281 603 925 1247 1569 1891 2213 ......N Th term N will be only Input in your code(Any Language) ...
-2
votes
9answers
330 views

I challenge you to generate the following sequence [on hold]

I challenge you to generate the following sequence till 100 terms through any programming language in shortest characters possible. The sequence is like this :- 1 2 3 4 5 10 20 30 40 50 100 200 300 ...
-5
votes
1answer
123 views

Shortest code to generate 2D coordinates

I'm looking for the shortest code to generate the following sequences: Sequence A i | y x 0 | 0 0 1 | 0 1 2 | 1 0 3 | 1 1 The best I have is x = i % 2, y = i / 2, there is probably no beating that. ...
11
votes
4answers
474 views

Calculate practical numbers

Definition A positive integer n is a practical number (OEIS sequence A005153) iff all smaller positive integers can be represented as sums of distinct divisors of n. For example, 18 is a practical ...
79
votes
106answers
16k views

4, 8, 15, 16, 23, 42

4, 8, 15, 16, 23, 42 Write a program that outputs this sequence of numbers infinitely. However, The Numbers must not appear in your source code anywhere. The following is not a valid Java program to ...
3
votes
6answers
273 views

Find all Perrin pseudoprimes less than 100 million

Simply put, the Perrin sequence has the following recurrence relation: P(n) = P(n-2) + P(n-3); P(0) = 3; P(1) = 0; P(2) = 2; But wait!! There's more!! The Perrin sequence has a very ...
7
votes
15answers
3k views

Please give me “Fibonacci sequence” the code [closed]

Help! I was a homework assignment, a program given something that is called the Fibonacci sequence to write. I do not know what it is. I wanted to read on Wikipedia, but it is too long. Please ...
12
votes
14answers
2k views

Write a program which performs brute force letter combination until the word “password” is found

The program should print every letter combination (lowercase or uppercase, it doesn't matter) in alphabetic order. It must start with a and the last printed combination should be password. The output ...
18
votes
10answers
2k views

Flipping pancakes

In pancake sorting the only allowed operation is to reverse the elements of some prefix of the sequence. Or, think of a stack of pancakes: We insert a spatula somewhere in the stack and flip all the ...
7
votes
5answers
499 views

Generate Skolem sequences

Beat this I was hanging out with a friend in a pub around 11:00 last night. She told me that a Skolem sequence is a sequence of 2n numbers where every number between 1 and n is repeated twice, and ...
17
votes
2answers
780 views

The number of possible numeric outcomes of parenthesizations of 2^2^…^2

Consider an expression 2^2^...^2 with n operators ^. Operator ^ means exponentiation ("to the power of"). Assume that it has no default assosiativity, so the expression needs to be fully parenthesized ...
8
votes
8answers
457 views

Make a pattern alternate

Problem You are given a sequence of coloured balls (red R and green G). One such possible sequence is: RGGGRRGGRGRRRGGGRGRRRG In as few moves as possible, you must make it so that each ball is a ...
8
votes
3answers
1k views

Longest non-repeating Game-of-Life sequence

Given a positive integer N, determine the starting pattern on a N x N-grid that yield the longest non-repeating sequence under Game of Life-rules, and ends with a fixed pattern (cycle of length 1), ...
6
votes
6answers
297 views

Return each number from a group of numbers

The challenge The program must return all numbers included into a group (comma and hyphen separated sequence) of numbers. Rules s is the sequence string; all numbers included in s are positive; ...
5
votes
4answers
766 views

Quickly find length of n-th term of the look-and-say sequence

The look and say sequence is defined as: 1 11 21 1211 111221 312211 13112221 1113213211 Write the shortest program to find the length of a specified term of this sequence without calculating each ...
2
votes
13answers
1k views

Calculate the nth term of Golomb's self-describing sequence

Inspired by the previous question. Golomb's self-describing sequence g(n) is a sequence where any natural number n is repeated within the sequence g(n) times. The first few numbers in the sequence ...
4
votes
6answers
578 views

Generate a Kolakoski sequence

Definition1 A Kolakoski sequence is a self-describing infinite sequence {kn} of alternating blocks of 1's and 2's, given by the following rules: k0 = 1 kn = the length of the (n+1)'th ...
2
votes
9answers
446 views

Generate a valid sequence of numbers with specific rules

The challenge The program must return a valid sequence of numbers into some rules Rules x is the size of the sequence; x cannot be less than 4 or greater than 9 (Thanks David Carraher); Digits of ...
9
votes
3answers
787 views

Universal (rule-bending) Code Golf solver

Code golf always involves some answers that bend the rules more or less by breaking constraints that the challengers took for granted or just haven't thought about and didn't list in the rules. One of ...
2
votes
8answers
357 views

The group of sequential positive numbers with the highest sum?

Given the following list of numbers, find the group of sequential positive numbers with the highest sum. Example input: 12 2 35 -1 20 9 76 5 4 -3 4 -5 19 80 32 -1 Example output: 131 The most ...
5
votes
2answers
295 views

Unfolding an integer

Given the functions L: (x, y) => (2x - y, y) R: (x, y) => (x, 2y - x) and a number N generate a minimal sequence of function applications which take the initial pair (0, 1) to a pair which ...
8
votes
26answers
3k views

Jolly Jumper Sequence

A sequence of n > 0 integers is called a jolly jumper if the absolute values of the difference between successive elements take on all the values 1 through n-1. So the sequence [4,1,2,4] has absolute ...
12
votes
7answers
746 views

What comes next?

Given a space-separated list of integers, your task is to find the next integer in the sequence. Each integer in the sequence is the result of applying a single mathematical operation(+,-,* or /) to ...
16
votes
20answers
2k views

Code Golf: 6174 - Kaprekar's mythical constant

Why is the number 6174 so interesting? As defined by Wikipedia Take any four-digit number, using at least two different digits. (Leading zeros are allowed.) Arrange the digits in ...
14
votes
21answers
2k views

Look and say sequence

The look and say sequence is a basic form of run length encoding. The sequence starts with the number 1 and each additional number encodes the number of digits that are repeated before each digit ...