login
A127515
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
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, 28, 44, 27, 25, 31, 35, 24, 36, 32, 37, 38, 49, 48, 42, 41, 30, 33, 45, 61, 43, 56, 51, 64, 34, 72, 63, 66, 46, 55, 68, 50, 67, 52, 39, 53, 74, 93, 54, 87, 75, 59, 71, 62, 60, 73, 58
OFFSET
1,2
COMMENTS
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.
EXAMPLE
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.
MATHEMATICA
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 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jan 17 2007
EXTENSIONS
Extended by Ray Chandler, Jan 22 2007
STATUS
approved