%I #8 Aug 23 2014 14:57:07
%S 4,6,9,14,21,8,25,36,55,12,35,64,27,58,99,10,57,110,39,98,15,76,143,
%T 16,95,22,119,18,121,228,49,158,45,176,315,32,169,20,171,328,51,214,
%U 33,200,391,24,217,44,243,46,273,34,245,468,85,314,63,296,537,28,285,548,69
%N a(n) is the smallest composite number not already in the sequence such that the absolute values of the successive differences are distinct primes.
%C The absolute values of the successive difference are 2, 3, 5, 7, 13, 17, 11, 19, 43, 23, 29, 37, 31, ...
%C Does every composite number occur in the sequence? Does every prime occur as a difference?
%t a[0]=4; a[n_] := a[n]=Module[{x, d}, For[x=6, True, x++, If[ !PrimeQ[x]&&PrimeQ[d=Abs[x-a[n-1]]]&&!MemberQ[a/@Range[n-1], x]&&!MemberQ[Table[Abs[a[i+1]-a[i]], {i, 0, n-2}], d], Return[x]]]]
%K nonn
%O 0,1
%A _Amarnath Murthy_ and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jun 18 2003
%E Edited by _Dean Hickerson_, Jun 30 2003
|