brain

tamnd's digital brain — notes, problems, research

42734 notes

Project Euler Problem 257

Given is an integer sided triangle ABC with sides a le b le c.

eulermathematicscompetitive-programming
Project Euler Problem 895

Gary and Sally play a game using gold and silver coins arranged into a number of vertical stacks, alternating turns.

eulermathematicscompetitive-programming
Project Euler Problem 844

Consider positive integer solutions to a^2+b^2+c^2 = 3abc For example, (1,5,13) is a solution.

eulermathematicscompetitive-programming
Project Euler Problem 626

A binary matrix is a matrix consisting entirely of 0s and 1s.

eulermathematicscompetitive-programming
Project Euler Problem 152

There are several ways to write the number dfrac{1}{2} as a sum of square reciprocals using distinct integers.

eulermathematicscompetitive-programming
Project Euler Problem 851

Let n be a positive integer and let En be the set of n-tuples of strictly positive integers.

eulermathematicscompetitive-programming
Project Euler Problem 372

Let R(M, N) be the number of lattice points (x, y) which satisfy MltxleN, MltyleN and largeleftlfloorfrac{y^2}{x^2}right

eulermathematicscompetitive-programming
Project Euler Problem 272

For a positive number n, define C(n) as the number of the integers x, for which 1 lt x lt n and x^3 equiv 1 bmod n.

eulermathematicscompetitive-programming
Project Euler Problem 131

There are some prime values, p, for which there exists a positive integer, n, such that the expression n^3 + n^2p is a p

eulermathematicscompetitive-programming
Project Euler Problem 211

For a positive integer n, let sigma2(n) be the sum of the squares of its divisors.

eulermathematicscompetitive-programming
Project Euler Problem 253

A small child has a “number caterpillar” consisting of forty jigsaw pieces, each with one number on it, which, when conn

eulermathematicscompetitive-programming
Project Euler Problem 117

