# 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
965 views

### Cartesian LCM of two arrays

Given two nonempty arrays of natural numbers $a$ and $b$, return the shortest nonempty array of pairs of natural numbers $q$ such that the sequence of first elements of $q$ consists of a whole ...
3k views

### What's the Mayan date?

Just over seven years ago, everybody suddenly stopped talking about the Maya people. It is time to rectify that! For clarification, I am talking about the Mesoamerican Long Count Calendar. Your ...
444 views

### Partitioning Digits into Distinct Integers

Given a sequence of base-10 digits, output the longest list of integers that contains all the digits exactly once, in the order in which they appeared in the input, without repeating any integers. ...
215 views

### Determine if a number is less than another [closed]

Introduction Your job is to write a function or program that detects if a number a is less than a number b. But... You are not ...
309 views

### Maximal 2-distance Sets

In the plane ($\mathbb R^2$) we can have at most five distinct points such that the distances from each point to every other point (except itself) can assume at most two distinct values. An example ...
663 views

### Is this ordinal prime?

You are given an countable ordinal $1 < r < \varepsilon_0$. Determine whether or not it is prime. If not, provide exactly two ordinals $r_0, r_1 < r$ such that $r_0r_1 = r$, following ...
5k views

### Round up my number

Sandbox Given two positive integers a and b, return the smallest multiple of b that is greater than or equal to a. Examples Definitions: true = ... 3k views

### Size Does Matter (at least referring to bottles)

Introduction I have an even number of bottles, all of different sizes. Unfortunately, I only know the size of the smallest bottle: 300ml. I also know the following: Half of the bottles are twice ...
379 views

### Fastest N times Hello World (Java/C/ C++) [closed]

Not a new one: Input N, being n, 0 ≤ n ≤ 5. Output N times "Hello World." Example: Input 3 Output Hello World. Hello World. Hello World. These 2 are my ...
2k views

### Max of the reversed of two numbers

Given two real numbers (postive or negative) in the limits of float pointing number data types, i.e., ($-3.4e38$ to $3.4e38$) not inclusive, you should output the max of the two reversed numbers. ...
756 views

### Roman Numeral Counting

Roman numerals can be (mostly) written in a one column format, because each letter intersects the top and the bottom of the line. For example: I, or 1 intersects ...
2k views

### Reach the number in minimum steps

In this challenge, you are given a number x. You have to find the minimum number of steps required to reach x from 1. At a particular point, you have two choices: 1) Increment the number by 1. 2) ...
3k views

### Interpret numbers very literally

To interpret a positive integer very literally, write it in English words (without "and"), replace hyphens with spaces, replace each resulting word with its number value, and concatenate the ...
538 views

### Output integer given a digital clock style input

Input _ _ _ _ _ _ _ _ | _| _||_||_ |_ ||_||_|| | ||_ _| | _||_| ||_| _||_| output 1234567890 Rules ...
509 views

### List where pinballs would exit a grid of bumpers from different entrance points

Inspired by this lumosity mini game, Pinball Recall We start with a rectangular grid (viewed from above) with several bumpers as follows. Entrances/exits are numbered counter-clockwise starting from ...
3k views

### Are my triangles similar?

Given (in any structure; flat list, two lists of lists, a tuple of matrices, a 3D array, complex numbers,…) the coordinates for two non-degenerate triangles ...
1k views

### Digit Date Range

NOTE: Since I'm Dutch myself, all dates are in the Dutch dd-MM-yyyy format in the challenge description and test cases. Challenge: Inputs: Start date $s$; End ...
257 views

### Replace by most recent nonzero [duplicate]

Given a non-empty list of decimal digits (0, 1, ..., 9), replace each zero by the most ...
9k views

Sandbox French License Plates French license plates come in a sequential order, following a specific pattern of numbers and letters : AB-012-CD Challenge Write ...
3k views

What is the Ultraradical? The ultraradical, or the Bring radical, of a real number $a$ is defined as the only real root of the quintic equation $x^5+x+a=0$. Here we use $\text{UR}(\cdot)$ to ...
4k views

### Convert a string of digits from words to an integer

Convert a string containing digits as words into an integer, ignoring leading zeros. Examples "four two" -> 42. ...
247 views

### Given a sequence of numbers, print out all possible sets such that the sum is less than a number

The problem has 3 inputs. L: a list of all numbers size: the size each set can be max: the max sum amongst each set The challenge is as follows: Given L, size and max, construct as many sets from ...
8k 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 ...
8k views

### I reverse the source code, you negate the input!

Blatant rip-off of a rip-off. Go upvote those! Your task, if you wish to accept it, is to write a program/function that outputs/returns its integer input/argument. The tricky part is that if I ...
1k views

