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.

A358318 For n >= 5, a(n) is the number of zeros that need to be inserted to the left of the ones digit of the n-th prime so that the result is composite.

This page as a plain text file.
%I A358318 #36 Dec 08 2022 07:37:14
%S A358318 2,2,2,4,1,1,1,2,3,1,1,3,3,2,3,5,1,2,1,3,5,1,1,1,3,3,1,3,3,1,4,1,1,1,
%T A358318 3,1,2,2,3,1,2,1,1,3,2,1,1,2,1,1,1,1,2,1,2,5,2,2,1,1,1,1,2,2,2,1,1,1,
%U A358318 6,1,2,2,1,2,2,1,1,2,1,1,1,1,2,3,1,2,1,1,1,1,3
%N A358318 For n >= 5, a(n) is the number of zeros that need to be inserted to the left of the ones digit of the n-th prime so that the result is composite.
%C A358318 Conjecture: the sequence is bounded.
%F A358318 If a(n) > 1 then a(pi(k)) = a(n) - 1 where k = 100*floor(p/10) + p mod 10 and p = prime(n) (i.e., k is the result when a single 0 is inserted to the left of the ones digit of p).
%e A358318 For n = 8, prime(8) is 19. 109, 1009, and 10009 are all primes, while 100009 is not, thus a(8) = 4.
%e A358318 For n = 30, prime(30) is 113. 1103 and 11003 are prime, while 110003 is not, thus a(30) = 3.
%t A358318 a[n_] := Module[{p = Prime[n], c = 1, q, r}, r = Mod[p, 10]; q = 10*(p - r); While[PrimeQ[q + r], q *= 10; c++]; c]; Array[a, 100, 5] (* _Amiram Eldar_, Nov 27 2022 *)
%o A358318 (Python)
%o A358318 from sympy import isprime, prime
%o A358318 def a(n):
%o A358318     s, c = str(prime(n)), 1
%o A358318     while isprime(int(s[:-1] + '0'*c + s[-1])): c += 1
%o A358318     return c
%o A358318 print([a(n) for n in range(5, 92)]) # _Michael S. Branicky_, Nov 09 2022
%o A358318 (PARI) a(n) = n=prime(n); for(i=1,oo, isprime(n=10*n-n%10*9) || return(i)); \\ _Kevin Ryde_, Dec 08 2022
%Y A358318 Cf. A000040, A344637.
%K A358318 nonn,base
%O A358318 5,1
%A A358318 _Rida Hamadani_, Nov 09 2022