# Questions tagged [number]

A competition to solve a particular problem through the usage and manipulation of numbers.

1,221 questions
Filter by
Sorted by
Tagged with
2k views

### To exponential digit growth and beyond!

Challenge Given a base $1 < b < 10$ and an index $t \ge 1$, output term $x_t$, defined as follows: $x_1 = 11_{10}$ $x_{i+1}$ is obtained by converting $x_i$ to base $b$ and then ...
• 2,622
369 views

### Convert a number into "bracket" numerals

"Bracket" numerals are a type of 'numerals' I made up once, and thought would be a nice challenge here. Basically, you convert the input number into base 6, and then transliterate the ...
• 123
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&...
• 4,989
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$ ...
• 43.1k
486 views

• 43.1k
2k views

### Maximum summed subsequences with non-adjacent items

Introduction: Inspired by these two SO questions (no doubt from the same class): print the elements in the subarray of maximum sum without adjacent elements java and Maximum sum of non adjacent ...
• 105k
8k views

### Amount of permutations on an NxNxN Rubik's Cube

Introduction: A 3x3x3 Rubik's Cube has $43,252,003,274,489,856,000$ possible permutations, which is approximately 43 quintillion. You may have heard about this number before, but how is it actually ...
• 105k
3k views

### List of Python versions

Python is the fastest-growing major programming language today. It is the most wanted language for the third year in a row, meaning that developers who do not yet use it say they want to learn it.[1] ...
3k views

### Area of a 2D convex hull

You are given an array/list/vector of pairs of integers representing cartesian coordinates $(x, y)$ of points on a 2D Euclidean plane; all coordinates are between $−10^4$ and $10^4$, duplicates ...
• 2,483
1 vote
161 views

### How many right triangles can you find? [closed]

Challenge You will be given an input represented by x, which is a string containing at least 3 characters. It will consist only of the standard numeric characters, ...
3k views

### Match Roman Numerals