Using a combination of grey square tiles and oblong tiles chosen from: red tiles (measuring two units), green tiles (mea

eulermathematicscompetitive-programming
Project Euler Problem 839

The sequence Sn is defined by S0 = 290797 and Sn = S{n - 1}^2 bmod 50515093 for n 0.

eulermathematicscompetitive-programming
Project Euler Problem 297

Each new term in the Fibonacci sequence is generated by adding the previous two terms.

eulermathematicscompetitive-programming
Project Euler Problem 758

There are 3 buckets labelled S (small) of 3 litres, M (medium) of 5 litres and L (large) of 8 litres.

eulermathematicscompetitive-programming
Project Euler Problem 464

The Möbius function, denoted mu(n), is defined as: - mu(n) = (-1)^{omega(n)} if n is squarefree (where omega(n) is the n

eulermathematicscompetitive-programming
Project Euler Problem 442

An integer is called eleven-free if its decimal expansion does not contain any substring representing a power of 11 exce

eulermathematicscompetitive-programming
Project Euler Problem 314

The moon has been opened up, and land can be obtained for free, but there is a catch.

eulermathematicscompetitive-programming
Project Euler Problem 824

A Slider is a chess piece that can move one square left or right.

eulermathematicscompetitive-programming
Project Euler Problem 622

A riffle shuffle is executed as follows: a deck of cards is split into two equal halves, with the top half taken in the

eulermathematicscompetitive-programming
Project Euler Problem 794

This problem uses half open interval notation where [a,b) represents a le x < b.

eulermathematicscompetitive-programming
Project Euler Problem 886

A permutation of 2,3,ldots,n is a rearrangement of these numbers.

eulermathematicscompetitive-programming
Project Euler Problem 204

A Hamming number is a positive number which has no prime factor larger than 5.

eulermathematicscompetitive-programming
Project Euler Problem 142

Find the smallest x + y + z with integers x gt y gt z gt 0 such that x + y, x - y, x + z, x - z, y + z, y - z are all pe

eulermathematicscompetitive-programming
Project Euler Problem 651

An infinitely long cylinder has its curved surface fully covered with different coloured but otherwise identical rectang

eulermathematicscompetitive-programming
Project Euler Problem 251

A triplet of positive integers (a, b, c) is called a Cardano Triplet if it satisfies the condition: For example, (2,1,5)

eulermathematicscompetitive-programming
Project Euler Problem 835

A Pythagorean triangle is called supernatural if two of its three sides are consecutive integers.

eulermathematicscompetitive-programming
Project Euler Problem 600

Let H(n) be the number of distinct integer sided equiangular convex hexagons with perimeter not exceeding n.

eulermathematicscompetitive-programming
Project Euler Problem 355

Define operatorname{Co}(n) to be the maximal possible sum of a set of mutually co-prime elements from 1,2,dots,n.

eulermathematicscompetitive-programming
Project Euler Problem 690

Tom (the cat) and Jerry (the mouse) are playing on a simple graph G.

eulermathematicscompetitive-programming
Project Euler Problem 193

A positive integer n is called squarefree, if no square of a prime divides n, thus 1, 2, 3, 5, 6, 7, 10, 11 are squarefr

eulermathematicscompetitive-programming
Project Euler Problem 684

Define s(n) to be the smallest number that has a digit sum of n.

eulermathematicscompetitive-programming
Project Euler Problem 507

Let tn be the tribonacci numbers defined as: t0 = t1 = 0; t2 = 1; tn = t{n-1} + t{n-2} + t{n-3} for n ge 3 and let rn =

eulermathematicscompetitive-programming
Project Euler Problem 205

Peter has nine four-sided (pyramidal) dice, each with faces numbered 1, 2, 3, 4.

eulermathematicscompetitive-programming
Project Euler Problem 509

Anton and Bertrand love to play three pile Nim.

eulermathematicscompetitive-programming
Project Euler Problem 707

Consider a wtimes h grid.

eulermathematicscompetitive-programming
Project Euler Problem 213

A 30 times 30 grid of squares contains 900 fleas, initially one flea per square.

eulermathematicscompetitive-programming
Project Euler Problem 660

We call an integer sided triangle n-pandigital if it contains one angle of 120 degrees and, when the sides of the triang

eulermathematicscompetitive-programming
Project Euler Problem 407

If we calculate a^2 bmod 6 for 0 leq a leq 5 we get: 0,1,4,3,4,1.

eulermathematicscompetitive-programming
Project Euler Problem 511

Let Seq(n,k) be the number of positive-integer sequences ai{1 le i le n} of length n such that: - n is divisible by ai f

eulermathematicscompetitive-programming
Project Euler Problem 428

Let a, b and c be positive numbers.

eulermathematicscompetitive-programming
Project Euler Problem 827

Define Q(n) to be the smallest number that occurs in exactly n Pythagorean triples (a,b,c) where a lt b lt c.

eulermathematicscompetitive-programming
Project Euler Problem 74

The number 145 is well known for the property that the sum of the factorial of its digits is equal to 145: Perhaps less

eulermathematicscompetitive-programming
Project Euler Problem 705

The inversion count of a sequence of digits is the smallest number of adjacent pairs that must be swapped to sort the se

eulermathematicscompetitive-programming
Project Euler Problem 89

For a number written in Roman numerals to be considered valid there are basic rules which must be followed.

eulermathematicscompetitive-programming
Project Euler Problem 704

Define g(n, m) to be the largest integer k such that 2^k divides binom{n}m.

eulermathematicscompetitive-programming
Project Euler Problem 643

Two positive integers a and b are 2-friendly when gcd(a,b) = 2^t, t gt 0.

eulermathematicscompetitive-programming
Project Euler Problem 552

Let An be the smallest positive integer satisfying An bmod pi = i for all 1 le i le n, where pi is the i-th prime.

eulermathematicscompetitive-programming
Project Euler Problem 303

For a positive integer n, define f(n) as the least positive multiple of n that, written in base 10, uses only digits le

eulermathematicscompetitive-programming
Project Euler Problem 625

G(N)=sum{j=1}^Nsum{i=1}^j gcd(i,j).

eulermathematicscompetitive-programming
Project Euler Problem 819

Given an n-tuple of numbers another n-tuple is created where each element of the new n-tuple is chosen randomly from the

eulermathematicscompetitive-programming
Project Euler Problem 401

The divisors of 6 are 1,2,3 and 6.

eulermathematicscompetitive-programming
Project Euler Problem 601

For every positive number n we define the function mathop{streak}(n)=k as the smallest positive integer k such that n+k

eulermathematicscompetitive-programming
Project Euler Problem 148

We can easily verify that none of the entries in the first seven rows of Pascal's triangle are divisible by 7: | | | | |

eulermathematicscompetitive-programming
Project Euler Problem 353

A moon could be described by the sphere C(r) with centre (0,0,0) and radius r.

eulermathematicscompetitive-programming
Project Euler Problem 754

The Gauss Factorial of a number n is defined as the product of all positive numbers leq n that are relatively prime to n

eulermathematicscompetitive-programming
Project Euler Problem 546

Define fk(n) = sum{i=0}^n fk(lfloorfrac i k rfloor) where fk(0) = 1 and lfloor x rfloor denotes the floor function.

eulermathematicscompetitive-programming
Project Euler Problem 772

A k-bounded partition of a positive integer N is a way of writing N as a sum of positive integers not exceeding k.

eulermathematicscompetitive-programming
Project Euler Problem 137

Consider the infinite polynomial series AF(x) = x F1 + x^2 F2 + x^3 F3 + dots, where Fk is the kth term in the Fibonacci

eulermathematicscompetitive-programming
Project Euler Problem 282

defhtmltext1{style{font-family:inherit;}{text{1}}} For non-negative integers m, n, the Ackermann function A(m,n) is defi

eulermathematicscompetitive-programming
Project Euler Problem 870

Two players play a game with a single pile of stones of initial size n.

eulermathematicscompetitive-programming
Project Euler Problem 284

The 3-digit number 376 in the decimal numbering system is an example of numbers with the special property that its squar

eulermathematicscompetitive-programming
Project Euler Problem 752

When (1+sqrt 7) is raised to an integral power, n, we always get a number of the form (a+bsqrt 7).

eulermathematicscompetitive-programming
Project Euler Problem 694

A positive integer n is considered cube-full, if for every prime p that divides n, so does p^3.

eulermathematicscompetitive-programming
Project Euler Problem 459

The flipping game is a two player game played on an N by N square board.

eulermathematicscompetitive-programming
Project Euler Problem 761

Two friends, a runner and a swimmer, are playing a sporting game: The swimmer is swimming within a circular pool while t

eulermathematicscompetitive-programming
Project Euler Problem 880

(x,y) is called a nested radical pair if x and y are non-zero integers such that dfrac{x}{y} is not a cube of a rational

eulermathematicscompetitive-programming
Project Euler Problem 666

Members of a species of bacteria occur in two different types: alpha and beta.

eulermathematicscompetitive-programming
Project Euler Problem 659

Consider the sequence n^2+3 with n ge 1.

eulermathematicscompetitive-programming
Project Euler Problem 221

We shall call a positive integer A an "Alexandrian integer", if there exist integers p, q, r such that: and For example,

eulermathematicscompetitive-programming
Project Euler Problem 356

Let an be the largest real root of a polynomial g(x) = x^3 - 2^n cdot x^2 + n.

eulermathematicscompetitive-programming
Project Euler Problem 473

Let varphi be the golden ratio: varphi=frac{1+sqrt{5}}{2}.

eulermathematicscompetitive-programming
Project Euler Problem 394

Jeff eats a pie in an unusual way.

eulermathematicscompetitive-programming
Project Euler Problem 361

The Thue-Morse sequence Tn is a binary sequence satisfying: - T0 = 0 - T{2n} = Tn - T{2n + 1} = 1 - Tn The first several

eulermathematicscompetitive-programming
Project Euler Problem 85

By counting carefully it can be seen that a rectangular grid measuring 3 by 2 contains eighteen rectangles: Although the

eulermathematicscompetitive-programming
Project Euler Problem 614

An integer partition of a number n is a way of writing n as a sum of positive integers.

eulermathematicscompetitive-programming
Project Euler Problem 249

Let S = 2, 3, 5, dots, 4999 be the set of prime numbers less than 5000.

eulermathematicscompetitive-programming
Project Euler Problem 561

Let S(n) be the number of pairs (a,b) of distinct divisors of n such that a divides b.

eulermathematicscompetitive-programming
Project Euler Problem 749

A positive integer, n, is a near power sum if there exists a positive integer, k, such that the sum of the kth powers of

eulermathematicscompetitive-programming
Project Euler Problem 549

The smallest number m such that 10 divides m! is m=5.

eulermathematicscompetitive-programming
Project Euler Problem 512

Let varphi(n) be Euler's totient function.

eulermathematicscompetitive-programming
Project Euler Problem 688

We stack n plates into k non-empty piles where each pile is a different size.

eulermathematicscompetitive-programming
Project Euler Problem 481

A group of chefs (numbered 1, 2, etc) participate in a turn-based strategic cooking competition.

eulermathematicscompetitive-programming
Project Euler Problem 453

A simple quadrilateral is a polygon that has four distinct vertices, has no straight angles and does not self-intersect.

eulermathematicscompetitive-programming
Project Euler Problem 676

Let d(i,b) be the digit sum of the number i in base b.

eulermathematicscompetitive-programming
Project Euler Problem 92

A number chain is created by continuously adding the square of the digits in a number to form a new number until it has

eulermathematicscompetitive-programming
Project Euler Problem 291

A prime number p is called a Panaitopol prime if p = dfrac{x^4 - y^4}{x^3 + y^3} for some positive integers x and y.

eulermathematicscompetitive-programming
Project Euler Problem 77

It is possible to write ten as the sum of primes in exactly five different ways: What is the first value which can be wr

eulermathematicscompetitive-programming
Project Euler Problem 128

A hexagonal tile with number 1 is surrounded by a ring of six hexagonal tiles, starting at "12 o'clock" and numbering th

eulermathematicscompetitive-programming
Project Euler Problem 736

Define two functions on lattice points: r(x,y) = (x+1,2y) s(x,y) = (2x,y+1) A path to equality of length n for a pair (a

eulermathematicscompetitive-programming
Project Euler Problem 750

Card Stacking is a game on a computer starting with an array of N cards labelled 1,2,ldots,N.

eulermathematicscompetitive-programming
Project Euler Problem 646

Let n be a natural number and p1^{alpha1}cdot p2^{alpha2}cdots pk^{alphak} its prime factorisation.

eulermathematicscompetitive-programming
Project Euler Problem 793

Let Si be an integer sequence produced with the following pseudo-random number generator: - S0 = 290797 - S{i+1} = Si ^2

eulermathematicscompetitive-programming
Project Euler Problem 433

Let E(x0, y0) be the number of steps it takes to determine the greatest common divisor of x0 and y0 with Euclid's algori

eulermathematicscompetitive-programming
Project Euler Problem 603

Let S(n) be the sum of all contiguous integer-substrings that can be formed from the integer n.

eulermathematicscompetitive-programming
Project Euler Problem 875

For a positive integer n we define q(n) to be the number of solutions to: where 0 leq ai, bi lt n.

eulermathematicscompetitive-programming
Project Euler Problem 371

Oregon licence plates consist of three letters followed by a three digit number (each digit can be from [0..9]).

eulermathematicscompetitive-programming
Project Euler Problem 321

A horizontal row comprising of 2n + 1 squares has n red counters placed at one end and n blue counters at the other end,

eulermathematicscompetitive-programming
Project Euler Problem 691

Given a character string s, we define L(k,s) to be the length of the longest substring of s which appears at least k tim

eulermathematicscompetitive-programming
Project Euler Problem 740

Secret Santa is a process that allows n people to give each other presents, so that each person gives a single present a

eulermathematicscompetitive-programming