cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A326398 a(n) is the smallest k > 0 such that the concatenation prime(n)k is composite.

This page as a plain text file.
%I A326398 #63 Jul 01 2025 01:03:17
%S A326398 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,
%T A326398 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,
%U A326398 1,2,1,1,2,1,1
%N A326398 a(n) is the smallest k > 0 such that the concatenation prime(n)k is composite.
%C A326398 a(n) can only be 1 or 2 for any n >= 1. It appears that there are many more primes for which k = 1 than those for which k = 2 (~ 91%  of the first 10^7 primes have k = 1).
%H A326398 Michael De Vlieger, <a href="/A326398/b326398.txt">Table of n, a(n) for n = 1..10000</a>
%F A326398 a(n) = 2 if prime(n) is in A023237, else a(n) = 1. [corrected by _Chai Wah Wu_, Jul 06 2020]
%e A326398 a(1) = 1 because 21 is prime, a(2) = 2 because 31 is prime (as 3 is in A023237), and 32 is composite
%p A326398 P := proc (n)
%p A326398 if isprime(10*ithprime(n)+1) then return 2 else 1;
%p A326398 end if:
%p A326398 end proc;
%p A326398 P(50);
%p A326398 seq(P(k), k = 1 .. 50);
%t A326398 Table[k = 1; p = Prime[n]; While[PrimeQ[10^IntegerLength[k]*p + k], k++]; k, {n, 120}] (* _Michael De Vlieger_, Jun 30 2025 *)
%o A326398 (PARI) a(n) = my(k=1, p=Str(prime(n))); while (isprime(eval(concat(p, Str(k)))), k++); k; \\ _Michel Marcus_, Jun 07 2020
%Y A326398 Cf. A000040, A023237.
%K A326398 nonn,base
%O A326398 1,2
%A A326398 _David James Sycamore_, Jun 07 2020