# number's questions - English 1answer

893 number questions.

### 75 You're on a 8 day streak!

23 answers, 5.341 views code-golf number
Duolingo, the language learning app, has a lot of things going for it, but there is one major issue that drives me crazy. It tells me how many days in a row I've used the app with a message like You'...

### 72 Is this relationship creepy?

64 answers, 13.547 views code-golf number decision-problem
According to this XKCD comic, there is a formula to determine whether or not the age gap in a relationship is "creepy". This formula is defined as: (Age/2) + 7 being the minimum age of people you ...

### 30 Is this number a factorial?

65 answers, 4.877 views code-golf math number decision-problem
The Task Given a natural number as input, your task is to output a truthy or falsey value based on whether the input is a factorial of any natural number. You can assume that the input number will ...

### 20 Function clipboard: paste

13 answers, 1.566 views code-golf number array-manipulation
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 ...

### 17 Multiply two numbers

111 answers, 5.379 views code-golf math number
Input: Two decimal integers. These can be given to the code in standard input, as arguments to the program or function, or as a list. Output: Their product, as a decimal integer. For example, the ...

### 2 The fastest square root calculator

5 answers, 869 views number arithmetic fastest-code integer
Write a program which outputs the square root of a given number in the shortest time possible. Rules It may not use any builtins or powering with non-integers. Input format as a function argument ...

### 25 Golf a Custom Fibonacci Sequence

