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

A174414 a(n) is the smallest natural number k such that the concatenation (n+k)||k is a prime number.

Original entry on oeis.org

3, 1, 1, 3, 1, 1, 3, 3, 1, 9, 19, 1, 3, 1, 7, 3, 1, 1, 3, 1, 13, 17, 1, 1, 3, 1, 1, 3, 7, 1, 9, 1, 23, 3, 3, 19, 17, 7, 1, 3, 1, 1, 3, 21, 1, 11, 3, 1, 3, 7, 1, 9, 1, 7, 21, 1, 7, 3, 1, 7, 3, 1, 1, 3, 1, 17, 9, 1, 1, 3, 3, 7, 9, 1, 1, 9, 13, 7, 3, 1, 1, 3, 3, 11, 3, 7, 1, 27, 7, 1, 9, 3, 1, 9, 3, 1, 9, 1
Offset: 1

Views

Author

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

Keywords

Comments

The last digit of a(n) must be 1, 3, 7 or 9.
If n and 10^d+1 are not coprime, then a(n) cannot have d digits. - Robert Israel, Sep 16 2024

Examples

			43 = prime(14) = (3+1)||3, a(1) = 3
31 = prime(11) = (1+2)||1, a(2) = 1
41 = prime(13) = (1+3)||1, a(3) = 1
3413 = prime(480) = (13+21)||13, a(21) = 13
11527 = prime(1390) = (27+88)||27, a(88) = 27
Note cases where consecutive values of n give consecutive primes:
n=17: 181 = prime(42) = (1+17)||1, n=18: 191 = prime(43) = (1+18)||1
k=41: 421 = prime(82) = (1+41)||1, n=42: 431 = prime(83) = (1+42)||1
... are there infinitely many of such?
a(11) = 19, 3019 is a resulting "candidate" for n = 301 - 9 = 292, but a(292) = 3 gives 2953 = prime(425)
First twice resulting prime is 5623 = prime(739) = (23+33)||23 = 5623 = (559+3)||3
		

References

  • Theo Kempermann, Zahlentheoretische Kostproben, Harri Deutsch, 2. aktualisierte Auflage 2005.
  • Helmut Kracke, Mathe-musische Knobelisken, Dümmler Bonn, 2. Auflage 1983.
  • Hugo Steinhaus, Studentenfutter, Urania-Verlag Leipzig-Jena-Berlin, 1991.

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:
    map(f, [$1..100]); # Robert Israel, Sep 16 2024
  • PARI
    a(n) = my(k=1); while (!isprime(eval(concat(Str(n+k), Str(k)))), k++); k; \\ Michel Marcus, Sep 17 2024
    
  • Python
    from itertools import count
    from math import gcd
    from sympy import isprime
    def A174414(n):
        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):
                        return k
                    a += m+1 # Chai Wah Wu, Sep 18 2024

Formula

a(n) = 1 for n > 1 in A126785.

Extensions

Edited and corrected by Robert Israel, Sep 16 2024

A126332 Numbers k such that 10k + 13 is prime.

Original entry on oeis.org

0, 1, 3, 4, 6, 7, 9, 10, 15, 16, 18, 21, 22, 25, 27, 28, 30, 34, 36, 37, 42, 43, 45, 49, 51, 55, 58, 60, 63, 64, 66, 67, 72, 73, 76, 81, 84, 85, 87, 94, 97, 100, 102, 105, 108, 109, 111, 114, 115, 118, 120, 121, 127, 129, 136, 141, 142, 144, 147, 148, 151, 153, 154, 157
Offset: 1

Views

Author

Parthasarathy Nambi, Mar 10 2007

Keywords

Examples

			For k = 100, 10*k + 13 = 1013 (prime).
		

Crossrefs

Programs

Formula

a(k) = A102338(k+1) - 1. - R. J. Mathar, Jul 08 2009
Showing 1-2 of 2 results.