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

learn more… | top users | synonyms

10
votes
4answers
266 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
338 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
542 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
203 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 ...
81
votes
106answers
16k 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 ...
34
votes
14answers
8k views

Longest code to add two numbers

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 ...
1
vote
15answers
444 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
911 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
613 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: ...
-3
votes
9answers
552 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, ...
-5
votes
13answers
240 views

Any language - output 1 To 100000 [closed]

A simple question, depends on what language you're using. TASK: Make a program, so it will display 1 to 100000. The output should look like this: 1 2 3 RULES: Choose ANY language - ...
0
votes
7answers
175 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
197 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 ...
62
votes
60answers
11k 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
333 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
232 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
112 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 & ...
7
votes
15answers
3k views

Please give me “Fibonacci sequence” the code [closed]

Help! I was a homework assignment, a program given something that is called the Fibonacci sequence to write. I do not know what it is. I wanted to read on Wikipedia, but it is too long. Please ...
5
votes
4answers
370 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
236 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
358 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
638 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
573 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
683 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
250 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
288 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 ...
22
votes
25answers
2k 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
891 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
789 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
736 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
246 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
334 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 = ...
9
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
564 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 ...
6
votes
6answers
297 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
566 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 ...
42
votes
36answers
4k views

Can you Golf Golf?

You are required to generate a random 18-hole golf course. Example output: [3 4 3 5 5 4 4 4 5 3 3 4 4 3 4 5 5 4] Rules: Your program must output a list of hole lengths for exactly 18 holes Each ...
4
votes
6answers
579 views

Generate a Kolakoski sequence

Definition1 A Kolakoski sequence is a self-describing infinite sequence {kn} of alternating blocks of 1's and 2's, given by the following rules: k0 = 1 kn = the length of the (n+1)'th ...
2
votes
9answers
447 views

Generate a valid sequence of numbers with specific rules

The challenge The program must return a valid sequence of numbers into some rules Rules x is the size of the sequence; x cannot be less than 4 or greater than 9 (Thanks David Carraher); Digits of ...
2
votes
3answers
341 views

Traverse all numbers with only one bit flip per step

You can count 0, 1, 2, 3, 4. But to get from 3 to 4 you have to change 3 bits at once. Given a number of bits, how can you go through all numbers once, but change at each step only 1! bit. Here is an ...
0
votes
18answers
585 views

Given a number, program must return the alphabet letter correspondent

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 ...
8
votes
9answers
536 views

Working Week Completion

I work a standard nine to five. Monday through Friday. I take a half hour for lunch from 12:30 to 13:00. Write me a program which, when run, calculates the percentage of the working week that I have ...
6
votes
9answers
960 views

Find the nth Fibonnaci Prime, in the shortest code

The challenge is rather simple: Take a positive whole number n as input. Output the nth Fibonacci prime number. Input can be as an parameter to a function (and the output will be the return ...