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.

A375553 a(n) is the smallest prime q such that the concatenation (p + q)"q is a prime number, where p = prime(n).

This page as a plain text file.
%I A375553 #30 Sep 24 2024 19:50:30
%S A375553 3,7,3,3,19,3,31,3,3,7,11,17,3,3,3,3,13,3,29,3,23,3,3,7,41,7,3,3,3,3,
%T A375553 3,31,7,3,3,3,11,3,7,19,3,11,7,11,3,11,3,23,7,47,19,3,23,3,7,3,7,11,3,
%U A375553 3,11,3,23,7,3,3,3,29,7,11,7,3,11,23,3,3,3,3,13
%N A375553 a(n) is the smallest prime q such that the concatenation (p + q)"q is a prime number, where p = prime(n).
%C A375553 Conjecture: The image of this sequence joined with {2, 5} are the prime numbers, {2, 5} union imag(a) = P.
%H A375553 Sam Sweet, <a href="/A375553/b375553.txt">Table of n, a(n) for n = 1..500</a>
%p A375553 P := select(isprime, [seq(2..405)]):
%p A375553 g := p -> local q;
%p A375553    for q in P do
%p A375553        if isprime(q + (p + q)*10^(1 + ilog10(q))) then return q fi
%p A375553    od:
%p A375553 map(g, P);
%t A375553 spq[p_]:=Module[{k=2},While[!PrimeQ[(p+k)*10^IntegerLength[k]+k],k=NextPrime[k]];k]; Table[spq[p],{p,Prime[Range[80]]}] (* _Harvey P. Dale_, Sep 24 2024 *)
%o A375553 (SageMath)
%o A375553 def f(p):
%o A375553     for q in Primes():
%o A375553         if is_prime(q + (p + q)*10^(1 + int(log(q, 10)))): return q
%o A375553 print([f(p) for p in prime_range(405)])
%o A375553 (PARI)
%o A375553 a(n) = my(k=2); while (!isprime(eval(concat(Str(prime(n)+k), Str(k)))), k = nextprime(k+1)); k; \\ _Michel Marcus_, Sep 17 2024
%o A375553 (Python)
%o A375553 from itertools import count
%o A375553 from sympy import prime, isprime, nextprime
%o A375553 def A375553(n):
%o A375553     p, q, m = prime(n), 2, 10
%o A375553     for l in count(1):
%o A375553         while q<m:
%o A375553             if isprime(m*(p+q)+q):
%o A375553                 return q
%o A375553             q = nextprime(q)
%o A375553         m *= 10 # _Chai Wah Wu_, Sep 18 2024
%Y A375553 Cf. A000040, A375552, A174414.
%K A375553 nonn,base
%O A375553 1,1
%A A375553 _Peter Luschny_, Sep 17 2024