Ponder This

Welcome to our monthly puzzles.
You are cordially invited to match wits with some of the best minds in IBM Research.

January 2022 - Challenge

<< December February >>


Forming primes in digit circles
The following riddle was suggested by Evert van Dijken.

Seven distinct digits are places on a circle. Then, numbers can be formed in the following manner: Choose one digit to start from and add it to the number, and then move a certain number of steps on the circle either clockwise or counterclockwise. Add the digit to the number, and keep this until five digits were chosen. These digits comprise the number (the first digit being the most significant digit).
For example, in the circle [4, 7, 3, 6, 2, 0, 1]:

One can start from "2", move 3 steps clockwise to "4", move one step counterclockwise to "1", move one more step counterclockwise to "0", and move 4 steps clockwise to "3", resulting in the number "24103".

Given a circle, we assign a score to each number that can be generated from the circle based on the minimum number of steps required to generate this number. In the example above, moving from "0" to "3" in 4 steps is not optimal; one can move just 3 steps by going counterclockwise. So the score of "24103" is 3+1+1+3=8.

We allow generation only of the numbers that satisfy all the following criterions:
1. Prime numbers.
2. All the digits are distinct.
3. No leading 0.

For a given circle, we can form all the numbers that satisfy the criterion and sum their scores.
For the circle [4, 7, 3, 6, 2, 0, 1] we will find 231 total primes with 5 distinct digits, giving us a total score of 1882. This 1882 is the score of the circle itself.

