This challenge is intended to be solved by using, manipulating, accepting as input, or outputting numeric values.
-2
votes
0answers
353 views
A Most Excellent Code Golf Adventure
You dudes, the Most Excellent Adventure is a home brew roleplaying game system based on the Bill & Ted Films, plays gnarly air guitar riff.
In this game system, when you draw from your dice pool ...
9
votes
35answers
4k views
Return the flipped version of a number
Given a one digit number, return the number "flipped". Imagine it is a seven-segment display, so 2 would be:
And when flipped horizontally it would make:
Therefore when 2 is entered, the ...
54
votes
41answers
9k views
Largest number in ten bytes of code
Your goal is to print (to the standard output) the largest number possible, using just ten characters of code.
You may use any features of your language, except built-in exponentiation functions.
...
2
votes
2answers
444 views
Saying a number in the shortest way
A string of digits (positive integer) can be converted to plain English in various ways. For instance, 115 can be read as "hundredfifteen", "oneonefive", "elevenfive", "twoonesfive". So question's ...
6
votes
21answers
1k views
Missing Odd Numbers
A set of whole numbers (0-) will be given separated by a space. Some numbers will be missing between certain numbers in the set. Your job is to find the missing odd numbers between them.
Conditions
...
19
votes
12answers
3k views
Print the Golden Ratio
This was fun! However with only three digits, the fun was over way too soon. This challenge is similar, but we'll keep the fun going.
The Challenge
Print as many digits of the Golden Ratio φ as ...
4
votes
3answers
229 views
Pack sequences of non-negative integers
Let N be the set of nonnegative integers, i.e. {0, 1, 2, 3, ...}.
Let c0(N) be the set of all infinite sequences in N that converge to 0, i.e. { (xn) ∈ NN | xn → 0 as n → ∞}.
...
3
votes
3answers
294 views
Find the next subpermutation of base-64 digits
Permutations of a set have a natural order called lexicographic order in which two permutations are compared by comparing the first position at which they differ. For the purposes of this question ...
14
votes
5answers
1k views
Closest fraction
Task:
Your program is given a proper, positive simple fraction in the format <numerator>/<denominator>.
For this input, it must find two fractions.
A fraction that is less than the ...
11
votes
5answers
494 views
Shortest representation of an Underload number
Flavour text
The stack-based esolang Underload has some interesting ties to functional programming. One of them is its treatment of the numerical datatype—like the lambda calculus, you ...
5
votes
6answers
394 views
Generate random PESEL number
From Wikipedia:
PESEL is the
national identification number used in Poland since 1979. It always
has 11 digits, identifies just one person and cannot be changed to
another one.
It has ...
15
votes
1answer
644 views
Android Lock Screen
Intro
You are sitting in a board room at the end of a long table. You look around and see Tim Cook, the Apple Board of Directors, the ghost of Steve Jobs, and Jack Donaghy. Apple has called this ...
-3
votes
5answers
223 views
Unique number generator [closed]
CHALLENGE:
Write a pattern formula that outputs a 8 digit number, unique to a given input number.
For Example:
12982311 for 1 (this means that 12982311 is always returned for number 1)
23919076 ...
83
votes
107answers
17k views
4, 8, 15, 16, 23, 42
4, 8, 15, 16, 23, 42
Write a program that outputs this sequence of numbers infinitely. However, The Numbers must not appear in your source code anywhere.
The following is not a valid Java program to ...
36
votes
14answers
9k views
Longest code to add two numbers [closed]
Task:
I know we can all add two numbers the short way, using +. Your task is to create the longest code you can to add two input numbers.
Rules:
All of the code must be on topic (don't fill it ...
2
votes
15answers
489 views
Random number generation, without built-in random number generation libraries [duplicate]
Task:
Make a random number generator. The catch is that you can't use any built-in randomness functions. Your random numbers must be anything between 0 and 100, though they do not have to be floating ...
11
votes
23answers
931 views
Calculate all the squares up to x using only addition and subtraction
The goal is to calculate all the squares up to x with addition and subtraction.
Rules:
The code must be a function which takes the total number of squares to generate, and returns an array ...
20
votes
31answers
3k views
Letters in phone numbers
Problem:
You are making a new phone where people can type in specialized phone numbers, for example, 1-800-program, and they would be converted automatically to a usable phone number, like ...
7
votes
13answers
640 views
Convert from base 10 to base 2 without built-in base conversions
Background:
You have been given an assignment to convert base 10 numbers to base 2 without using any premade base conversion functions. You can't use any imported libraries either.
Problem:
...
-2
votes
9answers
595 views
Build a numerical library without using any primitive data type
The task is to build a numerical library for working with arbitrarily large integers that supports the following operations:
addition
subtraction
multiplication
division
modulo operation
However, ...
0
votes
7answers
193 views
Find all problems that equal an integer [duplicate]
In this challenge, your job is to write a program that allows a user to enter an integer. Then, the program must find all the possible ways of multiplying two numbers to get the user's integer.
Rules:
...
6
votes
5answers
248 views
Convert radicals to mixed & entire radicals and to real numbers
Challenge
The goal of this challenge is to take a radical and convert it to a reduced and entire radical, and a real number. You do not have to convert it to all 3, however, you will get bonus points ...
63
votes
60answers
12k views
Largest Number Printable
Before opening this I've done a little search and I've found there is a similar question, but it has been closed because it was ambiguous. I hope this won't.
So, your goal is to write a program that ...
3
votes
3answers
374 views
Solve Any Motion Physics Problem (Equations Supplied)
Physics Challenge
This program should be able to solve for ANY two of the following variables the user wants to solve.
s (displacement)
v (velocity)
u (initial velocity)
a (acceleration)
t (time)
...
12
votes
5answers
245 views
Hardy–Ramanujan number generalization
1729, known as the Hardy–Ramanujan number, is the smallest positive integer that can be expressed as the sum of two cubes of positive integers in two ways (12^3+1^3=10^3+9^3=1729). Given an integer n ...
3
votes
2answers
114 views
Convert integer to balanced dozenal
Create a function which takes an integer and returns an array of integers representing the number in balanced base twelve. Specifically, the representation should follow these rules regarding 6 & ...
5
votes
4answers
396 views
Cardinal Numbers in Standard American English
Let n be any integer between 1 and 999,999 inclusive. Your challenge is to write a complete program which using stdin or command-line arguments takes in n and outputs the number of times the letter ...
-1
votes
9answers
248 views
Check whether there are more even than odd numbers on any given nested list [closed]
Take any type of nested list(s) containing numbers. Check for how many even/odd numbers are within and output even, same or odd (-1, 0, 1) in some way.
Example:
[[1,2,3],4,[5,6],[[7,8], 9]] => 5 ...
14
votes
28answers
1k views
Even or odd: three player
It's a three players game, play with one hand.
At same time, each player show his hand with 0 to 5 fingers extended.
If all player show same kind of (even or odd) number, there is no winner. But ...
4
votes
6answers
370 views
Test if given number is a Reverse Keith?
Slighty inspired by my previous challenge regarding Keith Numbers I want to propose a challenge to create a function that takes an integer and gives back a true or false depending on the number is a ...
7
votes
7answers
681 views
Enumerate all number that are palindromic in at least two of base 2, 8, 10, 16 or 64
Multi palindromic numbers
Finding all number for which at least two** representation are palindromic, with more than one** characters, if in decimal, octal, hexadecimal, binary or in base64.
** have ...
4
votes
4answers
725 views
Make a 24 Game Solver
The 24 Game is a card game. On each cards are four interger numbers. For a player, the goal is to use Addition, Subtraction, Multiplication and Division to end up with 24.
The goal of this code ...
8
votes
14answers
699 views
Generate a grid of sums
Challenge
Generate a 7 by 7 grid, filled with random numbers. However, every other row and column, you must use the sum of the surrounding cells. Here's a small example with a 3 by 3 grid:
2 2 2
2 ...
0
votes
5answers
263 views
highest common factor-fewest iterations
Find the highest common factor of two(positive integer) input numbers (not greater than 5000) in the minimum number of iterations.
If you use a loop, it should increment a counter, starting at 0 for ...
3
votes
5answers
295 views
Generate cyclic numbers in decimal
The formula on the wiki article for cyclic numbers can be used to generate cyclic numbers in any base. Using this formula, or any other appropriate formula, compute the first ten cyclic numbers in ...
18
votes
10answers
2k views
Flipping pancakes
In pancake sorting the only allowed operation is to reverse the elements of some prefix of the sequence.
Or, think of a stack of pancakes: We insert a spatula somewhere in the stack and flip all the ...
25
votes
30answers
3k views
Define a function f such that f(f(n)) = -n for all non-zero integers n
This challenge was inspired by a programming blog I frequent. Please see the original post here: A Programming Puzzle
Challenge
Define a function f:Q->Q such that f(f(n)) = -n for all ...
8
votes
14answers
909 views
FIBonacci sequence
For this code golf, you will receive an input of a fibonacci sequence, that is, a normal Fibonacci sequence but with one number incorrect. See, the sequence is fibbing! Get it? :D
Your job is to find ...
16
votes
8answers
796 views
Save money with price rounding
In Canada, the penny is no longer circulated. Cash payments are rounded to the nearest 5 cents.
Money can be saved by splitting purchases. For example, two $1.02 items cost $2.04 which rounds up to ...
15
votes
11answers
1k views
Convert to and from the factorial number system
The Factorial Number System, also called factoradic, is a mixed radix numeral system. The factorials determine the place value of a number.
In this system, the right most digit can be either 0 or 1, ...
3
votes
7answers
772 views
Compute the number of ways how you can express a number as a sum
For a given natural number n, compute the number of ways how one can express n as a sum of positive natural numbers. For example, for n = 1 there is just one way. For n = 4 we have 5 possible ways:
1 ...
18
votes
29answers
2k views
Print an arch of ascending / descending numbers
I figured an "arch" was the best way to describe this pattern of numbers:
1234567887654321
1234567 7654321
123456 654321
12345 54321
1234 4321
123 321
12 21
1 ...
-4
votes
6answers
292 views
Return the number of digits in any given number [closed]
Objective
Given any terminating, rational number, return the number of digits the number contains. Do not count zeros if they're the last digits.
Examples
0 returns 1
-1 returns 1
6.23 returns 3
...
16
votes
13answers
1k views
Convert number to a base where its representation has most “4”s
Inspired by this. There is a number, given as either integer, string or array of digits (your choice). Find the base in which the representation of the number will have most "4"s and return that base.
...
11
votes
17answers
1k views
Test if given number if a Keith number
Since Fibonacci numbers and sequences seems like a popular subject for code golf I thought that it might be a fun challenge to code golf with Keith numbers.
So I propose a challenge that is to create ...
3
votes
4answers
342 views
Convert the Binary Champernowne Constant to Decimal
The Champernowne constant is a transcendental decimal number whose digits are the concatination of all positive integers.
C10 = 0.12345678910111213141516...10
The binary version of this is
C2 = ...
10
votes
7answers
1k views
Find the Pisano Period of a number
Input: An integer 0 < n < 2^30, taken from stdin.
Output: The Pisano period of n (the length of the cycle of the Fibonacci sequence mod n)
Input is smaller than 2^30 so that intermediate ...
13
votes
5answers
626 views
Score a game of Bowling
Your task is to sum up and output one player's score in a game of 10-pin bowling after up to 21 rolls.
The rolls are represented as space separated integers on a single line of input.
Each integer ...
7
votes
6answers
322 views
Return each number from a group of numbers
The challenge
The program must return all numbers included into a group (comma and hyphen separated sequence) of numbers.
Rules
s is the sequence string;
all numbers included in s are positive;
...
7
votes
6answers
589 views
Score a game of Yahtzee
For each of the 13 rows of a Yahtzee scoresheet you are given (from stdin)
a space separated list of 5 numbers (dice).
Your task is to calculate the score for each line and output the Grand Total of ...