<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.zcubes.com/index.php?action=history&amp;feed=atom&amp;title=Esoteric_Mathematical_Problems_in_Wolframscript</id>
	<title>Esoteric Mathematical Problems in Wolframscript - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.zcubes.com/index.php?action=history&amp;feed=atom&amp;title=Esoteric_Mathematical_Problems_in_Wolframscript"/>
	<link rel="alternate" type="text/html" href="https://wiki.zcubes.com/index.php?title=Esoteric_Mathematical_Problems_in_Wolframscript&amp;action=history"/>
	<updated>2026-06-12T13:21:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>https://wiki.zcubes.com/index.php?title=Esoteric_Mathematical_Problems_in_Wolframscript&amp;diff=217808&amp;oldid=prev</id>
		<title>Virajp: Created page with &quot;= Esoteric Mathematical Problems in Wolfram Language =  This page demonstrates advanced implementation of fascinating mathematical problems using Wolfram Language: the Collatz...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.zcubes.com/index.php?title=Esoteric_Mathematical_Problems_in_Wolframscript&amp;diff=217808&amp;oldid=prev"/>
		<updated>2025-06-19T22:56:28Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= Esoteric Mathematical Problems in Wolfram Language =  This page demonstrates advanced implementation of fascinating mathematical problems using Wolfram Language: the Collatz...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Esoteric Mathematical Problems in Wolfram Language =&lt;br /&gt;
