RECREATIONAL MATHEMATICS

Embedded Palindromic Prime Tree Generator

Created by Inder J. Taneja

Start with a prime and keep every prime child formed by adding a block on its right and the reversed block on its left. Each level branches to qualifying prime children within your limits. Adaptive mode uses the shortest successful block length for each parent.

reverse(i) | parent | i → prime child

A palindromic seed makes palindromic descendants. A nonpalindromic seed makes symmetric outer digits without making the whole number a palindrome.

Example · A branching prime tree from 101

Start with the palindromic prime 101. One-digit blocks give two prime children: 3 | 101 | 3 = 31013 and 9 | 101 | 9 = 91019. Explore each branch separately.

Branch 1 · Two digits are enough

101 → 31013 → 933101339
93 | 31013 | 39 = 933101339

Block 39 produces a prime child, so this parent uses two-digit blocks.

Branch 2 · Try a longer block

101 → 91019 → 11191019111
111 | 91019 | 111 = 11191019111

No permitted two-digit block works for 91019. Adaptive mode tries three digits and finds block 111, among other prime children.

Every number in these two sample paths is a palindromic prime. The full tree keeps multiple prime children, subject to the selected limits.

Use seed 101, allowed digits 1234789, Adaptive block length, maximum block length 3, and 3 levels to explore this example and its further branches. Gold marks the added blocks; the vertical bars separate blocks and are not digits.

The seed is level 0. All branches are explored by level.
Use 1–9 and optionally 0; the block cannot start with 0.
Upper limit for candidate blocks.
Adaptive: one digit first; afterward, try two digits and increase the length only when a parent has no prime child.
Limits breadth; children are kept in increasing block order.
Downloads include all completed seed trees.
Every displayed prime is verified by a deterministic test below 264. Branches beyond that range or the selected limits are omitted and the tree is marked limited. A nonprime seed is shown as level 0, with only prime children included afterward.
Choose settings, then generate.

References

  1. Inder J. Taneja, Embedded Palindromic Prime Numbers-I, RGMIA Research Report Collection, 20 (2017), pp. 1–86. RGMIA ↗
  2. Inder J. Taneja, Same Digits Embedded Palprimes of Lengths 3, 5 and 7, Zenodo, August 8, 2020, pp. 1–315. doi:10.5281/zenodo.3977028 ↗
  3. Inder J. Taneja, 3 and 5-Digits Multiple Choice Embedded Palprimes, Zenodo, December 5, 2020, pp. 1–511. doi:10.5281/zenodo.4307875 ↗