Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [number]

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

14
votes
14answers
745 views

Recursively concatenated cumulative sums of [N] with M iterations

Take two positive integers N and M and create the concatenated cumulative sums of [N], with <...
4
votes
3answers
146 views

Make a list continuous! [duplicate]

Take an input list L containing positive integers, and insert the least amount of integers into the sequence, so that you make it a continuous one. Example: ...
14
votes
19answers
2k views

A Euro-iginal Sequence

Given a positive integer n output the n-th number of the euro-iginal sequence. Calculating the Sequence This sequence is equal to OEIS A242491. A number is part of said sequence if the number can ...
14
votes
18answers
2k views

Prime Factoral Roots

Inspired by digital roots, the prime factoral root of a number is the number that emerges when you take the prime factors of a number, add them together, and repeat the process on the resulting number,...
15
votes
20answers
3k views

Narcissistic array elements

Definition Narcissistic 1 integers of an array think they are better than their neighbours, because they are strictly higher than their arithmetic mean. Neighbours are defined as follows: If the ...
6
votes
9answers
2k views

Back to the Basics of Math

Introduction: We all know these three basic arithmetic math tables I assume. ...
8
votes
6answers
728 views

90% fail this challenge?

I guess I'm not the only one who have seen this kind of image on Facebook (and other sites). The picture above was posted 16 days ago, and has accumulated 51 k comments. Some answers: 0, 4, 8, 48, ...
29
votes
48answers
9k views

How many Wazirs can be placed on an N×N Chessboard?

Suppose a new fairy chess piece named the Wazir is introduced to chess. Wazirs can move from a position (x, y) to:  (x+1, y)  (x, y+1)  (x-1, y)  (x, y-1) That is, they move orthogonally like the ...
0
votes
3answers
111 views

Prime Factorial [duplicate]

For the purposes of this question, the prime factorial of a number n is the result of multiplying all prime numbers smaller than n, and then multiplying the result by n. Your Task: Write a program ...
9
votes
14answers
970 views

Increasing, decreasing, none or all?

