<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://charlesreid1.com/w/index.php?action=history&amp;feed=atom&amp;title=Project_Euler%2F49</id>
	<title>Project Euler/49 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://charlesreid1.com/w/index.php?action=history&amp;feed=atom&amp;title=Project_Euler%2F49"/>
	<link rel="alternate" type="text/html" href="https://charlesreid1.com/w/index.php?title=Project_Euler/49&amp;action=history"/>
	<updated>2026-06-18T23:13:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.12</generator>
	<entry>
		<id>https://charlesreid1.com/w/index.php?title=Project_Euler/49&amp;diff=30596&amp;oldid=prev</id>
		<title>Admin: Automated edit (via create-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://charlesreid1.com/w/index.php?title=Project_Euler/49&amp;diff=30596&amp;oldid=prev"/>
		<updated>2026-06-16T14:34:07Z</updated>

		<summary type="html">&lt;p&gt;Automated edit (via create-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The arithmetic sequence, 1487, 4817, 8147, in which each of the terms increases by 3330, is unusual in two ways:&lt;br /&gt;
* (i) each of the three terms is prime&lt;br /&gt;
* (ii) each of the 4-digit numbers is a permutation of the same digits&lt;br /&gt;
&lt;br /&gt;
There are no arithmetic sequences made up of three 1-, 2-, or 3-digit primes exhibiting this property, but there is one other 4-digit increasing sequence.&lt;br /&gt;
&lt;br /&gt;
What 12-digit number do you form by concatenating the three terms in this sequence?&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
&lt;br /&gt;
===Generate 4-Digit Primes===&lt;br /&gt;
&lt;br /&gt;
Use a prime sieve to generate all primes up to 10,000. Discard primes below 1,000, leaving only the 4-digit primes.&lt;br /&gt;
&lt;br /&gt;
===Group by Digit Permutations===&lt;br /&gt;
&lt;br /&gt;
For each 4-digit prime:&lt;br /&gt;
* Convert the integer to a string&lt;br /&gt;
* Sort its characters (digits) alphabetically&lt;br /&gt;
* Use the sorted string as a key in a HashMap&lt;br /&gt;
* Append the original prime to the list for that key&lt;br /&gt;
&lt;br /&gt;
After processing all primes, each entry in the map contains a group of primes that are digit permutations of one another.&lt;br /&gt;
&lt;br /&gt;
===Find Arithmetic Sequences===&lt;br /&gt;
&lt;br /&gt;
For each group containing at least three members:&lt;br /&gt;
* Sort the group in ascending order&lt;br /&gt;
* Iterate over all pairs (a, b) within the group, where b &amp;gt; a&lt;br /&gt;
* Compute the third term: c = b + (b - a)&lt;br /&gt;
* If c is also in the group, then (a, b, c) forms an arithmetic progression&lt;br /&gt;
&lt;br /&gt;
===Exclude the Known Example===&lt;br /&gt;
&lt;br /&gt;
The problem statement gives 1487, 4817, 8147 as an example. Skip the sequence where a = 1487 so that only the other 4-digit sequence is reported.&lt;br /&gt;
&lt;br /&gt;
===Return the Concatenation===&lt;br /&gt;
&lt;br /&gt;
Concatenate the three terms (a, b, c) as strings and return the resulting 12-digit number.&lt;br /&gt;
&lt;br /&gt;
==Solution==&lt;br /&gt;
&lt;br /&gt;
Link: https://git.charlesreid1.com/cs/euler/src/branch/main/java/Problem049.java&lt;br /&gt;
&lt;br /&gt;
==Flags==&lt;br /&gt;
&lt;br /&gt;
{{ProjectEulerFlag}}&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>