A083137 Smallest palindromic number relatively prime to all the previous terms.
1, 2, 3, 5, 7, 11, 101, 131, 151, 181, 191, 313, 323, 353, 373, 383, 727, 757, 767, 787, 797, 919, 929, 989, 10001, 10301, 10501, 10601, 11111, 11311, 11411, 12421, 12721, 12821, 13031, 13331, 13831, 13931, 14141, 14341, 14741, 14941, 15151, 15451
Offset: 1
Links
- R. J. Mathar and Giovanni Resta, Table of n, a(n) for n = 1..10000 (first 966 terms from R. J. Mathar)
Programs
-
Maple
isA002113 := proc(n) if digrev(n) = n then true; else false; end if; end proc: A083137 := proc(n) option remember; if n =1 then 1; else for p from procname(n-1)+1 do if isA002113(p) then rpr := true; for i from 1 to n-1 do if igcd(procname(i),p) > 1 then rpr := false; break; end if; end do: if rpr then return p ; end if; end if; end do: end if; end proc: # R. J. Mathar, Aug 23 2014
-
Mathematica
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 *)
Extensions
Corrected and extended by Reinhard Zumkeller, May 05 2003
Comments