%I #23 Jan 17 2018 03:27:14
%S 1,2,3,5,7,11,101,131,151,181,191,313,323,353,373,383,727,757,767,787,
%T 797,919,929,989,10001,10301,10501,10601,11111,11311,11411,12421,
%U 12721,12821,13031,13331,13831,13931,14141,14341,14741,14941,15151,15451
%N Smallest palindromic number relatively prime to all the previous terms.
%C 323 is the first composite entry. Conjecture: sequence is infinite.
%H R. J. Mathar and Giovanni Resta, <a href="/A083137/b083137.txt">Table of n, a(n) for n = 1..10000</a> (first 966 terms from R. J. Mathar)
%p isA002113 := proc(n)
%p if digrev(n) = n then
%p true;
%p else
%p false;
%p end if;
%p end proc:
%p A083137 := proc(n)
%p option remember;
%p if n =1 then
%p 1;
%p else
%p for p from procname(n-1)+1 do
%p if isA002113(p) then
%p rpr := true;
%p for i from 1 to n-1 do
%p if igcd(procname(i),p) > 1 then
%p rpr := false;
%p break;
%p end if;
%p end do:
%p if rpr then
%p return p ;
%p end if;
%p end if;
%p end do:
%p end if;
%p end proc: # _R. J. Mathar_, Aug 23 2014
%t a[1] = 1; a[n_] := a[n] = For[k = a[n-1]+1, True, k++, If[PalindromeQ[k] && AllTrue[Array[a, n-1], CoprimeQ[#, k]&], Return[k]]]; Array[a, 50] (* _Jean-François Alcover_, Jan 17 2018 *)
%Y Cf. A002113, A083136, A083139 (primes in this sequence).
%K base,nonn
%O 1,2
%A _Amarnath Murthy_ and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Apr 24 2003
%E Corrected and extended by _Reinhard Zumkeller_, May 05 2003
|