# Questions tagged [integer]

For challenges involving the manipulation of integers.

291 questions
Filter by
Sorted by
Tagged with
2k views

### I'm stepping down

You are given 4 positive integers: volume of the first container (v1), volume of the second container (v2), volume of the liquid ...
4k views

### Greater than less than greater than something fishy

Given a length N string of less-than and greater-than signs (<, >), insert the integers 0 through N at the start and end ...
1k views

### Spin the Calculator

Introduction: Let's take a look at a standard Calculator in Windows: For this challenge, we'll only look at the following buttons, and ignore everything else: ...
2k views

### Binary Countdown Length

inspired by Count down from infinity Given a non-negative integer N, output the number of repetitions of the following steps it takes to reach 0: Convert ...
918 views

### Summation under Zeckendorf Representation

Zeckendorf's theorem shows that every positive integer can be uniquely represented as a sum of non-adjacent Fibonacci numbers. In this challenge, you have to compute the sum of two numbers in ...
9k views

### Stay away from zero

Task Given a non-negative integer n, output 1 if n is 0,...
1k views

### Proportion of self-avoiding walks on a square lattice

The challenge Given a positive integer N, compute the proportion of N-step walks on a plane that don't intersect themselves. ...
4k views

### Round up my number

Sandbox Given two positive integers a and b, return the smallest multiple of b that is greater than or equal to a. Examples Definitions: true = ...
2k views

### Print the Lost numbers

As a big fan of the Lost TV series, I always got intrigued by the sequence of numbers that repetitively appears on the episodes. These numbers are: $4, 8, 15, 16, 23, 42$ (A104101) Using any ...
8k views

### Print all integers

Write a program or function which will provably print all integers exactly once given infinite time and memory. Possible outputs could be: ...
301 views

### Decompose Commutators

A theorem in this paper1 states that every integral n-by-n matrix M over the integers with trace M = 0 is a commutator, that means there are two integral matrices A,B of the same size ...
4k views

### Output the missing integer

You will be given a string. It will contain 9 unique integers from 0-9. You must return the missing integer. The string will look like this: ...
765 views

### Binary Convolution

A binary convolution is described by a number M, and is applied to a number N. For each bit in the binary representation of <...
910 views

### Find the length of a number's “base-jumping” path

Consider a positive integer N written in base b. A sequence is generated from this number by finding the largest digit ...
2k views

### Determine the Winner of a Game of Australian Football

In Australian Football, goals are worth 6 points and behinds are worth 1 point. Scores may include the number of goals and behinds, as well as the total score. Given the number of goals and behinds ...
2k views

### Inverse Look-and-Say

Background The Look and Say Sequence is built up by reading off the digits of previous entries in the sequence, counting the number of digits in groups of the same digit. For example: ...
2k views

### Crown hundred crownty crown

I noticed a certain game had a peculiar life counter, which instead of stopping at 999, gained a new digit – the next number was crown hundred or ...
917 views

### Group Integers by Originality

Introduction: I collect twisty puzzles. Most twisty puzzles are produced and sold by Chinese companies. Most well-known companies ask permission from puzzle designers to produce their designs and ...
3k views

### Triangular Dependencies

A triangular number is a number that is the sum of n natural numbers from 1 to n. For example ...
68 views

4k views

### Count the number of triangles

Given a list of positive integers, find the number of triangles we can form such that their side lengths are represented by three distinct entries of the input list. (Inspiration comes from CR.) ...
2k views

### Enumerate each series of identical numbers in-place

Given a list of strictly positive integers, go through each distinct number and replace all occurrences of it with successive indices (zero or one based) of a new series. Examples ...
8k views

Challenge: Input: A list of distinct positive integers within the range $[1, \text{list-size}]$. Output: An integer: the amount of times the list is riffle-shuffled. For a list, this means the ...
5k views

### Repeated! Factorials!

Not to be confused with Find the factorial! Introduction The factorial of an integer n can be calculated by $$n!=n\times(n-1)\times(n-2)\times(...)\times2\times1$$...
3k views

### Find the sum of all numbers below n that are a multiple of some set of numbers

Almost equivalent to Project Euler's first question: If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find ...
4k views

### Cops: The Hidden OEIS Substring

This is a Cops and Robbers challenge. This is the cop's thread. The robber's thread is here. As a cop, you must pick any sequence from the OEIS, and write a program p that prints the first integer ...
2k views

### Find Integral Roots of A Polynomial

Challenge The challenge is to write a program that takes the coefficients of any n-degree polynomial equation as input and returns the integral values of x for which the equation holds true. The ...
6k views

### Integer Lists of Noah

Introduction: I think we've all heard of it, but here a very brief summary: Noah gathered two of every species of animal on the planet, male and female, to save in his Ark during a great flood. The ...
3k views

Introduction: I saw there was only one other badminton related challenge right now. Since I play badminton myself (for the past 13 years now), I figured I'd add some badminton-related challenges. ...
3k views

### Robbers: The Hidden OEIS Substring

This is a Cops and Robbers challenge. This is the robber's thread. The cop's thread is here. The cops will pick any sequence from the OEIS, and write a program p that prints the first integer from ...
2k views

### Output the Euler Numbers

Given a non-negative integer $n ,$ output the $n^{\text{th}}$ Euler number (OEIS A122045). All odd-indexed Euler numbers are $0 .$ The even-indexed Euler numbers can be computed with the ...
2k views

### Square Root Distance from Integers

Given a decimal number k, find the smallest integer n such that the square root of n is ...
6k views

### Count like Chuck Norris

As is well known, Chuck Norris counted to infinity. Twice Besides, Chuck Norris can count to infinity backwards. Also, although perhaps less known, Chuck Norris can speak a little Spanish in ...
430 views

### Find X,Y,Z coordinates from index

Introduction I began studying the Collatz Conjecture And noticed these patterns; 0,1,2,2,3,3...A055086, and 0,1,2,0,3,1...A082375, in the numbers that go to 1 in one odd step, 5,10,20,21,40,42......