In our example we had n=7 digits in a circle and the numbers had d=5 digits but we can also generalize for different values of n,d (if n > 10, we can use a different number base, but we won't do it here).

Your goal: Find circles giving the maximum and minimum score for the original n=7, d=5 setting.
Send your result in the following format:
[a1, a2, ..., an]
[b1, b2, ..., bn]

A bonus "*" will be given for finding circles giving the maximum and minimum score for n=8, d=6.




We will post the names of those who submit a correct, original solution! If you don't want your name posted then please include such a statement in your submission!

We invite visitors to our website to submit an elegant solution. Send your submission to the ponder@il.ibm.com.

If you have any problems you think we might enjoy, please send them in. All replies should be sent to: ponder@il.ibm.com

 

Challenge: 05/01/2022 @ 12:00 PM EST
Solution: 04/02/2022 @ 12:00 PM EST
List Updated: 06/02/2022 @ 12:00 PM EST

People who answered correctly:

Lorenz Reichel (5/1/2022 4:40 PM IDT)
*Daniel Chong Jyh Tar (5/1/2022 5:29 PM IDT)
*Lazar Ilic (5/1/2022 7:10 PM IDT)
Balakrishnan Varadarajan (5/1/2022 7:59 PM IDT)
*Hugh Coleman (5/1/2022 8:16 PM IDT)
*Guillaume Escamocher (5/1/2022 9:40 PM IDT)
*Dan Dima (5/1/2022 9:58 PM IDT)
*David McCullars (5/1/2022 11:33 PM IDT)
*Todd Will (6/1/2022 12:32 AM IDT)
*Dieter Beckerle (6/1/2022 1:30 AM IDT)
*Alper Halbutogullari (6/1/2022 1:50 AM IDT)
*Bert Dobbelaere (6/1/2022 1:59 AM IDT)
*Phil Proudman (6/1/2022 4:14 AM IDT)
*Victor Chang (6/1/2022 5:56 AM IDT)
*Alexander Gramolin (6/1/2022 7:15 AM IDT)
*Reiner Martin (6/1/2022 11:36 AM IDT)
*Christofer Ohlsson (6/1/2022 11:47 AM IDT)
*Stéphane Higueret (6/1/2022 11:47 AM IDT)
*Paul Shaw (6/1/2022 12:43 PM IDT)
*Sanandan Swaminathan (6/1/2022 12:59 PM IDT)
Giorgos Kalogeropoulos (6/1/2022 3:52 PM IDT)
Graham Hemsley (6/1/2022 4:39 PM IDT)
*Paul Revenant (6/1/2022 5:13 PM IDT)
*Bertram Felgenhauer (6/1/2022 5:14 PM IDT)
*Amos Guler (6/1/2022 5:15 PM IDT)
*Gary M. Gerken (6/1/2022 9:45 PM IDT)
*Thomas Egense (6/1/2022 10:59 PM IDT)
*Andreas Stiller (7/1/2022 12:45 AM IDT)
*Kennedy (7/1/2022 6:54 AM IDT)
*Chris Shannon (7/1/2022 7:24 AM IDT)
*Maksym Voznyy (7/1/2022 7:37 AM IDT)
Michael Liepelt (7/1/2022 8:50 AM IDT)
Collin Pearce (7/1/2022 10:38 AM IDT)
*Evert van Dijken (7/1/2022 12:27 PM IDT)
*Tim Walters (8/1/2022 1:17 AM IDT)
*Keith Schneider (8/1/2022 9:21 AM IDT)
Alex Fleischer (8/1/2022 10:07 AM IDT)
*Stancu Mihai (8/1/2022 2:59 PM IDT)
*Sergey Subbotin (8/1/2022 5:11 PM IDT)
*Clive Tong (9/1/2022 1:06 AM IDT)
*Sreeram Ramachandran (9/1/2022 4:11 AM IDT)
Ananda Raidu (9/1/2022 12:18 PM IDT)
*Thomas Pircher (9/1/2022 2:47 PM IDT)
*Mathias Schenker (9/1/2022 8:46 PM IDT)
Fabio Michele Negroni (9/1/2022 10:35 PM IDT)
*Daniel Bitin (9/1/2022 11:30 PM IDT)
*Walter Sebastian Gisler (9/1/2022 11:48 PM IDT)
*Fabio Filatrella (10/1/2022 1:01 AM IDT)
*Suryaprasad Kareenahalli (10/1/2022 5:09 PM IDT)
*Nicolas Lopez (10/1/2022 6:45 PM IDT)
*Kai Guttmann (10/1/2022 9:43 PM IDT)
*Christoph Schmidt (10/1/2022 11:38 PM IDT)
*Franciraldo Cavalcante (11/1/2022 1:26 AM IDT)
*Marcelo De Barros (11/1/2022 3:26 AM IDT)
*Serino Dario (11/1/2022 1:21 PM IDT)
John Goh (11/1/2022 4:35 PM IDT)
*Sri Mallikarjun J (11/1/2022 6:46 PM IDT)
*Tamir Ganor & Shouky Dan (12/1/2022 10:57 AM IDT)
*Marco Bellocchi (12/1/2022 10:58 AM IDT)
Peter Moser (12/1/2022 11:26 AM IDT)
*Tomer Vromen (12/1/2022 4:30 PM IDT)
*Nyles Heise (13/1/2022 4:17 AM IDT)
*Phong Kah Ho (13/1/2022 9:04 AM IDT)
*Vladimir Volevich (13/1/2022 1:05 PM IDT)
*Carlos Alcoba Pinto (13/1/2022 8:11 PM IDT)
*Latchezar Christov (13/1/2022 8:46 PM IDT)
Jordan Rinder (13/1/2022 9:54 PM IDT)
*Chuck Carroll (14/1/2022 4:22 AM IDT)
*Tom K (14/1/2022 12:09 PM IDT)
*Dominik Reichl (14/1/2022 6:12 PM IDT)
Shirish Chinchalkar (16/1/2022 3:38 AM IDT)
Albert Stadler (16/1/2022 10:36 AM IDT)
Anunay Kulshrestha (16/1/2022 11:57 AM IDT)
*David Greer (16/1/2022 3:01 PM IDT)
Sachal Mahajan (17/1/2022 12:05 AM IDT)
Dan Ismailescu (17/1/2022 6:54 AM IDT)
Aaron Kim (17/1/2022 6:05 PM IDT)
*Grace Park (17/1/2022 8:18 PM IDT)
Li Li (18/1/2022 2:52 AM IDT)
*Aviv Nisgav (18/1/2022 11:33 AM IDT)
Elliot Hong (20/1/2022 2:44 AM IDT)
*Aaron Zolnai-Lucas (20/1/2022 3:32 AM IDT)
Prashant Mukul (20/1/2022 8:48 AM IDT)
*HC Zhu (20/1/2022 9:40 AM IDT)
Andy Greig (20/1/2022 8:00 PM IDT)
*Samantha Casanova (20/1/2022 11:55 PM IDT)
*Emir Haleva (21/1/2022 8:11 AM IDT)
*Quentin Higueret (21/1/2022 1:59 PM IDT)
*Hamidreza Bidar (21/1/2022 7:50 PM IDT)
Jessica Lee (22/1/2022 7:58 PM IDT)
Joonbeom Kwon (22/1/2022 9:05 PM IDT)
Keun Hyong Kwak (22/1/2022 9:56 PM IDT)
*Sanjay Rao (23/1/2022 3:21 PM IDT)
*Walter Schmidt (25/1/2022 8:33 AM IDT)
*Arunkumar Pandian (25/1/2022 2:14 PM IDT)
Benson Tran (25/1/2022 6:58 PM IDT)
Théo HENAFF (26/1/2022 10:32 AM IDT)
*Gaétan Berthe (26/1/2022 3:53 PM IDT)
Diógenes Figueroa (26/1/2022 4:12 PM IDT)
*Lavanya Kannan (26/1/2022 8:44 PM IDT)
Ryan Belfer (27/1/2022 1:54 AM IDT)
Faiyaz Saraf (27/1/2022 6:59 PM IDT)
Max Herman (28/1/2022 6:00 PM IDT)
*Motty Porat (29/1/2022 1:33 AM IDT)
Rajeev Choudhari (29/1/2022 3:27 AM IDT)
*Kang Jin Cho (29/1/2022 7:38 PM IDT)
*Alexander Marschoun (30/1/2022 1:27 AM IDT)
*Soham Sud (30/1/2022 4:13 PM IDT)
*Marti Bosch (30/1/2022 8:49 PM IDT)
Joon Park (31/1/2022 7:10 AM IDT)
*Noam Nisgav (1/2/2022 1:11 AM IDT)
*Austin Lee (1/2/2022 2:24 AM IDT)
Erik Wünstel (2/2/2022 5:39 PM IDT)
Radu-Alexandru Todor (3/2/2022 3:55 AM IDT)
Elisabeth Bourgeois (4/2/2022 1:34 AM IDT)
*Armin Krauss (4/2/2022 1:27 PM IDT)
Michael Schneider (4/2/2022 4:29 PM IDT)
*Andy Greig (4/2/2022 7:53 PM IDT)
Michael Schneider (4/2/2022 11:45 PM IDT)
*Yusuf Bashi (6/2/2022 1:36 AM IDT)