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.

A216168 Composite numbers and 1 which yield a prime whenever a 7 is inserted anywhere in them, including at the beginning or end.

This page as a plain text file.
%I A216168 #11 Sep 08 2022 08:46:03
%S A216168 1,9,27,33,39,57,87,159,177,187,603,717,753,949,1257,1707,2277,2367,
%T A216168 4317,4623,4779,4797,5773,6757,6777,7017,7471,7479,7747,7797,7813,
%U A216168 7977,8797,9777,9987,10777,11757,17679,28269,28437,29779,34177,34771,40059,41721
%N A216168 Composite numbers and 1 which yield a prime whenever a 7 is inserted anywhere in them, including at the beginning or end.
%H A216168 Paolo P. Lava, <a href="/A216168/b216168.txt">Table of n, a(n) for n = 1..150</a>
%e A216168 4623 is not prime but 46237, 46273, 46723, 47623 and 74623 are all primes.
%p A216168 with(numtheory);
%p A216168 A216168:=proc(q,x)
%p A216168 local a,b,c,i,n,ok;
%p A216168 for n from 1 to q do
%p A216168 if not isprime(n) then
%p A216168   a:=n; b:=0; while a>0 do b:=b+1; a:=trunc(a/10); od; a:=n; ok:=1;
%p A216168   for i from 0 to b do c:=a+9*10^i*trunc(a/10^i)+10^i*x;
%p A216168     if not isprime(c) then ok:=0; break; fi;
%p A216168   od;
%p A216168   if ok=1 then print(n); fi;
%p A216168 fi;
%p A216168 od; end:
%p A216168 A216168(1000,7);
%o A216168 (Magma) [n: n in [1..50000] | not IsPrime(n) and forall{m: t in [0..#Intseq(n)] | IsPrime(m) where m is (Floor(n/10^t)*10+7)*10^t+n mod 10^t}]; // _Bruno Berselli_, Sep 03 2012
%Y A216168 Cf. A068673, A068674, A068677, A068679, A069246, A215417, A215419-A215421, A216165-A216167, A216169.
%K A216168 nonn,base
%O A216168 1,2
%A A216168 _Paolo P. Lava_, Sep 03 2012