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

A030670 Smallest prime formed by appending a number to the n-th prime.

Original entry on oeis.org

23, 31, 53, 71, 113, 131, 173, 191, 233, 293, 311, 373, 419, 431, 479, 5323, 593, 613, 673, 719, 733, 797, 839, 8923, 971, 1013, 1031, 10711, 1091, 11311, 1277, 1319, 1373, 1399, 1493, 1511, 1571, 1637, 16729, 1733, 17911, 1811, 1913, 1931
Offset: 1

Views

Author

Keywords

Comments

Previous name: Smallest prime whose decimal expansion begins (nontrivially) with the n-th prime.
Add digits to p (starting with a nonzero digit) until another prime is reached.
This differs from A064792 in that there the appended digits may start with a 0. The first difference occurs at a(16) = 5323, while A064792(16) = 5303. - M. F. Hasler, Jan 15 2025

Examples

			a(16) = 5323 because 53 is the 16th prime, and 23 is the smallest number that can be appended to 53 to give another prime. 5303 is not allowed because 03 starts with zero. - _David Radcliffe_, Jan 08 2025
		

Crossrefs

See A064792 for another version. Note that A064792 <= a(n). Cf. A065112, A178220.

Programs

  • Maple
    f:= proc(p) local d,x;
      for d from 1 do
        x:= nextprime(10^d*p+10^(d-1)-1);
        if x < 10^d*(p+1) then return x fi
      od
    end proc:
    map(f @ ithprime, [$1..100]); # Robert Israel, Aug 12 2018
  • Mathematica
    f[n_] := Block[{k = 1, p = Prime@ n}, While[a = 10^Floor[1 + Log10@ k] p + k; !PrimeQ@ a, k += 2]; a]; Array[f, 44]
  • PARI
    apply( {A030670(n)=n=prime(n);for(L=1,oo, n*=10; forstep(s=bitor(10^(L-1),1),10^L-1,2, isprime(n+s)&& return(n+s)))}, [1..44]) \\ M. F. Hasler, Jan 15 2025
  • Python
    from sympy import prime, isprime
    from itertools import count
    def a030670(n):
      p = str(prime(n))
      return next(x for k in count(1) if isprime(x:=int(p+str(k)))) # David Radcliffe, Jan 08 2025
    

Extensions

Title changed by David Radcliffe, Jan 08 2025

A088606 Smallest number k such that concatenation of k and prime(n) is a prime, or 0 if no other number exists. a(1) = a(3) = 0.

Original entry on oeis.org

0, 1, 0, 1, 2, 1, 3, 4, 2, 2, 1, 1, 2, 4, 3, 3, 3, 4, 1, 2, 1, 1, 2, 3, 1, 5, 1, 5, 1, 2, 4, 2, 2, 4, 11, 1, 4, 1, 3, 6, 2, 1, 3, 1, 5, 6, 4, 1, 5, 1, 5, 2, 4, 2, 3, 6, 2, 3, 1, 2, 1, 2, 1, 2, 3, 6, 3, 4, 2, 4, 6, 3, 1, 1, 6, 2, 2, 4, 12, 1, 5, 4, 5, 1, 1, 5, 3, 3, 3, 3, 2, 5, 1, 3, 1, 2, 17, 2, 1, 3, 3, 2, 5, 5
Offset: 1

Views

Author

Amarnath Murthy, Oct 15 2003

Keywords

Comments

Subsidiary sequences: (set(1)) Index of the start of the first occurrence of a string of n consecutive 1's or 2's or 3's etc. (set (2)): a(n) = smallest prime such that concatenation of 1 with n successive primes starting from a(n) gives primes in each case. (n primes are obtained.) Similarly for 2, 3, etc. Conjecture: The subsidiary sequences are infinite.
A065112(n) = a(n) concatenated with prime(n). - Bill McEachen, May 27 2021

Crossrefs

Programs

  • PARI
    a(n) = if ((n==1) || (n==3), 0, my(k=1); while (!isprime(eval(Str(k, prime(n)))), k++); k); \\ Michel Marcus, Jul 11 2021

Extensions

More terms from Ray Chandler, Oct 18 2003

A064792 Append more digits to the n-th prime (leading zeros are permitted) until another prime is reached.

Original entry on oeis.org

23, 31, 53, 71, 113, 131, 173, 191, 233, 293, 311, 373, 419, 431, 479, 5303, 593, 613, 673, 719, 733, 797, 839, 8923, 971, 1013, 1031, 10709, 1091, 11311, 1277, 1319, 1373, 1399, 1493, 1511, 1571, 1637, 16703, 1733, 17903, 1811, 1913, 1931, 1973
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 17 2001

Keywords

Comments

Differs from A030670 in that here the appended digits may start with 0 which is not possible there (although zeros are allowed there, too, if they are not the first appended digit): The first difference appears at a(16) = 5303 where A030670(16) = 5323. - M. F. Hasler, Jan 15 2025

Crossrefs

Cf. A030665.
See A030670 for another version. Note that A030670 >= a(n). Cf. A065112.

Programs

  • PARI
    apply( {A064792(n)=n=prime(n);for(L=1,oo, n*=10; forstep(s=1,10^L-1,2, isprime(n+s)&& return(n+s)))}, [1..44]) \\ M. F. Hasler, Jan 15 2025

Formula

a(n) = A030665(prime(n)). - Michel Marcus, Jan 17 2025
Showing 1-3 of 3 results.