Take two inputs, a non-empty vector/list containing digits 1 and 2 and a string (no, you may not take ...
50
votes
42answers
3k views

Illustrate the Least Common Multiple

Given two positive integers, A and B, illustrate their least common multiple by outputting two lines of dashes (-) with length LCM(A, B) after replacing every Ath ...
22
votes
10answers
3k views

Generate Numpad-Friendly Numbers

Inspired by Generate Keyboard Friendly Numbers. Background Many number pads have the following layout: 789 456 123     0     We define a number's ...
40
votes
48answers
7k views

Am I an insignificant array?

An insignificant array is an array of positive integers, where the absolute differences between consecutive elements are all smaller than or equal to 1. For example, the following array is ...
15
votes
27answers
1k views

Pandigital Doubling

Inspired by this CMC Given a positive integer greater than 0, perform the following operation on it: If all ten single digits (1234567890) are in the number at ...
-5
votes
33answers
782 views

Is it a completely even number?

A completely even number is a positive even integer whose divisors (not including 1) are all even. Some completely even numbers are 2 (divisors: 2, 1), 4 (divisors: 4, 2, 1), 16 (divisors: 16, 8, 4, ...
18
votes
18answers
1k views

Reverse Maths Cycles

Inspired by this In the linked challenge, we are asked to apply addition to the elements of the original and the reverse of the input array. In this challenge, we are going to make it slightly more ...
15
votes
11answers
1k views

How many Lynch-Bell numbers are there?

Challenge Given an integer, n, as input where 36 >= n >= 2, output how many Lynch-Bell numbers there are in base ...
14
votes
29answers
3k views

Weird grading system

Weirdo Incorporates have a weird way of grading their staffs by the number of days they were present in the office: ...
5
votes
4answers
233 views

Implement the Fibonacci sequence… Shifted to the right [duplicate]

Background We all know the famous Fibonacci sequence, where each term is the sum of the previous two, with the first term being 0 and the second one being ...
15
votes
25answers
2k views

Max power of 2 such that 2^m divides n. (The ruler sequence) [duplicate]

Input: A positive integer N. Challenge: Suppose you have a list of integers n = 1, 2 ... N. Output a list of integers, where each number is the maximum power of 2, m, such that 2^m divides each ...
28
votes
6answers
2k views

Help! My calculator malfunctions!

Introduction My calculator is behaving weird. Sometimes when I type in an 8 it displays a 2. And sometimes when I type in a <...
19
votes
27answers
2k views

Calculate the area of a regular polygon

Given an integer, n, where 3 <= n < 2^32, calculate the area of a regular n-gon with ...
14
votes
14answers
2k views

Generate strong primes [duplicate]

In number theory, a strong prime is a prime number that is greater than the arithmetic mean of the nearest prime above and below (in other words, it's closer to the following than to the preceding ...
6
votes
17answers
958 views

Shifting digits

Given a string representing a number and the base that number is in, shift each positional value upward, wrapping back to zero if the value cannot increase. You will never be provided invalid input, ...
8
votes
16answers
1k views

First spiral, then diagonal

Given a positive input number n, construct a spiral of numbers from 1 to n^2, with ...
19
votes
43answers
3k views

Get the best of two Arrays

You will be given two arrays of floating-point numbers. Your task is to pair the corresponding elements of the two arrays, and get the maximum of each pair. However, if the two corresponding elements ...
7
votes
1answer
300 views

Playing Darts: become an amateur with the most efficient prioritizing

Introduction: I think most people will know how darts work. But since some might not, here are the rules of playing Darts in a nutshell: Amount of players: 2 Starting points: 501 Goal: Get your ...
22
votes
22answers
2k views

Modular multiplicative inverse

Your task is to given two integer numbers, a and b calculate the modular multiplicative inverse of a modulo b, if it exists. ...
16
votes
11answers
793 views

Sequence Without Sevens [duplicate]

This challenge is based on a drinking game. I advise against alcohol consumption while programming. In this game, the players count up in turns: the first player says ...
15
votes
95answers
6k views

Turn an integer n into a list containing it n times

Given an integer n as input, return a list containing n, repeated n times. For example, the ...
34
votes
35answers
2k views

Undo a Range of Numbers

It is fairly simple to, given a number n, create a range from 0 to n-1. In fact, many ...
5
votes
2answers
112 views

Total Factorization [duplicate]

The challenge Given positive integer input n (n>1), calculate the array of unique factorizations of ...
20
votes
14answers
3k views

How many states do I border?

When I was younger, I had a big map of the US tacked up on my wall across from my bed. When I was bored, I would stare at that map and think about stuff. Stuff like the four-color-theorem, or which ...
15
votes
15answers
3k views

Divisible by 1000003? Easy, just multiply the last digit by 300001 and add!

Given a prime P greater than 10, your program or function must figure out its divisibility rule ...
4
votes
2answers
183 views

Codegolf the sequence of distance-3 Hamming Codewords (A075926)

Codegolf the hamming code (with distance equals 3)! The sequence looks like this: 0, 7, 25, 30, 42, 45, 51, 52, 75, 76, 82, 85, 97, 102, 120, 127, 385, 390, 408, 415, 427, 428, 434, 437, 458, 461, ...
18
votes
16answers
2k views

It's a Bit of a Stretch․․․

Input: We take two inputs: An input b with two distinct values: Left and Right.† And a ...
19
votes
8answers
684 views

Optimal path through a matrix

Given a matrix consisting of positive integers, output the path with the lowest sum when traversing from the upper left element to the bottom right. You may move vertically, horizontally and ...
19
votes
12answers
1k views

Real base conversion

We've had a few challenges for base conversion, but all of them seem to apply to integer values. Let's do it with real numbers! The challenge Inputs: A real positive number x, expressed in base 10. ...
42
votes
5answers
6k views

Golf a number bigger than TREE(3)

The function TREE(k) gives the length of the longest sequence of trees T1, T2, ... where each vertex is labelled with one of k colours, the tree Ti has at most i vertices, and no tree is a minor of ...
21
votes
18answers
2k views

Round Me, Help Me

Given an input n, your program or function must output the smallest positive integer k such that ...
15
votes
8answers
1k views

Generate unseen numbers

Let us say a substring is any continuous section of an original string. For example cat is a substring of concatenate. We will ...
19
votes
21answers
3k views

Fold the integer to save space!

The crazy mathematician owns a wide collection of numbers, and therefore the space he has left is quite limited. To save some, he must fold his integers, but unfortunately he is really lazy. Your task,...
29
votes
25answers
2k views

Palindromic numbers with a binary twist

Warning : this is NOT a "hey, let's draw a cake in ASCII-art" challenge! Please keep reading ;) Some time ago it was my birthday, I'm 33 now. So there is this awkward social tradition consisting in ...
-5
votes
4answers
155 views

Binary Magic Cards [closed]

There's a cool magic trick that works using the power of binary. The effect of the trick is as follows: An audience member chooses some natural number in the range of ...
30
votes
10answers
2k views

Encode an integer

Given positive integer n > 2. We convert it to an array as follows: If it is equal to 2 return an empty array Otherwise ...
15
votes
24answers
1k views

Filter out the pseudo-elements!

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 ...
31
votes
33answers
3k views

Divisibility Streak

We can define the Divisibility Streak k of a number n by finding the smallest non-negative integer ...
34
votes
27answers
3k views

Mix pi and e to make pie!

Everybody knows pi the mathematical constant, the ratio of a circle's circumference to its diameter. 3.14159265358979323846264338327950288419716939937510... You ...
20
votes
29answers
1k views

Running second maximum of a list

Given a list of integers, your task is to output the second largest value in the first k elements, for each k between 2 and the length of the input list. In other words, output the second largest ...
12
votes
4answers
417 views

Return of the Hydra Slayer

Its been a while since you killed that hydra, you basked in the glory for years, but now people are calling you washed up, a has been. Well its time you prove them wrong, you've heard the whereabouts ...