<?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%2F43</id>
	<title>Project Euler/43 - 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%2F43"/>
	<link rel="alternate" type="text/html" href="https://charlesreid1.com/w/index.php?title=Project_Euler/43&amp;action=history"/>
	<updated>2026-06-18T23:13:36Z</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/43&amp;diff=30592&amp;oldid=prev</id>
		<title>Admin: Create Project Euler/43 with problem statement, approach, and solution link (via create-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://charlesreid1.com/w/index.php?title=Project_Euler/43&amp;diff=30592&amp;oldid=prev"/>
		<updated>2026-06-16T14:16:30Z</updated>

		<summary type="html">&lt;p&gt;Create Project Euler/43 with problem statement, approach, and solution link (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 number 1406357289 is a 0 to 9 pandigital number because it is made up of each of the digits 0 to 9 in some order, and it has an interesting sub-string divisibility property.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;d_1&amp;lt;/math&amp;gt; be the 1st digit, &amp;lt;math&amp;gt;d_2&amp;lt;/math&amp;gt; the 2nd digit, and so on. The following divisibility relationships hold:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;d_2 d_3 d_4 = 406&amp;lt;/math&amp;gt; is divisible by 2&lt;br /&gt;
* &amp;lt;math&amp;gt;d_3 d_4 d_5 = 063&amp;lt;/math&amp;gt; is divisible by 3&lt;br /&gt;
* &amp;lt;math&amp;gt;d_4 d_5 d_6 = 635&amp;lt;/math&amp;gt; is divisible by 5&lt;br /&gt;
* &amp;lt;math&amp;gt;d_5 d_6 d_7 = 357&amp;lt;/math&amp;gt; is divisible by 7&lt;br /&gt;
* &amp;lt;math&amp;gt;d_6 d_7 d_8 = 572&amp;lt;/math&amp;gt; is divisible by 11&lt;br /&gt;
* &amp;lt;math&amp;gt;d_7 d_8 d_9 = 728&amp;lt;/math&amp;gt; is divisible by 13&lt;br /&gt;
* &amp;lt;math&amp;gt;d_8 d_9 d_{10} = 289&amp;lt;/math&amp;gt; is divisible by 17&lt;br /&gt;
&lt;br /&gt;
Find the sum of all 0 to 9 pandigital numbers with this property.&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
&lt;br /&gt;
===Generate Pandigital Permutations===&lt;br /&gt;
&lt;br /&gt;
All 0-to-9 pandigital numbers are permutations of the digits {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}. The solution uses a recursive backtracking algorithm (Heap&amp;#039;s algorithm variant) that generates each permutation in-place by swapping elements. For each permutation, the digit array represents &amp;lt;math&amp;gt;d_1&amp;lt;/math&amp;gt; through &amp;lt;math&amp;gt;d_{10}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Check Sub-String Divisibility===&lt;br /&gt;
&lt;br /&gt;
For each permutation, extract the seven 3-digit substrings and verify each divisibility condition:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;d_2 d_3 d_4 \equiv 0 \pmod{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;d_3 d_4 d_5 \equiv 0 \pmod{3}&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;d_4 d_5 d_6 \equiv 0 \pmod{5}&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;d_5 d_6 d_7 \equiv 0 \pmod{7}&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;d_6 d_7 d_8 \equiv 0 \pmod{11}&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;d_7 d_8 d_9 \equiv 0 \pmod{13}&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;d_8 d_9 d_{10} \equiv 0 \pmod{17}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All seven conditions must be satisfied for a pandigital number to be counted.&lt;br /&gt;
&lt;br /&gt;
===Convert Digits to Number===&lt;br /&gt;
&lt;br /&gt;
If a permutation passes all divisibility checks, the 10-digit array is converted to a &amp;lt;code&amp;gt;long&amp;lt;/code&amp;gt; integer by iterating through the digits and building the number via repeated multiplication by 10.&lt;br /&gt;
&lt;br /&gt;
===Accumulate the Sum===&lt;br /&gt;
&lt;br /&gt;
Each valid pandigital number is added to a running total. After all 10! = 3,628,800 permutations have been examined, the accumulated sum is returned.&lt;br /&gt;
&lt;br /&gt;
==Solution==&lt;br /&gt;
&lt;br /&gt;
Link: https://git.charlesreid1.com/cs/euler/src/branch/main/java/Problem043.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>