# Questions tagged [integer]

For challenges involving the manipulation of integers.

411 questions
Filter by
Sorted by
Tagged with
522 views

### RADD decomposition of an integer

Introduction The $RADD(n)$ operation is defined as the sum of $n + [$ the number whose decimal representation are the decimal digits of $n$ in reverse order $]$, see A004086. After reversal, ...
490 views

### Find a matrix whose sliding sum is the input

Given a matrix like this: 1 1 3 -2 3 -4 1 -1 1 1 1 0 0 -1 0 0 By taking a 2×2 "sliding sum", where the sum of every 2×2 region of the matrix is ...
• 18.4k
1k views

### Carryless factors

Carryless multiplication is an operation similar to binary long multiplication, but with XOR instead of addition: ...
• 18.4k
1k views

### Carry-less sum given a base b

Given a list of positive integers $\mathcal I=I_1,I_2,I_3,...,I_n$ and a base $b>1$ return their "carry-less sum", i.e. represent $\mathcal I$ in base $b$ and sum digit-by-digit ...
• 11.9k
1 vote
210 views

### Find number components with lowest distribution

Let us assume that we have number X. Let us assume that we have positive integer "components" (C) of this ...
• 143
1k views

### Cryptic Multiplications

Given two non-negative integers e.g. 27, 96 their multiplication expression would be 27 x 96 = 2592. If now each digits is ...
• 2,173
2k views

### Shifted auto-sum

Let’s take a positive integer such as 123. We define the shifted auto-sum of this integer as follows: 123 has 3 digits. We thus consider 3 copies of 123. We stack ...
• 37.5k
821 views

### Exponential transform of an integer sequence

The exponential generating function (e.g.f.) of a sequence $a_n$ is defined as the formal power series $f(x) = \sum_{n=0}^{\infty} \frac{a_n}{n!} x^n$. When $a_0 = 0$, we can apply the ...
• 40.2k
3k views

### How far from binary?

Given a decimal integer n as input, output the smallest (in terms of absolute value) decimal integer m such that the absolute ...
• 37.5k
2k views

### Find the nth Fibonacci number, where n is the mth Fibonacci number

Introduction If $\newcommand{\fib}{\operatorname{fib}}\fib(x)$ calculates the $x$th Fibonacci number, write a program that calculates $\fib(\fib(m))$ for any integer value of $m \ge 0$. (Of ...
• 225
890 views

### Spell out an integer... in NDos' way

Objective Given a positive integer, spell it out in the conlang I made. Specification Let $n$ be the inputted integer. $n$ shall be spelled out in the following specification. The entire spelling ...
• 4,295
2k views

### Is it 1089-able?

$1089$ is a very special number. To prove why, select any 3-digit number whose first and last digits differ by at least 2. Then, reverse the digits, and take the difference of these two numbers. ...
• 20.3k
1k views

...
• 10.4k
1k views

### The interstice of two binary numbers

Given two integers, compute the two numbers that come from the blending the bits of the binary numbers of equal length(same number of digits, a number with less digits has zeros added), one after the ...
• 420
2k views

### Randomly Rounding

Input a decimal number and round it to an integer, randomly rounding up or down with a probability based on its fractional part, so the expected value of the output equals to the input value. If ...
• 32.1k
562 views

### Double bit rotation to the right [closed]

Given a positive integer as input, output that integer, but with its bits rotated two times to the right. Also, think of the number as a donut of bits, eg. ...
• 465
284 views

### Line Islands in a Word Search

My third word search related challenge in a row. :) Challenge: Brief explanation of what a word search is: In a word search you'll be given a grid of letters and a list of words. The idea is to cross ...
• 113k
266 views

### Find All Digitroot Cyclic Sequences With Length Greater Than One

Digital sum, DR, Digit root is the iterative process of summing digits of a number until you end up with a single digit root number: e.g. digit root of 12345 is 6 since 1 + 2 + 3 + 4 + 5 = 15 = 1+5. ...
• 187
2k views

### How-many-bonacci-like is this sequence?

Inspired by @emanresu A's Is it a fibonacci-like sequence? Make sure to upvote that challenge as well! We say a sequence is Fibonacci-like, if, starting from the third term ($1$-indexed), each term ...
• 40.2k
312 views

### Coordinates for a Heronian tetrahedron

Did you know that Heronian Tetrahedra Are Lattice Tetrahedra? A Heronian tetrahedron is a tetrahedron where the length of each edge is an integer, the area of each face is an integer, and the volume ...
• 8,587
1k views

• 69.4k
1k views

### Compare positions of integers in this sequence

A001057 is one way to represent an integer as a natural number. It lists them according to the following pattern: 0, 1, -1, 2, -2, 3, -3, 4, -4, ... In this ...
• 18.4k
3k views

### Make an array of random 128 bit integers

Given an input value $n$, construct an array of $n$ random 128 bit (unsigned) integers. The integers should be uniformly random. Your code can use any in built random number generation function ... 329 views

### Hexagonal section numbers

Introduction Let's draw some regular hexagons formed by hexagonal tiles, marking the vertices of the tiles with dots. Then we will count the number of dots. ...
• 69.4k
3k views

### Longest Zero Sum Sub-array

Given an array of integers. Find out its longest sub-array (contiguous subsequence) whose sum is 0. The sub-array for output may be an empty array. Input Input an array of integers. Output Output the ...
• 32.1k
160 views

### Is this an ordinal transform? [duplicate]

Related: What's my telephone number? which asks to calculate the terms of A000085, the number of possible ordinal transforms of length n. Background Ordinal transform is a transformation on an integer ...
• 69.4k
2k views

### Maximum number of squares touched by a line segment

Consider a square grid on the plane, with unit spacing. A line segment of integer length $L$ is dropped at an arbitrary position with arbitrary orientation. The segment is said to "touch" ...
• 102k
3k views

### Is this a Permutation of 1..n

Input a non-empty array with $n$ positive integers. Test if the input array contains every integer in $1\cdots n$. In case you prefer 0-indexed numbers, you may choose to input an array of non-...
• 32.1k