login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A128330
a(1)=1. a(n) = number of positive numbers <= n that are coprime to the product of the first n-1 terms of this sequence.
1
1, 2, 2, 2, 3, 2, 3, 3, 3, 3, 4, 4, 5, 4, 4, 4, 5, 5, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 11, 10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 16, 16, 16, 16, 16, 16, 17, 16, 16, 16, 17
OFFSET
1,2
EXAMPLE
The first 6 terms of the sequence are 1,2,2,2,3,2,3. The number of positive integers <= 7 that are coprime to 1, 2 and 3 is three, these integers being 1, 5 and 7. So a(7) = 3.
MAPLE
a[1]:=1: for n from 2 to 105 do a[n]:=0: for j from 1 to n do if igcd(j, product(a[i], i=1..n-1))=1 then a[n]:=a[n]+1 else fi od: od: seq(a[n], n=1..105); # Emeric Deutsch, May 22 2007
CROSSREFS
Sequence in context: A299230 A182576 A368869 * A133801 A372433 A181630
KEYWORD
nonn
AUTHOR
Leroy Quet, May 04 2007
EXTENSIONS
More terms from Emeric Deutsch, May 22 2007
STATUS
approved