%I #12 Jun 19 2016 19:49:27
%S 1,2,3,4,11,6,7,8,9,10,5,12,19,14,15,16,17,18,13,20,21,22,29,24,31,26,
%T 27,28,23,30,25,32,33,34,35,36,37,41,42,40,38,39,43,44,45,46,47,48,49,
%U 53,54,52,50,51,55,56,57,58,65,66,61,62,60,67,71,63,64
%N Smallest positive integer k == n mod 3 not occurring earlier such that the sum of two successive terms is a squarefree number.
%C Mod 3 analog of A077223. A permutation of the natural numbers. There's an obvious limit to the number of successive values which can be consecutive integers.
%H Robert Israel, <a href="/A131485/b131485.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = MIN{k > 0 such that 3|(n-k) and k + a(n-1) not in A013929}. a(n) = MIN{k > 0 such that 3|(n-k) and k + a(n-1) in A005117}.
%p S:= {0,1}: mink:= 2: A[1]:= 1:
%p for n from 2 to 100 do
%p for k from mink + (n-mink mod 3) by 3 do
%p if not member(k,S) and numtheory:-issqrfree(A[n-1]+k) then
%p A[n]:= k; S:= S union {k};
%p if k = mink then mink := min({$mink .. max(S)+1} minus S) fi;
%p break
%p fi
%p od
%p od:seq(A[i],i=1..100); # _Robert Israel_, Jun 19 2016
%Y Cf. A005117, A013929, A077223.
%K easy,nonn
%O 1,2
%A _Jonathan Vos Post_, Oct 01 2007
%E Corrected and extended by _Giovanni Resta_, Jun 19 2016