&lt;br /&gt;
This page demonstrates advanced implementation of fascinating mathematical problems using Wolfram Language: the Collatz Conjecture and Truncatable Primes analysis.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
=== Wolfram Engine and ZCubes Integration ===&lt;br /&gt;
&lt;br /&gt;
To replicate this analysis using the ZCubes platform with Wolfram integration, follow the comprehensive installation guide available at the [https://wiki.zcubes.com/Z%5E3_Mathematica_Integration Z³ Mathematica Integration] documentation.&lt;br /&gt;
&lt;br /&gt;
'''Key Installation Steps:'''&lt;br /&gt;
# Install Wolfram Desktop or Mathematica from the Wolfram User Portal&lt;br /&gt;
# Install Anaconda or Jupyter Notebook for kernel management&lt;br /&gt;
# Download and install the Wolfram Jupyter Kernel from the official GitHub repository&lt;br /&gt;
# Configure the Wolfram kernel using the command: `ZADDSERVERLANGUAGE(&amp;quot;wolframscript&amp;quot;, &amp;quot;wolframlanguage14.2&amp;quot;)`&lt;br /&gt;
# Configure API and Jupyter settings in ZCubes Advanced Settings panel&lt;br /&gt;
# Verify installation by executing Wolfram Language code within ZCubes&lt;br /&gt;
&lt;br /&gt;
=== ZCubes Environment Configuration ===&lt;br /&gt;
&lt;br /&gt;
This analysis was conducted within the '''ZCubes (Z³) Application Platform''' environment, which provides an integrated development environment for mathematical and statistical computing. The ZCubes platform supports Wolfram Language kernel integration through its Omniglot capability, enabling seamless execution of Mathematica code within a web-based interface alongside other programming languages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Problem 1: The Collatz Conjecture and Generalized 3n + 1 Problem ==&lt;br /&gt;
[[File:CC 2.png|thumb]]&lt;br /&gt;
[[File:CC 3.png|thumb]]&lt;br /&gt;
=== Mathematical Background ===&lt;br /&gt;
The Collatz Conjecture is one of mathematics' most famous unsolved problems. For any positive integer n:&lt;br /&gt;
* If n is even: n → n/2  &lt;br /&gt;
* If n is odd: n → 3n+1&lt;br /&gt;
* '''Conjecture''': Every positive integer eventually reaches 1&lt;br /&gt;
&lt;br /&gt;
=== Esoteric Extensions ===&lt;br /&gt;
* Generalized (an+b)/(cn+d) functions&lt;br /&gt;
* Behavior in different number bases  &lt;br /&gt;
* Fractal dimensions of trajectory sets&lt;br /&gt;
&lt;br /&gt;
=== Wolfram Language Implementation ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wolfram&amp;quot;&amp;gt;&lt;br /&gt;
(* Collatz sequence *)&lt;br /&gt;
CollatzSequence[n_] := NestWhileList[If[EvenQ[#], #/2, 3*# + 1] &amp;amp;, n, # != 1 &amp;amp;]&lt;br /&gt;
&lt;br /&gt;
(* Generalized Collatz with parameters a, b, c, d *)&lt;br /&gt;
GeneralizedCollatz[n_, a_, b_, c_, d_] := &lt;br /&gt;
  If[EvenQ[n], (a*n + b)/(c*n + d), 3*n + 1]&lt;br /&gt;
&lt;br /&gt;
(* Calculate stopping time (steps to reach 1) *)&lt;br /&gt;
StoppingTime[n_] := Length[CollatzSequence[n]] - 1&lt;br /&gt;
&lt;br /&gt;
(* Create fractal plot of stopping times *)&lt;br /&gt;
CollatzFractal[maxN_] := &lt;br /&gt;
  ListPlot[Table[{n, StoppingTime[n]}, {n, 1, maxN}], &lt;br /&gt;
   PlotStyle -&amp;gt; PointSize[0.001]]&lt;br /&gt;
&lt;br /&gt;
(* Execute and print results *)&lt;br /&gt;
Print[&amp;quot;Collatz sequence for n=7:&amp;quot;]&lt;br /&gt;
Print[CollatzSequence[7]]&lt;br /&gt;
&lt;br /&gt;
Print[&amp;quot;Stopping times for first 10 numbers:&amp;quot;]&lt;br /&gt;
Print[Table[{n, StoppingTime[n]}, {n, 1, 10}]]&lt;br /&gt;
&lt;br /&gt;
Print[&amp;quot;Collatz sequence for n=27:&amp;quot;]&lt;br /&gt;
Print[CollatzSequence[27]]&lt;br /&gt;
&lt;br /&gt;
Print[&amp;quot;Stopping time for n=27:&amp;quot;]&lt;br /&gt;
Print[StoppingTime[27]]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem 2: Counting Truncatable Primes ==&lt;br /&gt;
[[File:TP 3.png|thumb]]&lt;br /&gt;
[[File:TP 4.png|thumb]]&lt;br /&gt;
[[File:TP 5.png|thumb]]&lt;br /&gt;
=== Mathematical Background ===&lt;br /&gt;
Truncatable primes are prime numbers that remain prime when digits are successively removed from either end. There are exactly '''11 primes''' that are truncatable from both left and right.&lt;br /&gt;
&lt;br /&gt;
=== Wolfram Language Implementation ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wolfram&amp;quot;&amp;gt;&lt;br /&gt;
(* Check if number can be truncated from left *)&lt;br /&gt;
TruncatablePrimes[p_Integer?PrimeQ] := &lt;br /&gt;
  With[{digits = IntegerDigits[p]},&lt;br /&gt;
   {p, TruncatablePrimes /@ (FromDigits /@ (Prepend[digits, #] &amp;amp; /@ Range[1, 9]))}&lt;br /&gt;
  ]&lt;br /&gt;
&lt;br /&gt;
TruncatablePrimes[p_Integer] := {}&lt;br /&gt;
&lt;br /&gt;
(* Find all left-truncatable primes *)&lt;br /&gt;
FindAllLeftTruncatablePrimes[] := &lt;br /&gt;
  Sort[Flatten[TruncatablePrimes /@ Range[2, 7]]]&lt;br /&gt;
&lt;br /&gt;
(* Right-truncatable primes (shrinkable primes) *)&lt;br /&gt;
ShrinkablePrimes[] := Sort[ShrinkablePrimes[Range[2, 7]]]&lt;br /&gt;
ShrinkablePrimes[ps_List] := Join @@ (ShrinkablePrimes /@ ps)&lt;br /&gt;
&lt;br /&gt;
With[{appendDigits = Append /@ Range[1, 9]},&lt;br /&gt;
 ShrinkablePrimes[p_Integer?PrimeQ] := &lt;br /&gt;
  Prepend[ShrinkablePrimes[FromDigits /@ &lt;br /&gt;
    Through[appendDigits[IntegerDigits[p]]]], p]&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
ShrinkablePrimes[p_Integer] := {}&lt;br /&gt;
&lt;br /&gt;
(* Find doubly truncatable primes *)&lt;br /&gt;
FindDoublyTruncatablePrimes[] := &lt;br /&gt;
  Intersection[FindAllLeftTruncatablePrimes[], ShrinkablePrimes[]]&lt;br /&gt;
&lt;br /&gt;
(* Analysis functions *)&lt;br /&gt;
AnalyzeTruncatablePrime[n_] := Module[{leftTrunc, rightTrunc},&lt;br /&gt;
  leftTrunc = NestWhileList[Floor[#/10] &amp;amp;, n, # &amp;gt; 0 &amp;amp;];&lt;br /&gt;
  rightTrunc = NestWhileList[FromDigits[Drop[IntegerDigits[#], -1]] &amp;amp;, n, &lt;br /&gt;
    IntegerLength[#] &amp;gt; 1 &amp;amp;];&lt;br /&gt;
  &lt;br /&gt;
  {&lt;br /&gt;
   &amp;quot;Number&amp;quot; -&amp;gt; n,&lt;br /&gt;
   &amp;quot;LeftTruncations&amp;quot; -&amp;gt; leftTrunc,&lt;br /&gt;
   &amp;quot;RightTruncations&amp;quot; -&amp;gt; rightTrunc,&lt;br /&gt;
   &amp;quot;AllLeftPrime&amp;quot; -&amp;gt; AllTrue[leftTrunc, PrimeQ],&lt;br /&gt;
   &amp;quot;AllRightPrime&amp;quot; -&amp;gt; AllTrue[rightTrunc, PrimeQ],&lt;br /&gt;
   &amp;quot;LeftTruncatable&amp;quot; -&amp;gt; AllTrue[leftTrunc, PrimeQ],&lt;br /&gt;
   &amp;quot;RightTruncatable&amp;quot; -&amp;gt; AllTrue[rightTrunc, PrimeQ]&lt;br /&gt;
  }&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
(* Execute analysis *)&lt;br /&gt;
leftTruncatable = FindAllLeftTruncatablePrimes[];&lt;br /&gt;
rightTruncatable = ShrinkablePrimes[];&lt;br /&gt;
doublyTruncatable = FindDoublyTruncatablePrimes[];&lt;br /&gt;
&lt;br /&gt;
(* Results *)&lt;br /&gt;
{&lt;br /&gt;
 &amp;quot;LeftTruncatableCount&amp;quot; -&amp;gt; Length[leftTruncatable],&lt;br /&gt;
 &amp;quot;RightTruncatableCount&amp;quot; -&amp;gt; Length[rightTruncatable],&lt;br /&gt;
 &amp;quot;DoublyTruncatableCount&amp;quot; -&amp;gt; Length[doublyTruncatable],&lt;br /&gt;
 &amp;quot;LargestLeftTruncatable&amp;quot; -&amp;gt; Max[leftTruncatable],&lt;br /&gt;
 &amp;quot;LargestRightTruncatable&amp;quot; -&amp;gt; Max[rightTruncatable],&lt;br /&gt;
 &amp;quot;AllDoublyTruncatable&amp;quot; -&amp;gt; doublyTruncatable&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[CSV Statistical Analysis using wolframscript]]&lt;br /&gt;
* [[Z^3 Mathematica Integration]]&lt;br /&gt;
* [[ZCubes/Prime Numbers Twins, Cousins, Sexy Primes]]&lt;/div&gt;</summary>
		<author><name>Virajp</name></author>
	</entry>
</feed>