This challenge is intended to be solved by using, manipulating, accepting as input, or outputting numeric values.
0
votes
0answers
45 views
find the period of one division [duplicate]
We have a division a/b where a is one not negative integer, and b is one positive integer. Write the complete program, or a function that from the input a and b, return the period of the division a/b. ...
10
votes
12answers
301 views
Given a string, Return its Cumulative Delta [duplicate]
Related
Explanation
Given a string such as DCBA, convert it to ASCII ordinals, such as 68 67 66 65. Then, take the differences between each value, eg 67 - 68 = -1, 66 - 67 = -1... giving -1 -1 -1 ...
42
votes
9answers
2k views
Determine if a coin system is Canonical
The Cashier's Algorithm is an algorithm for making change in the minimal number of coins that works quite well for most currency systems. However like most greedy algorithms it is not without its ...
11
votes
19answers
1k views
Division of not so little numbers
Write a program or function that takes in positive integers a, b and c, and prints or returns a/b to c decimal places, using the operations +-*/% [add, subtract, multiply, divide, modulate] on the ...
17
votes
15answers
1k views
Terminating, Purely Periodic, or Eventually Periodic?
Introduction
A decimal is terminating if it has a finite number of decimal digits. For example, 0.4 (2/5) is terminating because it has one decimal digit.
A decimal is purely periodic if it has an ...
10
votes
9answers
768 views
Super Folding Numbers
We have already defined a folding number here.
But now we are going to define a Super Folding Number. A Super Folding number is a number that if folded enough times it will eventually reach one less ...
-4
votes
1answer
85 views
Sum evens between 0 and N [duplicate]
Challenge
Given an integer n, calculate the sum of all even numbers between 0 and n
Examples
n output
-------------
100 2550
255 16256
1000 2502500
Shortest code in bytes wins
35
votes
23answers
2k views
Folding Numbers
Given a number determine if it is a folding number.
A folding number is a number such that if you take it binary representation and "fold" it in half, That is take the result of XNOR multiplication ...
3
votes
16answers
265 views
How much will this cost?
Given N items (0 < N <= 50) with prices (which are always integers) P0 ... PN-1 and given amounts of each item A0 ... AN-1, determine how much the total cost will be.
Examples
N: 2
P0: 2
P1: 3
...
18
votes
19answers
758 views
Natural construction
The natural numbers including 0 are formally defined as sets, in the following way:
Number 0 is defined as the empty set, {}
For n ≥ 0, number n+1 is defined as n ∪ {n}.
As a consequence, n = {0, 1, ...
18
votes
17answers
1k views
Multiple-Key Sorting
Given a list of indices and zero or more lists of integers, output the lists of integers, sorted in ascending order, with the key priority from the first input.
Example
Let the keys input be [1, 0, ...
-1
votes
0answers
59 views
Output the Sets [duplicate]
Challenge
Given the symbol for a special set, output every number contained within that set.
Input
The input will be a single ASCII character: either P, N, Z or Q.
Output
Your output must be an ...
11
votes
37answers
2k views
Output a string's cumulative slope
Challenge
Given a string such as Hello World!, break it down into its character values: 72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33.
Then calculate the difference between each ...
32
votes
35answers
2k views
Is it a balanced number?
A number is balanced if the sum of the digits on each half of the number is equal, so: 1 4 2 3 is balanced because 1+4 = 2+3, so is: 4 2 6 1 5 because 4+2=1+5. Note that the middle digit is not ...
22
votes
16answers
1k views
Create a pyramidal matrix
A pyramidal matrix is a square matrix where all numbers increase or decrease from the center point, like the two matrices below:
1 1 1 1 1
1 2 2 2 1
1 2 3 2 1
1 2 2 2 1
1 1 1 1 1
...