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”).

a(1)=1. For m>=0 and 1<=k<=2^m, a(2^m +k) = number of earlier terms of the sequence that are coprime to k.
1

%I #10 Aug 09 2015 15:35:25

%S 1,1,2,2,4,2,6,2,8,2,9,3,12,2,14,4,16,4,14,4,20,2,20,4,20,4,26,2,27,5,

%T 21,7,32,8,28,8,32,4,33,9,32,9,41,5,43,12,31,15,48,8,50,13,36,16,54,9,

%U 49,18,42,16,60,8,61,20,64,20,48,20,57,11,63,23,51,22,71,14,74,22,47,27

%N a(1)=1. For m>=0 and 1<=k<=2^m, a(2^m +k) = number of earlier terms of the sequence that are coprime to k.

%e Since 16 = 2^3 +8, a(16) equals the number of terms among (a(1),a(2),...a(15)) that are coprime to 8. Since the terms 1,1,9 and 3 are the only earlier terms coprime to 8, a(16) = 4.

%p A118982 := proc(nmax) local a,m,k,an,i; a := [1] ; m := 0 ; while 2^m <= nmax do for k from 1 to 2^m do an := 0 ; for i from 1 to nops(a) do if gcd(k,a[i]) = 1 then an := an +1 ; fi ; od ; a := [op(a),an] ; od ; m := m+1 ; od ; RETURN(a) ; end: an := A118982(100) : for n from 1 to nops(an) do printf("%d,",an[n]) ; od ; # _R. J. Mathar_, Aug 06 2006

%K nonn

%O 1,3

%A _Leroy Quet_, May 25 2006

%E More terms from _R. J. Mathar_, Aug 06 2006