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.

A376220 Record values in A174414.

Original entry on oeis.org

3, 9, 19, 23, 27, 37, 39, 107, 1007, 1041, 1047, 1051, 1073, 10000011, 10000047, 10000109, 1000000000000017, 1000000000000053, 1000000000000071, 1000000000000291, 1000000000000449, 10000000000000000000000000000113, 10000000000000000000000000000193, 10000000000000000000000000000249
Offset: 1

Views

Author

Robert Israel, Sep 16 2024

Keywords

Comments

Numbers m such that for some x, the concatenation (m+x)||m is prime, and for every j < x there is some k < m such that (k+j)||k is prime.

Examples

			a(3) = 19 because A376219(3) = 11 and A174414(11) = 19.  Thus 19 is the least k such that the concatenation (k+11)||k is prime, and for all j < 11 we have (k+j)||k prime for some k < 19.
		

Crossrefs

Programs

  • Maple
    tcat:= proc(a, b) a*10^(1+ilog10(b))+b end proc:
    f:= proc(n) local k, d;
        for d from 1 do
          if igcd(n, 10^d+1) > 1 then next fi;
          for k from 10^(d-1)+`if`(d=1, 0, 1) to 10^d by 2 do
            if isprime(tcat(n+k, k)) then return k fi
        od od
    end proc:
    R:= NULL: m:= 0:
    for n from 1 to 10^6 do
       v:= f(n);
       if v > m then m:= v; R:= R, m fi
    od:
    R;
  • Python
    from itertools import count, islice
    from math import gcd
    from sympy import isprime
    def A376220_gen(): # generator of terms
        c = 0
        for n in count(1):
            for l in count(1):
                if gcd(n,(m:=10**l)+1)==1:
                    r = m//10
                    a = m*(n+r)+r
                    for k in range(r,m):
                        if isprime(a):
                            if k>c:
                                yield k
                                c = k
                            break
                        a += m+1
                    else:
                        continue
                    break
    A376220_list = list(islice(A376220_gen(),22)) # Chai Wah Wu, Sep 19 2024

Formula

a(n) = A174414(A376219(n)).
Showing 1-1 of 1 results.