### Decimal “XOR” operator

Many programming language provide operators for manipulating the binary (base-2) digits of integers. Here is one way to generalize these operators to other bases: Let x and y be single-digit numbers ...
839 views

### Output Distinct Factor Cuboids

Output Distinct Factor Cuboids Today's task is very simple: given a positive integer, output a representative of each cuboid formable by its factors. Explanations A cuboid's volume is the product ...
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, ...
6k views

### Round away from zero

Round away from zero Inspired by Round towards zero. Given a number input via any reasonable method, round the number "away from zero" - positive numbers round up, and negative numbers round down. ...
6k views

### First Number to Contain Each Letter

Given a single letter from A to Z (except J and K) as input, output the smallest non-negative integer containing that letter in its written form. Assume numbers never contain the word "and", so ...
6k views

### Divide Numbers by 0

We've all been told at some point in our lives that dividing by 0 is impossible. And for the most part, that statement is true. But what if there was a way to perform the forbidden operation? Welcome ...
6k views

### Round towards zero

This is a simple task. Given a positive or negative real number, round it to the next whole integer closer to zero. The challenge Take input through any reasonable form (stdin, function, etc.) of ...
2k views

### Levenshtein Neighbours

Most square numbers have at least 1 different square number with which their Levenshtein distance is exactly 1. For a given square $x$, each square that meets this condition is called a Levenshtein ...
2k views

### Simplification of numbers

How, you can’t remember the 6 or 7-digit phone number that appeared on the TV screen for a second?! Using the special technique described below, you will turn into a walking phonebook! Obviously, the ...
5k views

Introduction: Beckett Grading Service (aka BGS), is a company which encapusulates and grades Trading Card Game (TCG) cards (i.e. sport cards, Magic The Gathering, Pokémon, Yu-Gi-Oh, etc. etc.). The ...
2k views

### Alphanumeric Line and Curve Counting

Given an input string, write a program that outputs the total number of lines and curves it has. The Challenge Take input from STDIN, or any other input method. ...
6k views

### Integer Lists of Noah

Introduction: I think we've all heard of it, but here a very brief summary: Noah gathered two of every species of animal on the planet, male and female, to save in his Ark during a great flood. The ...
1k views

### Tesco's Burger Relish Best Before End date number

Given a date between 2010-01-01 and 2099-12-31 as three integers (please state your order if not [year,month,day]), answer with Tesco's corresponding five-digit ...
268 views

### Is this number a palindrome? [closed]

Input A single integer in your language's preferred format, e.g int or an array of digits are all acceptable. Output A truthy or falsely value, depending on ...
15k views

### Do the 26 richest billionaires own as much wealth as the poorest 3.8 billion people?

Introduction: A few days ago I read this post with the same title when I came across it in the HNQ. In this question it is being discussed if the claim of president-candidate Bernie Sanders, who ...
518 views

### Implement a strongly Darboux function

According to Wikipedia, a strongly Darboux function is one for which the image of every (non-empty) open interval is the whole real line In other words, a function $f$ is strongly Darboux if ...
3k views

### Analog is Obtuse!

An analog clock has 2 hands*: Hour and minute. These hands circle the clock's face as time goes by. Each full rotation of the minute hand results in 1/12th of a rotation of the hour hand. 2 full ...
246 views

### Fastest way to iterate over sublattice of discrete lattice

I need to construct a functor that iterates over the linear representation of a sub-lattice of size $d_x,d_y,d_z,d_q$ embedded in a lattice of size $n_x,n_y,n_z,n_q$. The sub-lattice corner is ...
478 views

### Distributing parliament seats

Introduction In a general election, one would like to calculate a constant price per parliament seat. This means that for N >= 0 seats to be distributed and a ...
1k views

### Subtract the Folded Matrix

Challenge: Given an NxN matrix where $N\geq2$ and one of eight distinct 'folding options', output a 2D array/list with the subtracted values. The eight folding options are: left-to-right; right-to-...
502 views

### Print the total length of all "quoted" characters

Rules In this challenge, I'm going to redefine the definition of "quotes" a bit. Quotation marks (AKA quotes) are any identical characters used in pairs in various writing systems to set off direct ...
989 views

### Group Integers by Originality

Introduction: I collect twisty puzzles. Most twisty puzzles are produced and sold by Chinese companies. Most well-known companies ask permission from puzzle designers to produce their designs and work ...
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 \\$...
3k views

### Rotated Position of Integers

Challenge: Input: A sorted list of positive integers. Output: The amount of integers which are still at the exact same index, after rotating the digits in each integer its index amount of times ...