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.
12343, 1234543, 12345678910987, 12345678910987654321, 12345678910111213141516171819202122212019181716151413, 12345678910111213141516171819202122232425262728293029
Offset: 1
Examples
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.
Links
- Patrick Quam, Table of n, a(n) for n = 1..29
- Brady Haran and N. J. A. Sloane, The Most Wanted Prime Number, Numberphile video (2021).
Programs
-
Maple
select(isprime, [seq(seq(parse(cat($1..n, n-i$i=1..t)), t=0..n-1), n=1..30)])[]; # Alois P. Heinz, Dec 19 2021
-
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 *)
-
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))))) A350153_list = list(islice(A350153gen(),20)) # Chai Wah Wu, Dec 20 2021
Comments