login
Denominators of terms of the sequence {c(n)} defined in A218121.
2

%I #20 Dec 05 2012 03:17:53

%S 1,2,2,2,2,3,3,3,5,5,5,7,7,7,7,7,7,11,11,11,11,13,13,13,13,13,13,17,

%T 17,17,17,17,17,19,19,19,19,19,19,19,23,23,23,23,23,23,23,23,29,29,29,

%U 29,31,31,31,31,31,31,31,31,31,37,37,37,37,37,37,41,41,41,41,43,43,43,43,43,43,43,47,47

%N Denominators of terms of the sequence {c(n)} defined in A218121.

%C It is easy to see that every prime is in the sequence.

%p ispfree := proc(a,b)

%p local alow ;

%p alow := floor(a);

%p if nextprime(alow) < b then

%p false;

%p else

%p true;

%p end if;

%p end proc:

%p A218121c := proc(n)

%p option remember;

%p local k ;

%p if n = 1 then

%p return 1;

%p elif n = 2 then

%p return 5/2 ;

%p else

%p if ispfree(ithprime(n)/procname(n-1),ithprime(n+1)/procname(n-1)) then

%p return procname(n-1) ;

%p end if ;

%p for k from n by -1 do

%p if ispfree( ithprime(n)*ithprime(k)/ithprime(n+1),ithprime(k) )

%p and ithprime(n+1)/ithprime(k) > procname(n-1) then

%p return ithprime(n+1)/ithprime(k) ;

%p end if;

%p end do:

%p end if;

%p end proc:

%p A218123 := proc(n)

%p denom(A218121c(n)) ;

%p end proc: # _R. J. Mathar_, Dec 02 2012

%Y Cf. A218121, A217871, A217689, A217691, A217833, A217884.

%K nonn,frac

%O 1,2

%A _Vladimir Shevelev_, Oct 21 2012