Questions tagged [math]

The challenge involves mathematics in some central way. Also consider using more specific tags, listed in the tag wiki info.

1,652 questions
Filter by
Sorted by
Tagged with
8k views

I reverse the source code, you negate the input!

Blatant rip-off of a rip-off. Go upvote those! Your task, if you wish to accept it, is to write a program/function that outputs/returns its integer input/argument. The tricky part is that if I ...
85 views

Generate a Kirkman triple system

Given a universe of $v$ elements, a Kirkman triple system is a set of $(v-1)/2$ classes each having $v/3$ blocks each having three elements, so that every pair of elements appears in exactly ...
3k views

The inverse Collatz Conjecture

I think the Collatz Conjecture is already well-known. But what if we invert the rules? Start with an integer n >= 1. Repeat the following steps: If n is even, multiply it by 3 and add 1. If n is ...
2k views

Are they collinear?

Task Write a program/function that when given three 2d points in cartesian coordinates as input outputs a truthy value if they are collinear otherwise a falsey value Three points are said to be ...
2k views

Anti-divisors of a number

Given a positive integer n, output all of its anti-divisors in any order. From OEIS A006272: Anti-divisors are the numbers that do not divide a number by the ...
5k views

How many steps does it take from n to 1 by subtracting the greatest divisor?

Inspired by this question over at Mathematics. The Problem Let n be a natural number ≥ 2. Take the biggest divisor of ...
828 views

Cartesian - polar conversion couple

We don't have a challenge for conversion between Cartesian and polar coordinates, so ... The challenge Write two programs (or functions) in the same language: one that converts from polar to ...
2k views

Moving modest minimum

Inspired by a question over at Stack Overflow. The title here is entirely my fault. The challenge Given a list of positive integers containing at least two entries, replace each number by the ...
1k views

Are the numbers amicable?

Two numbers are considered amicable if the proper divisor sum of the first is the same as the second number, the second number's proper divisor sum is equal to the first number, and the first and ...
2k views

1k views

Quartic Summation

Guidelines Task Given two non-negative integers, find the sum of both numbers... to the power of 4. Examples 2, 3 -> 97 (2^4 + 3^4 = 97) ...