42 answers, 3.136 views code-golf number sequence fibonacci
The Fibonacci sequence is a fairly well known thing around here. Heck, it even has its own tag. However, for all that, we sure like to stick to our roots of 1, 1, ... (or is it 0, 1, ...? We may never ...

### 3 Mathematical parser [duplicate]

0 answers, 161 views code-golf math number arithematic
Challenge : Given a string representing a mathematical expression return the result Input : A string representing a mathematical expression : '1 + 2 - 3 * (2/3 * 1)'. Output : The result after ...

### 16 Function clipboard: copy

12 answers, 1.359 views code-golf number
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 ...

### 27 Say What You See

21 answers, 1.228 views code-golf string number sequence counting
The "Look and say" or "Say what you see" sequence is a series of numbers where each describes the last. 1 11 (one one) 21 (two ones) 1211 (one two, one one) 111221 (one one, one two, two ones) 312211 ...

### -13 Divide one number by another

19 answers, 437 views code-golf number arithmetic
Challenge Given two numbers, output their quotient. In other words, integer divide one number by another. Both divisor/dividend will be under 10001. Division must be performed using integer division,...

### -25 Test if two numbers are equal

44 answers, 1.063 views code-golf number decision-problem
Challenge Input two integers. Integer I/O must be decimal. If the integers are equal, output a truthy value. Otherwise, output a falsy value. Clarifications You will never receive non-integer ...

### 15 Turn an integer n into a list containing it n times

95 answers, 5.793 views code-golf number array-manipulation integer
Given an integer n as input, return a list containing n, repeated n times. For example, the program would take 5 and turn it into [5,5,5,5,5]. The elements need to be integers, not strings. No built-...

### 23 Modular broadcasting

14 answers, 1.400 views code-golf number array-manipulation
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 ...

### 9 Integer logarithms

44 answers, 2.680 views code-golf math number arithmetic
Given integers N , P > 1 , find the largest integer M such that P ^ M ≤ N. I/O: Input is given as 2 integers N and P. The output will be the integer M. Examples: 4, 5 -> 0 33, 5 -> 2 40, ...

### 11 Determine Season

4 answers, 697 views code-golf number
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, ...

### 20 Fruit bagging factory

11 answers, 1.414 views number code-challenge sequence optimization
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 ...

### 52 Compute the Kolakoski sequence

37 answers, 5.660 views code-golf number 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 ...

### 12 Averages of Angles

7 answers, 867 views code-golf number arithmetic
Story, or why we are doing this. None. This exercise is completely pointless ... unless you are Stephen Hawking. The Challenge Given a list of angles, find the average of those angles. For example ...

### 7 Golf me the Schlosberg Numbers

22 answers, 1.015 views code-golf math number sequence
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 ...

### 24 Maximum run between identical elements

22 answers, 1.253 views code-golf number array-manipulation
This is a overhaul of this now deleted question by ar kang. If the OP of that question would like to reclaim this question or has a problem with me posting this I'd be happy to accommodate Given a ...

### -5 Given a number, program must return the alphabet letter correspondent

37 answers, 1.192 views code-golf number
The program Given a number, program must return the alphabet letter correspondent. Rules The challenge here is to make it as short as possible, everyone knows it is a very easy program to do. The ...

### 28 Generate Monday Numbers

33 answers, 3.998 views code-golf number sequence
Monday numbers, as defined by Gamow in this question over on Puzzling, are positive integers N with the following three properties: The decimal representation of N does not contain the digit 0 The ...

### 50 Bringing a pair of integers to equality

11 answers, 2.642 views code-golf math number number-theory
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 ...

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

53 answers, 731 views code-golf math number
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 ...

### 178 Is this number a prime?

Believe it or not, we do not yet have a code golf challenge for a simple primality test. While it may not be the most interesting challenge, particularly for "usual" languages, it can be nontrivial in ...

### 21 Equality in the sum of digits

16 answers, 836 views code-golf number sequence
Introduction Let's take the number 180. This is an interesting number because the sum of digits of this number is equal to: 1 + 8 + 0 = 9 And the squared version of this number, or: 180² = 32400 &...

### 53 Surrounded Countries

Countries own a series of territories on a 1D world. Each country is uniquely identified by a number. Ownership of the territories can be represented by a list as follows: 1 1 2 2 1 3 3 2 4 We ...

### 42 Make an Emergency Corridor

65 answers, 6.954 views code-golf ascii-art number
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 ...

### 67 Output the sign

141 answers, 6.443 views code-golf math number integer
Given a number N, output the sign of N: If N is positive, output 1 If N is negative, output -1 If N is 0, output 0 N will be an integer within the representable range of integers in your chosen ...

### 57 Sum of all integers from 1 to n

130 answers, 11.763 views code-golf math number
I'm honestly surprised that this hasn't been done already. If you can find an existing thread, by all means mark this as a duplicate or let me know. Input Your input is in the form of any positive ...

### 16 Finding Not-Quite-Prime Numbers

28 answers, 1.698 views code-golf number primes decision-problem
Your challenge, should you chose to accept it, is to code-golf a function that returns true or false (or some similar meaningful representation of yes and no) if a number meets the following criteria: ...

### 38 Outputting ordinal numbers (1st, 2nd, 3rd)

37 answers, 10.285 views code-golf string number
I would like to generate (as a return result of a function, or simply as the output of a program) the ordinal suffix of a positive integer concatenated to the number. Samples: 1st 2nd 3rd 4th ...

### 6 Range of numbers

12 answers, 791 views code-golf number
Came over a similar problem in a project I'm working on and found it quite hard to solve it without excesive use of if. I'm eager to see if anyone can come up with more elegant solutions to this, with ...

### 15 Filter out the pseudo-elements!

24 answers, 1.339 views code-golf number array-manipulation
We define the hyper-average of an array / list (of numbers) the arithmetic mean of the sums of its prefixes. For example, the hyper-average of the list [1, 4, -3, 10] is computed in the following ...

### 8 How long is my number: Restricted Version

34 answers, 1.312 views code-golf number integer
Find the original challenge here Challenge Given an integer, Z in the range -2^31 < Z < 2^31, output the number of digits in that number (in base 10). Rules You must not use any string ...

### 18 Sign change, loop and display with minimal padding

10 answers, 1.106 views code-golf string ascii-art number
Input: Two integers: one negative, one positive. Output: On the first line output lowest to highest. On the second line we've removed the highest and lowest numbers and sign-changed all individual ...

### 35 Print the nth prime that contains n

18 answers, 2.558 views code-golf string math number primes
This question will be a twist on finding the nth prime number. Challenge You must write a program that will take one input n, and output the nth prime number whose decimal representation contains ...

### 16 Is this a staircase number?

21 answers, 1.802 views code-golf math number decision-problem
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 , array of digits. Output : a truthy /...

### 20 Compare two numbers given as strings

56 answers, 5.031 views code-golf string number decision-problem parsing
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 "0001 "...

### 38 Increment an Array

Given a nonempty array of positive integers, "increment" it once as follows: If all the array elements are equal, append a 1 to the end of the array. For example: [1] -> [1, 1] [2] -> [2, 1] [...

### -5 Quartic Summation

45 answers, 791 views code-golf math number arithmetic
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) 14, 6 -> 39712 (14^4 + 6^4 = 39712) 0, 25 -> ...

### 11 Find out my number neighbors

2 answers, 266 views code-golf number array-manipulation
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 ...

### 22 Distance between two points in n-dimensional space

36 answers, 3.543 views code-golf number arithmetic geometry
Here is another simple one: The Challenge Given two points in an n-dimensional space, output the distance between them, also called the Euclidean distance. The coordinates will be rational numbers; ...

### 9 Bots playing a counting game

4 answers, 433 views code-golf number random
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 ...

### 37 Scrabble scorer

41 answers, 3.547 views code-golf string number game board-game
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 ...

### 33 Factorials and never ending cycles!

24 answers, 2.912 views code-golf math number sequence factorial
As you may know it, the factorial of a positive integer n is the product of all the positive integers which are equal or smaller to n. For instance : 6! = 6*5*4*3*2*1 = 720 0! = 1 We will now ...

### 6 Simple Factorial Challenge [duplicate]

27 answers, 1.356 views code-golf math number arithmetic number-theory
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 ...

### 18 Compare the averages of my lists

45 answers, 2.053 views code-golf number array-manipulation
Getting the average of a list (e.g [2,6,7]) Get the length of the list: [2,6,7] -> 3 Sum the numbers in the list: 2 + 6 + 7 = 15. Divide the sum by their count: 15 / 3 = 5. You should compare ...

### 16 Ordinal string check

17 answers, 684 views code-golf string number decision-problem
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 ...