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-4 of 4 results.

A341715 a(n) = smallest prime of the form n||n+1||n+2||...||n+k, where || denotes decimal concatenation, or -1 if no such prime exists.

Original entry on oeis.org

2, 3, 4567, 5, 67, 7, 89
Offset: 2

Views

Author

N. J. A. Sloane, Feb 21 2021

Keywords

Comments

a(1) is unknown, but is believed to exist (see A007908). The corresponding value of k, if it exists, is known to be at least 300000, so in any case this prime would be too large to include in an OEIS entry, which is why this sequence has offset 2.
a(9) = 9||10||...||187 (see Example section), but that is too large to show in the data field. a(A030457(n)) = A030457(n)||A030457(n)+1 and k = 1 for n > 1. If m is in A030470 but not in A030457, then a(m) = m||m+1||m+2||m+3 and k = 3. Of course a(p) = p and k = 0 for p prime. - Chai Wah Wu, Feb 22 2021
For the corresponding values of k and n+k, see A341716 and A341717.
See also A140793 = (23, 345...109, 4567, 567...17, ...), A341720, and A084559 for the variant with k >= 1, so that a(n) > n also for prime n. - M. F. Hasler, Feb 22 2021

Examples

			Starting at 12, 13, 14, 15, 17, 19, 20 we get the primes 1213, 13, 14151617, 1516171819, 17, 19, 20212223, which are all terms of this sequence.
Here is a(9) from _Chai Wah Wu_, Feb 22 2021, a 445-digit number:
910111213141516171819202122232425262728293031323334353637383940414243444546\
    47484950515253545556575859606162636465666768697071727374757677787980818\
    28384858687888990919293949596979899100101102103104105106107108109110111\
    11211311411511611711811912012112212312412512612712812913013113213313413\
    51361371381391401411421431441451461471481491501511521531541551561571581\
    59160161162163164165166167168169170171172173174175176177178179180181182\
    183184185186187
a(16) = 16||17||...||43 is prime. Also for a(10), I searched up to k <= 10000, so if it exists it will have tens of thousands of decimal digits. Some other big terms are: for n = 18, k = 3589; for n = 35, k = 568; for n = 66, k = 937; for n = 275, k = 814.  - _Chai Wah Wu_, Feb 22 2021
		

Crossrefs

If k in the definition is allowed to be zero we get [the present sequence, A341716, A341717], but if we require k>0 we get [A140793, A341720, A084559].
See A075022 for the largest prime factor of 1||2||...||n.

