%I #19 Mar 26 2023 04:47:41
%S 1,2,4,6,3,8,10,5,9,14,7,12,15,11,16,21,13,18,22,17,20,26,19,24,33,23,
%T 25,34,29,27,35,30,28,38,31,32,39,37,36,46,41,40,51,42,44,55,43,45,57,
%U 47,48,58,53,49,62,59,50,65,61,52,69,66,54,74,67,56,77,70
%N a(n) is the smallest positive integer k not occurring earlier such that Möbius(k) == n (mod 3).
%C Permutation of the positive integers.
%C In other words, a(n) is the least positive unused integer such that Möbius(a(n)) is respectively 1, -1, 0, 1, -1, 0, 1, -1, 0, ... for n > 0.
%H Winston de Greef, <a href="/A350033/b350033.txt">Table of n, a(n) for n = 1..10000</a>
%e a(1) = 1 because 1 is the smallest positive integer with Möbius(1) = 1.
%e For a(2) we search for the smallest positive integer k not already in the sequence with Möbius(k) = -1. So, a(2) = 2.
%e Next, we search for Möbius(k) = 0 and a(3) = 6. We continue by asking for the smallest k such that Möbius(k) = 1, -1, 0, 1, -1, 0, ... and so on.
%t a[1]=1; a[n_]:=a[n]=(k=1;While[MemberQ[Array[a,n-1],k]||Mod[n,3,-1]!=MoebiusMu@k,k++]; k); Array[a,100]
%o (PARI) lista(n)=my(v=vector(n), k=[1, 1, 1]); for(i=1, n, my(m=i%3); while((moebius(k[m+1])-m) % 3, k[m+1]++); v[i]=k[m+1]; k[m+1]++;); v \\ _Winston de Greef_, Mar 25 2023
%Y Cf. A008683.
%K nonn
%O 1,2
%A _Giorgos Kalogeropoulos_, Dec 09 2021
|