A326398 a(n) is the smallest k > 0 such that the concatenation prime(n)k is composite.
1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1
Offset: 1
Examples
a(1) = 1 because 21 is prime, a(2) = 2 because 31 is prime (as 3 is in A023237), and 32 is composite
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10000
Programs
-
Maple
P := proc (n) if isprime(10*ithprime(n)+1) then return 2 else 1; end if: end proc; P(50); seq(P(k), k = 1 .. 50);
-
Mathematica
Table[k = 1; p = Prime[n]; While[PrimeQ[10^IntegerLength[k]*p + k], k++]; k, {n, 120}] (* Michael De Vlieger, Jun 30 2025 *)
-
PARI
a(n) = my(k=1, p=Str(prime(n))); while (isprime(eval(concat(p, Str(k)))), k++); k; \\ Michel Marcus, Jun 07 2020
Formula
a(n) = 2 if prime(n) is in A023237, else a(n) = 1. [corrected by Chai Wah Wu, Jul 06 2020]
Comments