login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A107804 a(1) = prime(4), for n >= 2, a(n) is the smallest prime not previously used which contains a digit from a(n-1). 14

%I #13 Apr 10 2020 16:48:50

%S 7,17,11,13,3,23,2,29,19,31,37,43,41,47,67,61,71,73,53,5,59,79,89,83,

%T 103,101,107,97,109,113,127,131,137,139,149,151,157,163,167,173,179,

%U 181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277

%N a(1) = prime(4), for n >= 2, a(n) is the smallest prime not previously used which contains a digit from a(n-1).

%C a(n) = prime(n) for almost all n. Probably a(n) = prime(n) for all n > N for some N, but N must be very large. - _Charles R Greathouse IV_, Jul 20 2011

%F a(n) ~ n log n. - _Charles R Greathouse IV_, Jul 20 2011

%t p=Prime[4];b={p};d=p;Do[Do[r=Prime[c];If[FreeQ[b, r]&&Intersection@@IntegerDigits/@{d, r}=!={}, b=Append[b, r];d=r;Break[]], {c, 1000}], {k, 60}];b

%o (PARI) common(a,b)=a=vecsort(eval(Vec(Str(a))),,8);b=vecsort(eval(Vec(Str(b))),,8);#a+#b>#vecsort(concat(a,b),,8)

%o in(v,x)=for(i=1,#v,if(v[i]==x,return(1)));0

%o lista(nn) = {my(v=[7]); for(n=2, nn, forprime(p=2, default(primelimit), if(!in(v,p)&&common(v[#v],p), v=concat(v,p); break))); v; }

%o \\ _Charles R Greathouse IV_, Jul 20 2011

%Y Cf. A107353.

%Y Other cases of seed: A107801 (a(1) = 2), A107802 (a(1) = 3), A107803 (a(1) = 5), A107805 (a(1) = 11), A107806 (a(1) = 13), A107807 (a(1) = 17), A107808 (a(1) = 19), A107809 (a(1) = 23), A107810 (a(1) = 29), A107811 (a(1) = 31), A107812 (a(1) = 37), A107813 (a(1) = 41), A107814 (a(1) = 43).

%K nonn,base

%O 1,1

%A _Zak Seidov_ & _Eric Angelini_, May 24 2005

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 09:04 EDT 2024. Contains 371240 sequences. (Running on oeis4.)