cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A131754 Size of the largest subset of {1,2,...,n} such that no two distinct elements differ by a perfect square > 1.

This page as a plain text file.
%I A131754 #17 Nov 18 2018 07:38:14
%S A131754 1,2,3,4,4,4,4,4,5,5,6,6,6,7,8,8,8,8,8,8,9,10,10,10,10,10,10,11,11,11,
%T A131754 11,11,11,11,12,13,13,13,13,13,14,15,15,15,15,15,15,16,17,17,17,17,17,
%U A131754 17,18,19,19,19,19,19,19,20,20,20,20,20,20,21,21,21,21,21,21,21,22,23,24,24,24,24,24
%N A131754 Size of the largest subset of {1,2,...,n} such that no two distinct elements differ by a perfect square > 1.
%H A131754 Fausto A. C. Cariboni, <a href="/A131754/b131754.txt">Table of n, a(n) for n = 1..270</a> (terms n = 1..165 from Robert Israel)
%H A131754 Fausto A. C. Cariboni, <a href="/A131754/a131754.txt">Sets of maximal span that yield a(n) for n = 2..270</a>, Nov 18 2018.
%p A131754 f:= proc(n) uses GraphTheory; IndependenceNumber(Graph(n,
%p A131754    {seq(seq({i,i+x^2},x=2..floor(sqrt(n-i))),i=1..n)}));
%p A131754 end proc:
%p A131754 map(f, [$1..58]); # _Robert Israel_, Mar 20 2017
%o A131754 (MATLAB with CPLEX)
%o A131754 function [v, X] = A131754(n)
%o A131754 A = sparse(0,n);
%o A131754 rownum = 0;
%o A131754 for i =1:n
%o A131754   for x =2:floor(sqrt(n-i))
%o A131754     rownum = rownum+1;
%o A131754     A(rownum, [i,i+x^2]) = 1;
%o A131754   end
%o A131754 end
%o A131754 prob.f = -ones(n,1);
%o A131754 prob.Aineq = A;
%o A131754 prob.bineq = ones(rownum,1);
%o A131754 prob.ctype = char(ones(1,n)*'B');
%o A131754 cplex = Cplex(prob);
%o A131754 cplex.DisplayFunc = [];
%o A131754 cplex.solve();
%o A131754 if cplex.Solution.status == 101
%o A131754   v = -cplex.Solution.objval;
%o A131754   x = cplex.Solution.x;
%o A131754   X = find(x > 0.5);
%o A131754 end
%o A131754 end
%Y A131754 Cf. A100719, A131752, A131753.
%K A131754 nonn
%O A131754 1,2
%A A131754 _Olivier Gérard_, Sep 17 2007
%E A131754 More terms from _Robert Israel_, Mar 20 2017