function [R] = A363011(nmax) % % Returns "R", the first occurences of values % within the first "nmax" terms of A362816. % % R: first column "k", second column "n" % first k such that A362816(k) = n % % It is conjectured that only terms in A362815 % will occur in A362816. So, if any term in the % second column of R equals a term not in % A362815, the conjecture is false. K=zeros(nmax,1); K(1:2)=[2 2]; R=[1 2]; for n=3:nmax B=[]; for q=1:floor((n-1)/2) s=n-q; d=K(s)-K(s-q); U=[K(s)]; s=s-q; while s>0 && U(end)-K(s)==d U=[U K(s)]; s=s-q; end F=[U(1)+d U]; if length(F)>min(F) && ~any(B(:)==U(1)+d) B=[B U(1)+d]; end end k=2; while any(B(:)==k) k=k+1; end K(n)=k; if ~any(R(:,2)==k) R=[R; n, k]; end end end