Challenge Given some input string, return a truthy value if it represents a correct roman numeral between 1 (=I) and 3999 (=...
• 43.1k
11k views

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....
• 2,483
763 views

### How long does it take to type this?

Introduction I can type at a moderate pace, using the QWERTY keyboard layout. But if a word like yellowwooddoor has a ton of repeated letters, it takes a bit longer to type it. Even worse is when a ...
• 3,879
515 views

### Valid term from quadratic sequence?

You are given four numbers. The first three are $a$, $b$, and $c$ respectively, for the sequence: $$T_n=an^2+bn+c$$ You may take input of these four numbers in any way. The output should be ...
• 842
1k views

### Expand and Contract

Take a positive integer $k$ as input. Start with $n := 1$ and repeatedly increase $n$ by the largest integer power of ten $i$ such that $i \le n$ and $i + n \le k$. Repeat until $n = k$ ...
• 15.1k
3k views

Introduction: I saw there was only one other badminton related challenge right now. Since I play badminton myself (for the past 13 years now), I figured I'd add some badminton-related challenges. Here ...
• 105k
903 views

### Calculating total slots

Given a list of jobs, which must be done in order, with each taking a slot to do, how long will it take to perform them all if after doing a job the same job cannot be done for the next two slots (...
• 489
2k views

### The Digit Triangles

Challenge: Input: A positive integer $n$ Output: Create a list in the range $[1,n]$, and join it together to a string (i.e. $n=13$ would be the string ...
• 105k
108 views

### Sort a list of Numbers as letters [closed]

So, you have a random list (random meaning it doesn't matter what order it is in) of numbers with a length of n, where n is a positive integer smaller than 1000 and ...
• 217
9k views

### Am I not good enough for you?

Background: The current Perfect Numbers challenge is rather flawed and complicated, since it asks you to output in a complex format involving the factors of the number. This is a purely decision-...
• 44.8k
8k views

Challenge: Input: A list of distinct positive integers within the range $[1, \text{list-size}]$. Output: An integer: the amount of times the list is riffle-shuffled. For a list, this means the list ...
• 105k
657 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. ...
• 2,871
8k views

### Is it a Cyclops number? "Nobody" knows!

Task: Given an integer input, figure out whether or not it is a Cyclops Number. What is a Cyclops number, you may ask? Well, it's a number whose binary representation only has one ...
• 2,483
5k views

### The (Easy) Road to Code

Input: An integer $n$, which is guaranteed to be $\ge3$. An integer $d$, which is one of $[-1,0,1]$. Output: A road of size $n$, which will be in a north-west direction if $d=-1$; a ...
• 105k
2k views

### Sum integers in a string [duplicate]

Input A string. Output The sum of all integers in the line. Constraints 1≤Length of line≤500 Sample test Case Input the 5is 108 seCONd4 a Output ...
2k views

### Jumping Numbers

A jumping number is defined as a positive number n which all pairs of consecutive decimal digits differ by 1. Also, all single digit numbers are considered jumping numbers. eg. 3, 45676, 212 are ...
8k views

### Historical difference between / and ÷ in mathematical expressions

Introduction: Inspired by a discussion that is already going on for many years regarding the expression $6÷2(1+2)$. With the expression $6÷2(1+2)$, mathematicians will quickly see that ...
• 105k
12k views

### Am I a Rude Number?

For a while now, I've been running into a problem when counting on my fingers, specifically, that I can only count to ten. My solution to that problem has been to count in binary on my fingers, ...
• 6,889
2k views

### Square Root Distance from Integers

Given a decimal number k, find the smallest integer n such that the square root of n is ...
• 13.5k
3k views

### The Highest Dice

Challenge: Here we have the first 100 items of a sequence: ...
• 105k
4k views

### The real treasure was the numbers we made along the way

Your task is to write a program, function or snippet (yes, snippets are allowed) that simply outputs an integer. However, you must be able to separate your submission into prefixes that also produce ...
• 44.8k
8k views

### Covering a Skyline with brush strokes

Given a non-negative integer skyline height list, answer how many uninterrupted 1-unit-high horizontal brush strokes are needed to cover it. [1,3,2,1,2,1,5,3,3,4,2]...
• 27.7k
373 views

### Countries by Area

Challenge Given two non negative integers a < b, output all countries, from the below Top 100 Countries, where area is between ...
• 2,793
662 views

### A Multipurpose Quine

I personally love quines, but they all seem to be so... static. So why not create a quine that can do more. Challenge The challenge here is to create a quine that without any sort of input is a ...
799 views

### Trapped Knight Sequence

Introduction Inspired by the very recent video The Trapped Knight - Numberphile, I came up with a challenge. The trapped knight sequence is a finite integer sequence of length 2016, starting from 1, ...
• 6,068
1k views

### Spot all (anti)diagonals with duplicated values

Challenge: Given a matrix input, determine the amount of diagonals and anti-diagonals with duplicated numbers. So if we have a matrix like this: ...
• 105k
567 views

### Prime Difference [duplicate]

Given an integer n, output the smallest prime such that the difference between it and the next prime is at least n. For example, if n=5, you would output ...
• 2,871
1 vote
236 views

### Work out $x^y$ using only addition and subtraction [duplicate]

The challenge is to implement a function or program that takes two numbers, $x$ and $y$ and return the result of $x^y$. The program cannot use any other mathematical operation other than $+$ ...
• 151
3k views

### Matrix Jigsaw Puzzles

Input: An integer n Two equal-sized square matrices (with their width/height being a multiple of n) Output: One of two ...
• 105k
2k views

### Enumerate each series of identical numbers in-place

Given a list of strictly positive integers, go through each distinct number and replace all occurrences of it with successive indices (zero or one based) of a new series. Examples ...
• 27.7k
610 views

### Mis-decode a date

Background Inspired by a now deleted question by John Burger from which I quote: Now obviously no human made this mistake. It's a mis-decode of something - perhaps the ISBN? My question is: ...
• 27.7k
537 views

### Surreal Numbers

Surreal Numbers are one way of describing numbers using sets. In this challenge you will determine the value of a surreal number. Intro A surreal number consists of two sets: a left and right. The ...
• 2,871
364 views

### Approximate the proportion of integers with neighboring factors

If 1 is not counted as a factor, then 40 has two neighboring factors (4 and 5) 1092 has two neighboring factors (13 and 14) 350 does not have two neighboring factors (out of its factors 2, 5, 7, 10, ...
• 70.5k
1 vote