# Questions tagged [number]

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

978 questions
774 views

### Ordinal string check

Description : Given a string as input, check if it is a valid ordinal number in English or not. If it is valid return truthy value otherwise return falsy value. (Suggested by @Arnauld. Thanks . Also ...
1k views

### Arithmetic Cycle

Input: Integer n which is >=0 or >=1 (f(0) is ...
756 views

### Digit Occurrences

Input: A list of integers (which will never contain a zero) Output: A list of the same size with counts based on the following: If the current item is negative: Look at all items before this item, ...
3k views

### Up go the bits!

Given an integer N perform the following steps: (using 9 as an example). Receive input N. (9) Convert N from base10 to base2. (...
2k views

### Output a binary path from a number

For an integer n that satisfies n > 0, write its value as a right-descending path based on its binary representation. Rules ...
7k views

### Make an Emergency Corridor

In some nations there are recommendations or laws on how to form emergency corridors on streets that have multiple lanes per direction. (In the following we only consider the lanes going in the ...
1k views

### Interval Notations

Challenge: Input: Two integer parameters a and b (where a<b and the difference is at ...
402 views

### Egg hunting in Collatz style

Inspired by The Great API Easter Egg Hunt! Summary Your task is to search for a predetermined integer in the "Collatz space" (to be explained later) using the fewest step possible. Introduction ...
2k views

### Digits in their lanes

Input: A list of integers Output: Put each digit (and the minus sign) in its own lane, in the order -0123456789, ignoring any duplicated digits. Example: Input:...
2k views

### Ten-pin bowling score - World Bowling edition

World Bowling scoring Many people have gone to their local bowling center to play a few games of bowling, and many people continue to struggle to calculate their scores. World Bowling has introduced ...
1k views

### Golf A Free Lunch

Find a maximally profitable sequence of exchanges given an exchange rate table. As an example consider the currencies Ariary (your home currency), Baht, Cedi, and Denar where the rate from one to ...
86 views

### Print a number that number of times [duplicate]

Example Input -> 5 Output -> 55555 Input -> 12 Output -> 121212121212121212121212 Criteria Least number of bytes wins!
1k views

The rules are as follows: Take in a string of integers separated by spaces. Add the first and last numbers, the second and second-last numbers, and so on. The program must output the numbers ...
2k views

### What is my exponential potential?

We'll define the N-exponential potential of a positive integer M as the count of prefixes of MN that are perfect N-powers. The prefixes of an integer are all the contiguous subsequences of digits ...
268 views

### Decompose Polynomials

Given an integral polynomial of degree strictly greater than one, completely decompose it into a composition of integral polynomials of degree strictly greater than one. Details An integral ...
5k views

### EASY to memorize numbers

Numbers that are easy to remember yet theoretically not easily made Your challenge is to make a program/function in any language that generates uniformly random numbers that fit these criteria: ...
208 views

### Finding Factorials with Gamma [duplicate]

Introduction We know that the factorial notation is valid for all natural numbers. However, Euler had extended it for all positive real numbers, as well as for complex numbers by defining a function, ...
6k views

### Compute the Kolakoski sequence

This is a repost of an old challenge, in order to adjust the I/O requirements to our recent standards. This is done in an effort to allow more languages to participate in a challenge about this ...
902 views

### Find relevant digit groupings

Recently, my reputation was 25,121. I noticed that each digit grouping (i.e. the numbers separated by commas) was a perfect square. Your challenge is, given a non-...
370 views

### Visit and exit an array

Challenge: Input: An integer n (> 0) An integer-array a of size ...
2k views

### How to print the below format in the fewest bytes?

This challenge is inspired by this, now deleted question. Take a positive integer N as input, and output a matrix with the numbers 1 .. N2 that follows the pattern below: Fill in the first row with ...
1k views

### Given a number, print out its “collective sum”

Given a number as input, print out its collective sum What is a collective sum? Consider the number 13214, the input Looping through each of the digits starting ...
249 views

### Print the numbers -1, 0, 1 [duplicate]

This is a very simple challenge, and it is to print the numbers -1, 0, and 1. The following ...
845 views

### Quartic Summation

Guidelines Task Given two non-negative integers, find the sum of both numbers... to the power of 4. Examples 2, 3 -> 97 (2^4 + 3^4 = 97) ...
405 views

### Convert a number to Korean

Goal You will be given a positive integer number less than 10^20. You must convert it to Korean. For example, if the input is 12345, the output should be ...
5k views

### Is there a bump?

Given a list of positive integers determine if there is an element that is either greater than its two neighbors or less than its two neighbors (a "bump"). To be clear a bump can never be the first ...
3k views

### Bertrand's Primes

Bertrand's Postulate states that for every integer n ≥ 1 there is at least one prime p such that n < p ≤ 2n. In order to verify this theorem for n < 4000 ...
571 views

### Can you outgolf Bill Gates?

Pancake sorting is the colloquial term for the mathematical problem of sorting a disordered stack of pancakes in order of size when a spatula can be inserted at any point in the stack and used to ...
678 views

### Verify Cyclic Difference Sets

A cyclic difference set is a set of positive integers with a unique property: Let n be the largest integer in the set. Let r be ...
1k views

### Compressing the Atomic Ionization Energies

This is a different type of compression challenge. In a normal kolmogorov-complexity challenge, you are required to recreate a list exactly. Here, you are allowed to round the values in any way you ...
1k views

### Infer geometric sequences

Haskell has this neat(-looking) feature where you can give it three numbers and it can infer an arithmetic sequence from them. For example, [1, 3..27] is equivalent ...
65 views

### How many logs can you fit into a number? [duplicate]

Challenge Given a real number as input, calculate the number of times which the natural logarithm function ln can be applied to it before the resulting number ...
1k views

### Make Zero From First 'n' Numbers

Challenge The challenge is to write a code that takes a positive integer 'n' as an input and displays all the possible ways in which the numbers from 1 - n can be written, with either positive or ...
1k views

### Find The Local Maxima And Minima

Definition The maxima and minima of a given function are the largest and smallest values of the function either within a given range or otherwise within the entire domain of the function. Challenge ...
4k views

### I want my book to be away from this table

Story So I have a book that I want to separate from my table with nothing but other books. I want to know how many books do I need to achieve this with $n$ book lengths. Here's a visualization ...
805 views

### Extension of the Game of Sevens

Introduction Output all the numbers in specific base that would appear in an adapted version of the game of seven. Challenge Your task is to output all the numbers in a given base in a given range, ...
891 views

### Bottom part of the Hourglass

Challenge: Input: Three integers: bottom-edge length; starting amount of grains of sand; index Output: Output the state of the bottom part of an hourglass at the given index, based on the given ...
2k views

### Find Integral Roots of A Polynomial

Challenge The challenge is to write a program that takes the coefficients of any n-degree polynomial equation as input and returns the integral values of x for which the equation holds true. The ...
2k views

### Olympic Rings Sequence

Challenge: Given an index integer n, either output the n'th item in this sequence, or output the sequence up to and including ...
4k views

### The first n numbers without consecutive equal binary digits

The sequence contains the decimal representation of the binary numbers of the form: 10101..., where the n-th term has n bits. The sequence is probably easiest to ...
2k views

### Find the Missing Numbers in the Fibonacci Sequence Mod K

Inspired by this Math.SE question. Background The Fibonacci Sequence (called F) is the sequence, starting 0, 1 such that each ...
2k views

### Rotation summation

Take a square matrix containing positive integers as input, and calculate the "rotated sum" of the matrix. Rotated sum: Take the sum of the original matrix and the same matrix rotated 90, 180 and ...
740 views

### Are the numbers amicable?

Two numbers are considered amicable if the proper divisor sum of the first is the same as the second number, the second number's proper divisor sum is equal to the first number, and the first and ...
2k views

### Write numbers as a difference of Nth powers

Challenge There are many numbers which can be expressed as the difference of two squares, or as the difference of two cubes, or maybe even higher powers. Talking about squares, there are various ways ...
1k views

### Finding Lonely Primes

Lonely primes (as I call them) are primes, where given a number grid with width w ≥ 3, are primes which do not have any other primes adjacent to them orthogonally ...
3k views

### Square Triangles

A positive integer x is a square triangle number iff there are two different positive integers, y and z, which are smaller than x such that all of the sums x + y x + z y + z are perfect squares. ...
5k views

### Compare two numbers given as strings

I have a problem at work. I need to compare two numbers that come as strings from two different databases. The numbers may come with leading zeroes and/or leading/trailing spaces. So I may have ...
933 views

### Encrypted In Numbers!

The Problem: Two enemy secret agents have devised a wonderful (for you) method of communication! Here’s how the encryption process works: 1) Take the ascii equivalents of each letter. (No spaces, ...