function a = A368059( max_n ) a = 3; m = 3; cache = {}; for n = 2:max_n [v, cache] = sumvector(a(n-1), cache); k = m; [vk, cache] = sumvector(k, cache); while isempty(intersect(v,vk))||~isempty(find(a==k,1)) k = k+1; [vk, cache] = sumvector(k, cache); end if k == m+1 m = m+1; end a(n) = k; end end function [v, cache] = sumvector(k,cache) if k > length(cache) v = sumv(k); cache{k} = v; else if isempty(cache{k}) v = sumv(k); cache{k} = v; else v = cache{k}; end end end function v = sumv(k) d = divisors(k); v = d(1:floor((length(d)+1)/2))+d(end:-1:1+floor(length(d)/2)); end