A323532 Numbers k such that the decimal concatenation of the numbers from 1 up to k followed by digit reversals of the numbers from (k-1) down to 1 is a prime.
10, 586, 2219
Offset: 1
Examples
10 is a term because 12345678910987654321 is a prime. 2219 is a term because 1...22172218221981227122...1 is a 15534-digit probable prime (where 8122 following 2219 corresponds to the digit reversal of 2218, 7122 to that of 2217, etc. down to 1).
Links
- N. J. A. Sloane, The On-Line Encyclopedia of Integer Sequences, Notices, Amer. Math. Soc., 65 (No. 9, Oct. 2018), 1062-1074.
Crossrefs
Cf. A173426 (similar but different concatenation scheme).
Programs
-
Mathematica
a[n_]:=Block[{cn=Drop[FoldList[Append, {}, ToString/@Range@n], 2]}, ParallelMap[If[PrimeQ[FromDigits@@{#<>Reverse@StringReverse@Most@#}], Length@#, Nothing]&, cn]]; a[2300]
-
PARI
f(n) = eval(concat(vector(2*n-1, k, if(k<=n, Str(k), concat(apply(x->Str(x), Vecrev(digits(2*n-k)))))))); isok(n) = ispseudoprime(f(n)); \\ Michel Marcus, Jan 20 2019
Comments