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.

A375552 Yet unseen terms in the enumeration of A375553, prepended by [2, 5].

Original entry on oeis.org

2, 5, 3, 7, 19, 31, 11, 17, 13, 29, 23, 41, 47, 139, 61, 37, 53, 67, 59, 43, 89, 103, 109, 83, 73, 97, 79, 101, 71, 131, 167, 137, 107, 199, 163, 151, 191, 233, 113, 127, 227, 211, 179, 173, 239, 157, 193, 149, 181, 277, 313, 197, 223, 307, 251, 271, 331, 263, 241, 229, 349
Offset: 1

Views

Author

Peter Luschny, Sep 17 2024

Keywords

Comments

Conjecture: This is a permutation of the prime numbers.

Crossrefs

Programs

  • Maple
    aList := proc(upto) local P, p, q, Y; Y := 2,5;
       P := select(isprime, [seq(2..upto)]):
       for p in P do for q in P do
          if isprime(q+(p+q)*10^(1+ilog10(q))) then break fi od:
       if not member(q, [Y]) then Y := Y,q fi od;
    Y end: aList(100000);
  • Mathematica
    spq[p_] := Module[{k = 2}, While[!PrimeQ[(p + k)*10^IntegerLength[k] + k], k = NextPrime[k]]; k];
    Join[{2, 5}, DeleteDuplicates @ Table[spq[p], {p, Prime[Range[30000]]}]]
    (* Jean-François Alcover, Oct 01 2024, after Harvey P. Dale in A375553 *)
  • PARI
    f(n) = my(k=2); while (!isprime(eval(concat(Str(prime(n)+k), Str(k)))), k = nextprime(k+1)); k; \\ A375553
    lista(nn) = my(list=List()); listput(list, 2); listput(list, 5); for (n=1, nn, my(k=f(n)); if (#select(x->(x==k), Vec(list)) == 0, listput(list, k));); Vec(list); \\ Michel Marcus, Sep 17 2024
    
  • Python
    from itertools import count, islice
    from sympy import isprime, nextprime
    def A375552_gen(): # generator of terms
        p, a = 2, set()
        yield from (2,5)
        while True:
            q, m = 2, 10
            for l in count(1):
                while qA375552_list = print(list(islice(A375552_gen(),61))) # Chai Wah Wu, Sep 18 2024
  • SageMath
    from more_itertools import unique_everseen
    def f(p):
        for q in Primes():
            if is_prime(q + (p + q)*10^(1 + int(log(q, 10)))): return q
    a = lambda n: unique_everseen((f(p) for p in prime_range(n)))
    print([2, 5] + list(a(999)))