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.

Showing 1-1 of 1 results.

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

Original entry on oeis.org

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, 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, 3, 11, 3, 23, 7, 3, 3, 3, 29, 7, 11, 7, 3, 11, 23, 3, 3, 3, 3, 13
Offset: 1

Views

Author

Peter Luschny, Sep 17 2024

Keywords

Comments

Conjecture: The image of this sequence joined with {2, 5} are the prime numbers, {2, 5} union imag(a) = P.

Crossrefs

Programs

  • Maple
    P := select(isprime, [seq(2..405)]):
    g := p -> local q;
       for q in P do
           if isprime(q + (p + q)*10^(1 + ilog10(q))) then return q fi
       od:
    map(g, P);
  • Mathematica
    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 *)
  • PARI
    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
    
  • Python
    from itertools import count
    from sympy import prime, isprime, nextprime
    def A375553(n):
        p, q, m = prime(n), 2, 10
        for l in count(1):
            while qChai Wah Wu, Sep 18 2024
  • SageMath
    def f(p):
        for q in Primes():
            if is_prime(q + (p + q)*10^(1 + int(log(q, 10)))): return q
    print([f(p) for p in prime_range(405)])
    
Showing 1-1 of 1 results.