Skip to main content

Questions tagged [integer]

For challenges involving the manipulation of integers.

18 votes
8 answers
1k views

Introduction: When saying numbers out loud, the order is slightly different in Dutch than in English. For a number like \$1234\$: in English you'd say: one thousand, two hundred and thirty-four in ...
Kevin Cruijssen's user avatar
20 votes
31 answers
2k views

Let us define the operation of rebasing a number as writing out its digits in decimal form, then interpreting them in the smallest base N possible (...
SquareFinder's user avatar
10 votes
2 answers
369 views

Task: Your task is make a program to check if there exists integers \$a \ge 2, b \ge 2\$ such that \$a^b=i\$ where \$i\$ is the input integer at least 2. The catch is that your program must return a ...
Fmbalbuena's user avatar
  • 5,085
18 votes
30 answers
2k views

Given X>0, return the smallest Y>=0 such that X+Y is a palindrome. Code golf. Tests: 5 => 0 14 => 8 200 => 2 819 => 9 1100 => 11 1122 => 99
Steve Bennett's user avatar
2 votes
13 answers
678 views

Task: Write a code golf program that, given two positive integers n and m, returns a list of the distances between consecutive prime numbers in the range [n, m] ...
JuanCa's user avatar
  • 361
3 votes
1 answer
299 views

Challenge We define a Minsky machine as a program made of the following two instructions: +X which increments the register X and continues to the next instruction -Xn which simply continues if X is ...
malediscord kitten's user avatar
-5 votes
4 answers
205 views

Determine if a rational number is also an integer, without any form of dividing. The input should be any pair of numerator and denominator. Don't forget to consider negative numbers, and division by ...
Gabriel Tellez's user avatar
16 votes
21 answers
2k views

ZigZag encoding is a method of encoding signed integers to unsigned integers. Non-negative integers are multiplied by two. Negative integers are equal to their absolute values multiplied by two, minus ...
Jordan's user avatar
  • 11.9k

15 30 50 per page
1
2 3 4 5
31