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.

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

This page as a plain text file.
%I A250312 #10 Nov 25 2014 10:17:50
%S A250312 1,151,157,169,223,277,283,337,361,367,397,409,421,439,457,469,547,
%T A250312 571,577,589,607,643,673,709,757,769,793,871,877,937,1063,1093,1201,
%U A250312 1603,1609,1807,2029,2053,2071,2707,3019,3037,3049,3073,3109,3607,4039,4051,4087
%N A250312 Numbers which produce primes if their divisors, one by one, are prepended, inserted or appended.
%H A250312 Paolo P. Lava, <a href="/A250312/b250312.txt">Table of n, a(n) for n = 1..1000</a>
%e A250312 Divisors of 1 is 1 and concat(1,1) = 11 is prime.
%e A250312 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.
%e A250312 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.
%p A250312 with(numtheory): P:=proc(q) local a,b,c,f,g,h,j,k,n;
%p A250312 for n from 1 by 2 to q do a:=divisors(n); h:=0;
%p A250312 for k from 1 to nops(a) do b:=ilog10(a[k])+1;
%p A250312 for j from 0 to ilog10(n)+1 do f:=(n mod 10^j);
%p A250312 if j=0 then c:=n*10^b+a[k]; else g:=a[k]*10^(ilog10(f)+1)+f;
%p A250312 c:=trunc(n/10^j)*10^(ilog10(g)+1)+g; fi;
%p A250312 if isprime(c) then h:=h+1; break; fi; od;
%p A250312 if h=nops(a) then print(n); fi; od; od; end: P(10^6);
%Y A250312 CF. A250311.
%K A250312 nonn,base,easy
%O A250312 1,2
%A A250312 _Paolo P. Lava_, Nov 18 2014
%E A250312 Inserted a(3), a(16) and a(26) by _Paolo P. Lava_, Nov 21 2014