Tim
Varley
Principal AI Engineer and Tech Leader specializing in distributed systems, AI-driven development, and high-performance infrastructure.
Recent Essays
View All →Series
The AI Engineering Transformation
How engineering leaders can transform their teams from individual contributors into high-velocity AI orchestrators while managing risk and measuring real business impact.
The AI Engineer Mindset
Introduction to the 5-part series exploring the fundamental shift in how engineers relate to creation, control, and cognition when directing AI agents.
Articles
Levels of AI Use: From Chat to Agentic
Most engineers think they're power users. A real-world observation of two engineers on the same task reveals they're often playing completely different games. This piece maps the five levels of AI use, the hidden costs of each, and how to progress.
The Audience: When AI Reads Your Work
The fundamental shift in all forms of written communication: optimizing for both human and AI consumption, with expanded practices that improve reliability across development, correspondence, and public content.
Featured Projects
AI-Native IoT Platform
AI-native IoT platform optimizing water and energy consumption with distributed sensor networks, built entirely using advanced LLM agents.
AI-Native Portfolio & Blog
A high-performance personal platform built 100% via autonomous AI agents, directed by senior engineering architectural patterns. Demonstrates the power of experience-driven agentic workflows.
AI-Generated Euler Solutions
A repository of 50+ mathematical algorithm solutions generated entirely by AI agents. Showcases how deep engineering expertise guides AI to produce optimal, mathematically rigorous code.
B2B E-commerce Marketplace
Cloud-native B2B e-commerce platform disrupting the promotional products industry with extreme scalability and 20% cost optimization.
Enterprise SaaS Migration
Transformed legacy monolithic software into cloud-native microservices architecture, achieving 170% performance boost and 99.9% uptime.
High-Frequency Financial Infrastructure
Mission-critical financial data infrastructure delivering embargoed government economic releases to trading systems in under 15 milliseconds.
FinTech Patent Solution
Pioneering multi-channel banking system architecture that earned a US patent and Smithsonian Innovation Award for bridging legacy and digital banking.
Recent Solutions
View All →Arranged probability
If a box contains twenty-one coloured discs, composed of fifteen blue discs and six red discs, and two discs were taken at random, it can be seen that the probability of taking two blue discs, $P(\text{BB}) = (15/21) \times (14/20) = 1/2$. The next such arrangement, for which there is exactly $50\%$ chance of taking two blue discs at random, is a box containing eighty-five blue discs and thirty-five red discs. By finding the first arrangement to contain over $10^{12} = 1\,000\,000\,000\,000$ discs in total, determine the number of blue discs that the box would contain.
Largest exponential
Comparing two numbers written in index form like $2^{11}$ and $3^7$ is not difficult, as any calculator would confirm that $2^{11} = 2048 \lt 3^7 = 2187$. However, confirming that $632382^{518061} \gt 519432^{525806}$ would be much more difficult, as both numbers contain over three million digits. Using [base_exp.txt](https://projecteuler.net/resources/documents/0099_base_exp.txt), a 22K text file containing one thousand lines with a base/exponent pair on each line, determine which line number has the greatest numerical value. NOTE: The first two lines in the file represent the numbers in the example given above.
Anagramic squares
By replacing each of the letters in the word CARE with $1$, $2$, $9$, and $6$ respectively, we form a square number: $1296 = 36^2$. What is remarkable is that, by using the same digital substitutions, the anagram, RACE, also forms a square number: $9216 = 96^2$. We shall call CARE (and RACE) a square anagram word pair and specify further that leading zeroes are not permitted, neither may a different letter have the same digital value as another letter. Using [words.txt](https://projecteuler.net/resources/documents/0098_words.txt), a 16K text file containing nearly two-thousand common English words, find all the square anagram word pairs (a palindromic word is NOT considered to be an anagram of itself). What is the largest square number formed by any member of such a pair? NOTE: All anagrams formed must be contained in the given text file.
Large non-Mersenne prime
The first known prime found to exceed one million digits was discovered in 1999, and is a Mersenne prime of the form $2^{6972593} - 1$; it contains exactly $2\,098\,960$ digits. Subsequently other Mersenne primes, of the form $2^p - 1$, have been found which contain more digits. However, in 2004 there was found a massive non-Mersenne prime which contains $2\,357\,207$ digits: $28433 \times 2^{7830457} + 1$. Find the last ten digits of this prime number.
Su Doku
Su Doku (Japanese meaning *number place*) is the name given to a popular puzzle concept. Its origin is unclear, but credit must be attributed to Leonhard Euler who invented a similar, and much more difficult, puzzle idea called Latin Squares. The objective of Su Doku puzzles, however, is to replace the blanks (or zeros) in a 9 by 9 grid in such that each row, column, and 3 by 3 box contains each of the digits 1 to 9. Below is an example of a typical starting puzzle grid and its solution grid.   A well constructed Su Doku puzzle has a unique solution and can be solved by logic, although it may be necessary to employ "guess and test" methods in order to eliminate options (there is much contested opinion over this). The complexity of the search determines the difficulty of the puzzle; the example above is considered *easy* because it can be solved by straight forward direct deduction. The 6K text file, [sudoku.txt](https://projecteuler.net/resources/documents/0096_sudoku.txt), contains fifty different Su Doku puzzles ranging in difficulty, but all with unique solutions (the first puzzle in the file is the example above). By solving all fifty puzzles find the sum of the 3-digit numbers found in the top left corner of each solution grid; for example, 483 is the 3-digit number found in the top left corner of the solution grid above.
Amicable chains
The proper divisors of a number are all the divisors excluding the number itself. For example, the proper divisors of $28$ are $1$, $2$, $4$, $7$, and $14$. As the sum of these divisors is equal to $28$, we call it a perfect number. Interestingly the sum of the proper divisors of $220$ is $284$ and the sum of the proper divisors of $284$ is $220$, forming a chain of two numbers. For this reason, $220$ and $284$ are called an amicable pair. Perhaps less well known are longer chains. For example, starting with $12496$, we form a chain of five numbers: $$12496 \to 14288 \to 15472 \to 14536 \to 14264 (\to 12496 \to \cdots)$$ Since this chain returns to its starting point, it is called an amicable chain. Find the smallest member of the longest amicable chain with no element exceeding one million.