# Questions tagged [number]

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

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

### Naismith's rule

Naismith's rule helps to work out the length of time needed for a walk or hike, given the distance and ascent. Given a non-empty list of the altitude at points evenly spaced along a path and the ...
5k views

### Is the bus load legal?

I was in the bus today, and noticed this sign: ...
15k views

### Is this number evil?

Introduction In number theory, a number is considered evil if there are an even number of 1's in its binary representation. In today's challenge, you will be identifying whether or not a given number ...
2k views

### Mixed Fraction Equality

In elementary school, children learn about proper fractions, where the numerator is less than the denominator, and thus the value of the fraction is less than one. Later, they are taught about ...
3k views

### Count the lucky tickets within the given range

In Russia we have something like a tradition: we like to look for lucky tickets. Here's what a regular ticket looks like: As you can see, the ticket has a six-digit number. A six-digit number is ...
5k views

### Sort odd numbers first

Rearrange a given list such that all the odd numbers appear before all the even numbers. Besides for this requirement, the output list may be in any order. The input will only contain integers, but ...
1k views

### Find The Sum of the First n Bouncy Numbers

Terminology An increasing number is one where each digit is greater than or equal to all the digits to the left of it (ex. 12239) A decreasing number is one where each digit is less than or equal to ...
2k views

### In for a bumpy ride

Your task is to write a computer program or function that takes a list of positive integers of at least length 2 and determines if they are a "zigzag". A sequence is a zigzag if and only if the ...
741 views

### Find the minimum cost matching between arrays of integers

Consider two sorted arrays of integers $X$ and $Y$ of size $m$ and $n$ respectively with $m < n$. For example $X = (1,4)$, $Y = (2,10,11)$. We say that a matching is some way of ...
8k views

### Implement Malbolge's “crazy” operator

One of many unique features of the Malbolge programming language is its highly unintuitive OP operator, referred to only as "op" in the documentation and source ...
734 views

1k views

### Find the Number With the Highest Sum of Neighbors

The Challenge Given a grid of numbers (10 <= N <= 99) Return number with the highest sum of the four numbers adjacent to it; that is the numbers above, below, right, and left of the number, but ...
2k views

### Indexing Cha-Cha Slide

Introduction: Although I originally had a Dutch song in my head, where the lyrics are: "Doe 'n stapje naar voren, en 'n stapje terug" (which translated to "Take a little step forward, and a little ...
2k views

### Integers sorted by their digital roots

The digital root (also repeated digital sum) of a positive integer is the (single digit) value obtained by an iterative process of summing digits, on each iteration using the result from the previous ...
75 views

### Finding Fastest Frog's Frolicks [duplicate]

A frog sits on a lily pad wishing it were on the other side of the river. There are some lily pads of varying sizes between the frog and the other side of the river. Larger lily pads allow the frog ...
2k views

### Upper or Lower Wythoff?

First, let's talk about Beatty sequences. Given a positive irrational number r, we can construct an infinite sequence by multiplying the positive integers to r in order and taking the floor of each ...
336 views

### Pair and sort from two integer lists

You are given two arbitrary integer lists, e.g. [-10, 99, -6, 43], [100, 32, 44]. You are to pick one integer from each list and ...
2k views

### Fun with strings and numbers

Here's a programming puzzle for you: Given a list of pairs of strings and corresponding numbers, for example, [[A,37],[B,27],[C,21],[D,11],[E,10],[F,9],[G,3],[H,2]]...
896 views

### Insulate the Window Glass and Foil of your house

Introduction: The best options for the glass of your house will: 1. Let through as little heat as possible in both directions (insulation-value Ug). (2. Let ...
201 views

### Equal Pair sum of 10? [duplicate]

Challenge : Check : if there are exactly n exclamation marks ! between every pair and ...
210 views

### Math Operations with Strings [duplicate]

Challenge : Inspired by Alphabet Position Finder Given an string and one of two possible mathematical operator (+ or -) as input,...
3k views

### count ones in range

Challenge : Count the number of ones 1 in the binary representation of all number between a range. Input : Two non-decimal positive integers Output : The sum of ...
996 views

### Reduce using the lowest value

The challenge Create a function which takes an array of numbers and subtract from each element the lowest element in the array that has not yet been subtracted from another. After using the lowest ...
3k views

### Alphabet Position Finder

Inspired by the Codewars Kata. Your goal is to take an input string such as this one: "'Twas a dark and stormy night..." and return a string containing the ...
3k views

### X Steps Forward, 1 Step Back

Here the first 100 numbers of an easy sequence: ...
191 views

### Mathematical parser [duplicate]

Challenge : Given a string representing a mathematical expression return the result Input : A string representing a mathematical expression : ...
2k views

### Function clipboard: paste

This challenge is related to some of the MATL language's features, as part of the May 2018 Language of the Month event. Associated challenge: Function clipboard: copy. Introduction MATL's function ...
793 views

### Determine Season

Introduction: In the northern hemisphere (i.e. Europe, North America, etc.), the seasons are divided like this: - Spring: March, April, May - Summer: June, July, August - Autumn: September, October, ...
1k views

### Function clipboard: copy

This challenge is related to some of the MATL language's features, as part of the May 2018 Language of the Month event. Associated challenge: Function clipboard: paste. Introduction MATL has several ...
3k views

### Bringing a pair of integers to equality

This was inspired by a math problem I saw somewhere on the internet but do not remember where (UPDATE: The original problem was found on the math riddles subreddit with a proof provided that it is ...
2k views

This challenge is related to some of the MATL language's features, as part of the May 2018 Language of the Month event. Introduction In MATL, many two-input functions work element-wise with ...
2k views

### Is this a staircase number?

Challenge : Check if the given number forms a number staircase or not Input : A integer (greater than 0 and not decimal). NOTE : You can take input as string , ...
852 views

### Return the highest possible placement value based on the input

Introduction The challenge itself was something I came across and had to try and figure out for a personal of project of mine. I ended up branching out and asking family members if they could provide ...
1k views

### Golf me the Schlosberg Numbers

Schlosberg Numbers In issue 5 of Mathematical Reflections, Dorin Andrica proposed the problem of characterising the positive integers n such that is an even integer. Eight people submitted ...
332 views

### Find out my number neighbors

The input consists of i rows with neighbors information. Each ith row contains 4 values, representing the neighbor of i to the North, East, South and West directions, respectively. So each value ...
2k views

### Simple Factorial Challenge [duplicate]

In light of today's date... A factorial of a number n, is the product of all the numbers from 1 to n inclusive. The Challenge Given an integer n where 0 <= n <= 420, find the sum of the digits ...
500 views

### Bots playing a counting game

Introduction A childhood game designed to help children learn to count in french in Canadian schools is played as follows: Students go around the room counting up to 11 A number greater than 11 ...
3k views

### Integer logarithms

Given integers N , P > 1 , find the largest integer M such that P ^ M ≤ N. I/O: Input ...
5k views

### Scrabble scorer

Challenge: Take a string of upper or lower case letters as input (optional), and calculate the score that string would get in a game of Scrabble in English. Rules: The score of each letter is as ...
2k views

### Fruit bagging factory

Your mission is to build an algorithm (program or function) that can optimize packing fruit from a conveyor belt into bags to be sent off to retailers, optimizing for a largest number of bags. Each ...
2k 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 ...
804 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 ...