login
a(n) is the smallest number k such that Sum_{j=1..k} (-1)^omega(j) = -n, where omega(j) is the number of distinct primes dividing j.
2

%I #10 Aug 08 2021 11:32:04

%S 3,4,5,8,9,32,9283,9284,9285,9292,9293,9294,9295,9296,9343,9434,9437,

%T 9440,9479,9686,9689,9690,9697,9698,9699,9700,9711,9716,9717,9718,

%U 9719,9720,9721,9740,9741,9852,9855,9856,9857,10284,10285,10286,10305,10314,10325,10326,10331,10338

%N a(n) is the smallest number k such that Sum_{j=1..k} (-1)^omega(j) = -n, where omega(j) is the number of distinct primes dividing j.

%F a(n) = min {k : Sum_{j=1..k} mu(rad(j)) = -n}, where mu is the Moebius function and rad is the squarefree kernel.

%t a[n_]:=(k=1;While[Sum[(-1)^PrimeNu@j,{j,k}]!=-n,k++];k);Array[a,6] (* _Giorgos Kalogeropoulos_, Jul 19 2021 *)

%o (PARI) a(n) = my(k=1); while (sum(j=1, k, (-1)^omega(j)) != -n, k++); k; \\ _Michel Marcus_, Jul 19 2021

%Y Cf. A001221, A002053, A051400, A051401, A051402, A051470, A060434, A076479, A174863, A275547, A346455, A346457.

%K nonn

%O 1,1

%A _Ilya Gutkovskiy_, Jul 19 2021