|
|
A350153
|
|
Prime numbers created by concatenating all numbers 1 through k for some k > 1, then continuing to concatenate all numbers from k-1 towards 1. Primes are added to the sequence as they are found as k increases.
|
|
1
|
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
A173426(n) is the concatenation of all numbers from 1 up to k and then back down to 1. The prime terms of A173426 have been called "memorable primes" (see the Numberphile video). These "unmemorable primes" are a superset created by concatenating 1..k in ascending order followed by concatenating the numbers k-1..1 in descending order. Any primes found during either concatenation process are added to the sequence (e.g., k = 5, 1234543 is included. If 12345 were prime, it would be included as well).
|
|
LINKS
|
|
|
EXAMPLE
|
For k=10, the first prime obtained by concatenating the numbers 1..10 and then concatenating the first one or more numbers from 9..1 is 12345678910987.
|
|
MAPLE
|
select(isprime, [seq(seq(parse(cat($1..n, n-i$i=1..t)),
|
|
MATHEMATICA
|
lst={}; Table[s=Flatten[IntegerDigits/@Range@n]; k=n-1;
While[k!=-1, If[PrimeQ[p=FromDigits@s], AppendTo[lst, p]]; s=Join[s, IntegerDigits@k]; k--], {n, 100}]; lst (* Giorgos Kalogeropoulos, Dec 17 2021 *)
|
|
PROG
|
(Python)
from itertools import count, chain, islice, accumulate
from sympy import isprime
def A350153gen(): return filter(lambda p:isprime(p), (int(s) for n in count(1) for s in accumulate(str(d) for d in chain(range(1, n+1), range(n-1, 0, -1)))))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|