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.

A250312 Numbers which produce primes if their divisors, one by one, are prepended, inserted or appended.

Original entry on oeis.org

1, 151, 157, 169, 223, 277, 283, 337, 361, 367, 397, 409, 421, 439, 457, 469, 547, 571, 577, 589, 607, 643, 673, 709, 757, 769, 793, 871, 877, 937, 1063, 1093, 1201, 1603, 1609, 1807, 2029, 2053, 2071, 2707, 3019, 3037, 3049, 3073, 3109, 3607, 4039, 4051, 4087
Offset: 1

Views

Author

Paolo P. Lava, Nov 18 2014

Keywords

Examples

			Divisors of 1 is 1 and concat(1,1) = 11 is prime.
Divisors of 151 are 1, 151. Then concat(151,1) = 1511 is prime, as is concat(1,151) = 1151, and concat(1,151,51) = 115151 is prime.
Divisors of 169 are 1, 13, 169. Then concat(16,1,9) = 1619 is prime, concat(16,13,9) = 16139 is prime, as is concat(1,13,69) = 11369, and concat(1,169,69) = 116969 is prime.
		

Crossrefs

CF. A250311.

Programs

  • Maple
    with(numtheory): P:=proc(q) local a,b,c,f,g,h,j,k,n;
    for n from 1 by 2 to q do a:=divisors(n); h:=0;
    for k from 1 to nops(a) do b:=ilog10(a[k])+1;
    for j from 0 to ilog10(n)+1 do f:=(n mod 10^j);
    if j=0 then c:=n*10^b+a[k]; else g:=a[k]*10^(ilog10(f)+1)+f;
    c:=trunc(n/10^j)*10^(ilog10(g)+1)+g; fi;
    if isprime(c) then h:=h+1; break; fi; od;
    if h=nops(a) then print(n); fi; od; od; end: P(10^6);

Extensions

Inserted a(3), a(16) and a(26) by Paolo P. Lava, Nov 21 2014

A247098 Smallest prime p that generates n different primes if it is inserted into p itself.

Original entry on oeis.org

2, 109, 131, 10289, 12197, 1227797, 101636629, 118561139, 10596073217, 89466662147, 37898818253
Offset: 0

Views

Author

Paolo P. Lava, Nov 18 2014

Keywords

Comments

a(8) > 10^9.
The concatenation of p with p will not result in a prime as the result is divisible by 10^k+1, where k is the number of digits in p. - Chai Wah Wu, Jun 25 2019

Examples

			a(0) = 2 is prime but concat(2,2) = 22 is not.
a(1) = 109 is prime and also concat(1,109,09) = 110909.
a(2) = 131 is prime. Again, concat(13,131,1) = 131311 is prime and also concat(1,131,31) = 113131.
a(5) = 1227797 and the five primes that are generated are: 12277912277977, 12271227797797, 12212277977797, 12122779727797, 11227797227797.
		

Crossrefs

Programs

  • Maple
    P:=proc(q) local a,b,i,j,k,n,t: print(2); for j from 1 to q do n:=2:
    for k from 1 to q do n:=nextprime(n): b:=length(n): t:=0:
    for i from 1 to b-1 do if isprime((trunc(n/10^i)*10^b+n)*10^i+(n mod 10^i))
    then t:=t+1; fi; od;  if t=j then print(n); break; fi; od; od; end: P(10^9);

Extensions

a(8)-a(10) from Chai Wah Wu, Jul 01 2019
Showing 1-2 of 2 results.