# Questions tagged [integer]

For challenges involving the manipulation of integers.

442 questions
Filter by
Sorted by
Tagged with
3k views

### Make The Finest Magic Code Square

In math a magic square is an N×N grid of numbers from 1 to N2 such that every row, column, and diagonal sums to the same total. For example here's a 3×3 magic square: In this challenge we'...
• 89.8k
3k views

### Move my liquid to make me equal

You are given 4 positive integers: volume of the first container (v1), volume of the second container (v2), volume of the liquid ...
2k 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. ...
• 105k
5k 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 = ...
1k 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 ...
• 7,387
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: ...
• 2,959
1 vote
84 views

• 43.8k
5k 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.) ...
• 43.8k
2k views

### Numbers Decrease while Letters Increase

Randomly inspired by Numbers Increase While Letters Decrease Given a list of mixed letters and integers (e.g., ['a', 2, 3, 'b']) increase the letters by one ...
• 43.4k
3k views

### Output with the same length always

With challenges like Output with the same length as the code and Create output twice the length of the code, I thought of a separate, but similar challenge. The task is to produce an output. It can ...
• 6,897
400 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 as M such that M ...
• 43.8k
6k 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$$...
• 7,324
4k views

### Inverse Colombian Function

Let's define a sequence: The n digit summing sequence (n-DSS) is a sequence that starts with n. If the last number was k, then the next number is k + digit-sum(k). Here are the first few n-DSS: ...
• 59.3k
720 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......
• 753
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 ...
• 59.3k
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 ...
• 59.3k
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 ...
• 127k
170 views

### Sum of multiples of powers of ten of an integer [duplicate]

Write a function to produce, for a non-negative integer, a string containing a sum of terms according to the following: ...
• 659
294 views

### Is this number a palindrome? [closed]

Input A single integer in your language's preferred format, e.g int or an array of digits are all acceptable. Output A truthy or falsely value, depending on ...
• 2,321
15k views

### Do the 26 richest billionaires own as much wealth as the poorest 3.8 billion people?

Introduction: A few days ago I read this post with the same title when I came across it in the HNQ. It asks if this claim of US presidential candidate Bernie Sanders is true or not: Today the world's ...
• 127k
3k views

### Prime parity peregrination

The purpose of this challenge is to graphically depict a walk on the plane, where the direction of each step $k$ is determined by the primality of $k$ and the parity of its binary expansion. ...
• 105k
266 views

### Fastest way to iterate over sublattice of discrete lattice

I need to construct a functor that iterates over the linear representation of a sub-lattice of size $d_x,d_y,d_z,d_q$ embedded in a lattice of size $n_x,n_y,n_z,n_q$. The sub-lattice corner is ...
• 191
1k views

### Subtract the Folded Matrix

Challenge: Given an NxN matrix where $N\geq2$ and one of eight distinct 'folding options', output a 2D array/list with the subtracted values. The eight folding options are: left-to-right; right-to-...
• 127k
1k 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 work ...
• 127k
3k views

### Rotated Position of Integers

Challenge: Input: A sorted list of positive integers. Output: The amount of integers which are still at the exact same index, after rotating the digits in each integer its index amount of times ...
• 127k
663 views

Introduction: In Dutch, the words leading and suffering, being 'leiden' and 'lijden' respectively, are pronounced the same way. One is written with a "short ei", and one with a "long ij&...
• 127k
1k views

### Warped chessboard

This challenge is about building a chessboard in which the square size, instead of being constant across the board, follows a certain non-decreasing sequence, as described below. The board is defined ...
• 105k