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-5 of 5 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)).

A376219 Positions of records in A174414.

Original entry on oeis.org

1, 10, 11, 33, 88, 132, 341, 505, 1111, 2828, 10504, 31512, 34138, 81103, 152207, 304414, 1378751, 2587519, 2757502, 5175038, 126845092, 486699103, 883779391, 973398206, 1857177597, 1942660159, 3095295995, 7307153656
Offset: 1

Views

Author

Robert Israel, Sep 16 2024

Keywords

Comments

Positive integers k such that the least m for which the concatenation (m+k)||m is prime is greater than it is for all previous k.
If k and 10^d+1 are not coprime, then A174414(k) can't have d digits.
Therefore, assuming A174414(n) always exists, it is unbounded and this sequence is infinite.

Examples

			a(3) = 11 because A174414(11) = 19 is greater than A174414(1),..., A174414(10).
		

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:
    J:= NULL: m:= 0:
    for n from 1 to 10^6 do
       v:= f(n);
       if v > m then m:= v; J:= J,n fi
    od:
    J;
  • Python
    from itertools import count, islice
    from math import gcd
    from sympy import isprime
    def A376219_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 n
                                c = k
                            break
                        a += m+1
                    else:
                        continue
                    break
    A376219_list = list(islice(A376219_gen(), 30)) # Chai Wah Wu, Sep 18 2024

Extensions

a(23)-a(28) from Chai Wah Wu, Sep 20 2024

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)))
    

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)])
    

A174583 a(k) is the least n such that the concatenation (n - k)"n is a prime number, for k >= 0.

Original entry on oeis.org

1, 3, 3, 7, 7, 17, 7, 9, 9, 11, 13, 17, 13, 19, 17, 19, 21, 21, 23, 27, 27, 23, 43, 33, 41, 27, 27, 29, 31, 33, 31, 33, 39, 47, 37, 39, 37, 39, 39, 41, 51, 47, 47, 61, 47, 49, 49, 53, 49, 51, 51, 59, 57, 57, 61, 57, 57, 61, 63, 63, 71, 63, 63, 67, 67, 77, 67, 69, 77, 71, 73, 77
Offset: 0

Views

Author

Ulrich Krug (leuchtfeuer37(AT)gmx.de), Mar 23 2010

Keywords

Comments

See comments and references for A174414.
10^d*(n - k) + n has to be prime for the least d-digit n > k (k >= 0).
For (n - k)"n to be a prime, n must end in the digit 1, 3, 7, or 9.
Conjecture: a(k) = a(k+1) for an infinite number of k's.
As n > k, the number of a(k) is finite, and can be easily bounded from above.
1, 11, ... appear only once in the sequence; 3, 9, 13, 19, 21, 23, ... appear twice; 7, 17, ... three times; and so on.
Does each n that ends in the digit 1, 3, 7, or 9 appear in this sequence?
Note this interesting observation that first occurs for k = 84: 9291013 = prime(620602) = (1013 - 84)"1013, a(84) = 1013. A second example is: 9381037 = prime(626219) = (1037 - 99)"1037.
Let k be a multiple of 7, 11, or 13, then no 3-digit n exists such that (n - k)"n is prime. Proof: 10^3*(n - k) + n = n * (10^3+1) - k * 10^3 = 7 * 11 * 13 * n - k * 10^3 is not prime, as k is a multiple of 7, 11, or 13.
Similar for k-digit n with given divisors and k > 3: 10^4 + 1 = 73 * 137, 10^5 + 1 = 11 * 9091.

Examples

			11 = prime(5) = (1 - 0)"1, thus a(0) = 1.
23 = prime(9) = (3 - 1)"3, thus a(1) = 3.
13 = prime(6) = (3 - 2)"3, thus a(2) = 3.
139 = prime(34) = (39 - 38)"39, thus a(38) = 39.
9109 = prime(1130) = (109 - 100)"109, thus a(100) = 109.
		

Crossrefs

Programs

  • Maple
    mycat := (k, n) -> parse(cat(convert(n - k, string), convert(n, string))):
    sol := (k, n) -> isprime(mycat(k, n)):
    a := proc(k) local n; for n from k + 1 while not sol(k, n) do od; n end:
    seq(a(k), k = 0..71);  # Peter Luschny, Sep 20 2024

Extensions

Edited, offset set to 0 and a(71) corrected by Peter Luschny, Sep 20 2024
Showing 1-5 of 5 results.