login
A130498
a(1)=1. a(n) = number of earlier terms of the sequence which are coprime to (the number of positive integers which are <=n and missing from first (n-1) terms of sequence).
2
1, 1, 2, 2, 4, 5, 6, 6, 3, 4, 9, 10, 10, 3, 14, 14, 6, 11, 12, 12, 6, 20, 21, 22, 22, 4, 26, 26, 7, 7, 16, 17, 18, 18, 11, 34, 34, 8, 8, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 57, 20, 34, 20, 61, 62, 63, 64, 65, 66, 67, 68, 69
OFFSET
1,3
LINKS
EXAMPLE
The positive integers which are <= 9 and are missing from the first 8 terms of the sequence are 3,7,8,9. There are 4 such integers, so a(9) is the number of earlier terms which are coprime to 4. Therefore a(9) = 3.
MATHEMATICA
t = {1, 1, 2, 2, 4, 5, 6, 6, 3, 4}; n = 11; count = 0; comp = Complement[Range[Length[t] + 1], t]; Do[If[CoprimeQ[t[[j]], Length[comp]], count = count + 1], {j, 1, Length[t]}]; t = Append[t, count]; Do[n = n + 1; count = 0; comp = Complement[Range[Length[t] + 1], t]; Do[If[CoprimeQ[t[[j]], Length[comp]], count = count + 1], {j, 1, Length[t]}]; t = Append[t, count], {100}]; t (* Diana L. Mecum, Aug 06 2012 *)
CROSSREFS
Cf. A130499.
Sequence in context: A353855 A353847 A181537 * A263433 A147806 A338228
KEYWORD
nonn
AUTHOR
Leroy Quet, May 31 2007
EXTENSIONS
Terms corrected by Diana L. Mecum, Aug 06 2012
STATUS
approved