OFFSET
1,2
COMMENTS
Leading zeros are ignored.
This sequence is a self-inverse permutation of the positive integers (for any positive number v, there are infinitely many prime numbers starting with 10*v+1, so infinitely many prime numbers that are the concatenation of v and some other positive integer).
There is only one fixed point: a(1) = 1.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..16384
Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^14, showing a(n) coprime to 10 in red and other numbers in dark blue.
Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^10, showing primes in red, composite prime powers in gold, squarefree composites in dark green, and other numbers in blue, showing powerful numbers that are not prime powers in light blue.
Mathematics StackExchange, Proof that there are infinitely many prime numbers starting with a given digit string
Rémy Sigrist, PARI program
EXAMPLE
The first terms, alongside the corresponding prime numbers, are:
n a(n) Corresponding prime numbers
-- ---- ---------------------------
1 1 {11}
2 3 {23}
3 2 {23}
4 7 {47}
5 9 {59}
6 13 {613}
7 4 {47}
8 11 {811}
9 5 {59}
10 19 {1019}
11 8 {811}
12 17 {1217}
MATHEMATICA
nn = 120; c[_] := False; a[1] = 1; c[1] = True; u = 2; Q[n_] := AnyTrue[{FromDigits[Join[d, #]], FromDigits[Join[#, d]]} & @@ {IntegerDigits[n], d}, PrimeQ]; Do[Set[{k, d}, {u, IntegerDigits[n]}]; While[Nand[! c[k], Q[k]], k++]; Set[{a[n], c[k]}, {k, True}]; If[k == u, While[c[u], u++]], {n, 2, nn}]; Array[a, nn] (* Michael De Vlieger, Jan 21 2023 *)
PROG
(PARI) See Links section.
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jan 20 2023
STATUS
approved