# Questions tagged [number]

This challenge is intended to be solved by using, manipulating, accepting as input, or outputting numeric values.

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

### A bit of a digital XOR

Here are the first 100 numbers of a sequence: ...
73 views

1k views

### Find the Inverse Neighbor Pairs

Definition We say a pair of integers $(a,b)$, where $0<a<b<N$ and $N$ is an integer larger than 4, is an inverse neighbor pair respect to $N$ if $ab\equiv1\text{ }(\text{mod }N)$ ...
1k views

### Number of palindrome splits

In this task you will take as input a non-negative integer $n$, and output the number of pairs of non-negative integers $a,b$ such that both are palindromes*, $a \leq b$, and $a+b = n$. For ...
2k views

### Power-Ending Patterns

When you look at the last decimal digit of each power of a non-negative integer a repeating pattern forms. For example, 3: ...
6k views

### Shift right by half a bit

The challenge is to implement a program or function (subsequently referred to as "program") that takes a nonnegative integer $n$ as input and returns $n\over\sqrt{2}$ (the input divided by the ...
865 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 ...
418 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. ...
194 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 ...
255 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 ...
511 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 ...
4k 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 ...
279 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. ...
463 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 ...
835 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 results ...
461 views

### Output integer given a digital clock style input

Input _ _ _ _ _ _ _ _ | _| _||_||_ |_ ||_||_|| | ||_ _| | _||_| ||_| _||_| output 1234567890 Rules ...
480 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 ...
243 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 $UR(\cdot)$ to denote ...
3k 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. ...
235 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 ...
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 ...
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 ...
799 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, ...
4k 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 ...
5k 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 ...
4k 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 ...
1k 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 ...
1k 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. ...