My diurnal age today is 27397 and this number is prime, marking the end of a 30 day drought of primes according to this daily reckoning. The previous prime, 27367, has a property that marks it for membership in OEIS A124596: primes \(p\) such that \(q-p = 30\), where \(q\) is the next prime after \(p\). So here we are at \(q=27397\).
Now this current prime is rather special because it has a property that marks it for membership in OEIS A215421:
A215421 | Primes that remain prime when a single digit 9 is inserted between any two consecutive digits or as the leading or trailing digit. |
I asked Gemini the following question (link):
Can you create a Python program that will generate as output the digit 9 inserted only once, but successively, between every digit of a number that is input. The insertion should take place at the beginning of the number and at the end of the number as well as the between all the digits. For example, if the number 783 was the input then the output would be 9783, 7983, 7893 and 7839.
To which the response was:
Absolutely, here's a Python program that achieves what you described:
This code defines a function insert_digit that takes an integer as input. Here's how it works:
This was very helpful and I was quickly able to incorporate the code into SageMathCell and generate the sequence (permalink). Without the comments, the Python code boils down to this:
def insert_digit(number):number_str = str(number)inserted_numbers = []for i in range(len(number_str) + 1):inserted_numbers.append("".join([number_str[:i], "9", number_str[i:]]))return inserted_numbers
A069246 | Primes which yield a prime whenever a 1 is inserted anywhere in them (including at the beginning or end). |
A215419 | Primes that remain prime when a single digit 3 is inserted between any two consecutive digits or as the leading or trailing digit. |
Up to 40000, the initial members of this sequence are (permalink):
7, 11, 17, 31, 37, 73, 271, 331, 359, 373, 673, 733, 1033, 2297, 3119, 3461, 3923, 5323, 5381, 5419, 6073, 6353, 9103, 9887, 18289, 23549, 25349, 31333, 32933, 33349, 35747, 37339, 37361, 37489
A215420 | Primes that remain prime when a single digit 7 is inserted between any two consecutive digits or as the leading or trailing digit. |
No comments:
Post a Comment