login
a(n) is the smallest positive integer which does not occur earlier in the sequence and is such that sum{k=1 to n} 1/a(k) has a numerator which is prime (or is 1).
5

%I #10 Oct 10 2019 11:36:28

%S 1,2,3,5,4,7,8,6,9,14,10,11,12,15,17,16,18,29,22,20,23,40,13,21,19,26,

%T 28,44,27,25,31,35,24,36,32,37,38,49,48,42,41,30,33,45,61,43,56,51,64,

%U 34,72,63,66,46,55,68,50,67,52,39,53,74,93,54,87,75,59,71,62,60,73,58

%N a(n) is the smallest positive integer which does not occur earlier in the sequence and is such that sum{k=1 to n} 1/a(k) has a numerator which is prime (or is 1).

%C A127516(n)/A127517(n) is sum{k=1 to n} 1/a(k). This sequence, A127515, seems to be a permutation of the positive integers.

%e 1/a(1) + 1/a(2) +1/a(3) = 1 +1/2 + 1/3 = 11/6. 11/6 + 1/4 = 25/12; but 25 is composite, so a(4) is not 4. But 11/6 +1/5 = 61/30. And since 61 is prime, then a(4) = 5.

%t f[l_List] := Sum[1/l[[k]], {k, Length[l]}];g[l_List] := Block[{k = 1, n},While[n = Numerator[f[Append[l, k]]]; MemberQ[l, k] || ! (n == 1 || PrimeQ[n]), k++ ];Append[l, k]];Nest[g, {}, 72] (* _Ray Chandler_, Jan 22 2007 *)

%Y Cf. A127516, A127517, A127518.

%Y Cf. A076474, A134411.

%K nonn

%O 1,2

%A _Leroy Quet_, Jan 17 2007

%E Extended by _Ray Chandler_, Jan 22 2007