login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Primes whose digits do not appear in three previous terms.
0

%I #8 Oct 11 2021 15:33:45

%S 2,3,5,7,11,23,59,67,101,223,449,557,601,823,4999,5557,6011,8233,9949,

%T 57557,60101,82223,94949,555557,600011,822223,994949,5555777,6000011,

%U 8222323,9444949

%N Primes whose digits do not appear in three previous terms.

%C Cf. A030284 = Primes whose digits do not appear in previous term, A107798 = Primes whose digits do not appear in two previous terms.

%t d=2;e=3;f=5;b={2, 3, 5};id[t_]:=IntegerDigits[t];Do[p=Prime[n];If[Intersection[Union[id[d], id[e], id[f]], id[p]]=={}, b=Append[b, p];d=e;e=f;f=p], {n, 100000}];b

%t nxt[{a_,b_,c_}]:=Module[{dgs=Union[Flatten[IntegerDigits/@{a,b,c}]],d = NextPrime[ c]},While[ Intersection[dgs,IntegerDigits[d]]!={},d= NextPrime[d]];{b,c,d}]; NestList[nxt,{2,3,5},30][[All,1]] (* _Harvey P. Dale_, Oct 11 2021 *)

%Y Cf. A030284, A107798, A107799.

%K nonn,base

%O 1,1

%A _Zak Seidov_, May 24 2005

%E More terms from _Harvey P. Dale_, Oct 11 2021