Programs

  • Mathematica
    Array[Block[{k = #, s = #}, While[! PrimeQ[s], k++; s = FromDigits[IntegerDigits[s]~Join~IntegerDigits[k]]]; s] &, 8, 2] (* Michael De Vlieger, Feb 22 2021 *)
  • PARI
    A341715(n)=if(isprime(n),n,eval(concat([Str(k)|k<-[n..A084559(n)]]))) \\ M. F. Hasler, Feb 22 2021
  • Python
    from sympy import isprime
    def A341715(n):
        m, k = n, n
        while not isprime(m):
            k += 1
            m = int(str(m)+str(k))
        return m # Chai Wah Wu, Feb 22 2021
    

Formula

a(n) = concatenate(n, ..., A084559(n)) or a(n) = n if n is prime. - M. F. Hasler, Feb 22 2021

A341717 a(n) = smallest m >= n such that the decimal concatenation n||n+1||n+2||...||m is prime, or -1 if no such prime exists.

Original entry on oeis.org

2, 3, 7, 5, 7, 7, 9, 187
Offset: 2

Views

Author

N. J. A. Sloane, Feb 22 2021

Keywords

Comments

These are the values of n+k from A341715. See that entry for more information.
See A084559 (the same for nonprime indices) for further information. - M. F. Hasler, Feb 22 2021
Suppose n > 3. If n == 2 (mod 3), then a(n) == 3 or 5 (mod 6). If n = 0 or 1 (mod 3), then a(n) == 1 (mod 6) (see A341716). - Chai Wah Wu, Feb 22 2021

Crossrefs

Programs

  • Mathematica
    Array[Block[{k = #, s = #}, While[! PrimeQ[s], k++; s = FromDigits[IntegerDigits[s]~Join~IntegerDigits[k]]]; k] &, 8, 2] (* Michael De Vlieger, Feb 22 2021 *)
  • PARI
    A341717(n)=if(isprime(n), n, A084559(n)) \\ M. F. Hasler, Feb 22 2021

Formula

a(n) = n iff n is prime, otherwise a(n) = A084559(n). - M. F. Hasler, Feb 22 2021

A341716 a(n) = smallest k such that the decimal concatenation n||n+1||n+2||...||n+k is prime, or -1 if no such prime exists.

Original entry on oeis.org

0, 0, 3, 0, 1, 0, 1, 178
Offset: 2

Views

Author

N. J. A. Sloane, Feb 22 2021

Keywords

Comments

These are the values of k from A341715. See that entry for more information.
From Chai Wah Wu, Feb 22 2021: (Start)
Theorem: For n > 1, a(n)+n is odd. If a(n) > 0, then a(n) !== 2 (mod 3) and a(n)+2n !== 0 (mod 3).
Proof: For n > 1, n||n+1||...||n+k needs to be odd to be prime, i.e., n+k is odd. n||n+1||...||n+k can be written as x+y where x = n||n||...||n||n and y = 1||0...2||...||0...k. The only exception is when n+i has more decimal digits than n for some i <= k in which case there are some extra zeros inserted into x and y.
In any case x is divisible by n and by 10..10..1 whose digit sum is k+1, i.e., x == n*(k+1) (mod 3).
Similarly the sum of digits of y mod 3 == Sum_{i=1..k} (i mod 3) == (Sum_{i=1..k} i) == k(k+1)/2 (mod 3). This means that x+y == (k+1)(k+2n)/2 (mod 3). If either k+1 or k+2n is a multiple of 3, then x+y is a multiple of 3. We know x+y > 3 since a(n) > 0 and thus x+y is not a prime.
Corollary: Suppose n > 3. If n == 0 (mod 6), then a(n) == 1 (mod 6). If n == 1 (mod 6), then a(n) == 0 (mod 6). If n == 2 (mod 6), then a(n) == 1 or 3 (mod 6). If n == 3 (mod 6), then a(n) == 4 (mod 6). If n == 4 (mod 6), then a(n) == 3 (mod 6). If n == 5 (mod 6), then a(n) == 0 or 4 (mod 6).
(End)

Crossrefs

Formula

a(n) = 0 iff n is prime, otherwise a(n) = A084559(n)-n. - M. F. Hasler, Feb 22 2021

A341720 a(n) = smallest k > 0 such that the decimal concatenation n||n+1||n+2||...||n+k is prime, or -1 if no such prime exists.

Original entry on oeis.org

1, 16, 3, 12, 1, 6, 1, 178
Offset: 2

Views

Author

N. J. A. Sloane, Feb 24 2021

Keywords

Comments

If they exist, a(10) > 22496; a(21)-a(22) > 17510; a(24) > 15696; a(27) > 13641; a(29)-a(32), a(40), a(41), a(43), a(45), a(46)-a(48) > 7000; a(52) > 16359; a(54) > 16458; a(55) > 14261; a(60) > 19920; a(61) > 9029; a(11) = 298, a(12) = 1, a(13) = 7284, a(14) = 3, a(15) = 4, a(16) = 27, a(17) = 22, a(18) = 3589, a(19) = 1452, a(20) = 3, a(23) = 18, a(25) = 24, a(26) = 121, a(28) = 45, a(33) = 70, a(34) = 3, a(35) = 568, a(36) = 1, a(37) = 6, a(38) = 19, a(39) = 4, a(42) = 1, a(44) = 7, a(49) = 192, a(50) = 1, a(51) = 7228, a(53) = 430, a(56) = 1, a(57) = 4, a(58) = 3, a(59) = 18. - J.W.L. (Jan) Eerland, Feb 24 2023
If it exists, a(10) > 50000. - Michael S. Branicky, Aug 29 2024

Crossrefs

If k=0 is allowed we get the sequences [A341715, A341716, A341717], but if k must be at least 1 we get [A140793, the present sequence, A084559].

Programs

  • Mathematica
    Table[k=1;Monitor[Parallelize[While[True,If[PrimeQ[ToExpression[StringJoin[ToString/@Table[n+a,{a,0,k}]]]],Break[]];k++];k],k],{n,2,9}] (* J.W.L. (Jan) Eerland, Dec 22 2022 *)
  • PARI
    f(n,k) = my(s=Str(n)); for(i=1, k, s=concat(s, n+i)); eval(s);
    a(n) = my(k=1); while(!ispseudoprime(f(n,k)), k++); k; \\ Michel Marcus, Dec 22 2022
Showing 1-4 of 4 results.