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.

A369149 a(n) is the size of the largest subset of {1,...,n} such that no two elements differ by 4 or 7.

This page as a plain text file.
%I A369149 #15 May 05 2025 17:35:41
%S A369149 1,2,3,4,4,4,4,4,5,5,5,6,7,7,8,8,9,9,9,10,10,10,11,12,12,13,13,14,14,
%T A369149 14,15,15,15,16,17,17,18,18,19,19,19,20,20,20,21,22,22,23,23,24,24,24,
%U A369149 25,25,25,26,27,27,28,28,29,29,29,30,30,30,31,32,32,33,33,34,34,34,35,35,35,36,37
%N A369149 a(n) is the size of the largest subset of {1,...,n} such that no two elements differ by 4 or 7.
%C A369149 a(n) is the independence number of the graph with vertices 1,...,n and edges joining vertices that differ by 4 or 7.
%H A369149 Robert Israel, <a href="/A369149/b369149.txt">Table of n, a(n) for n = 1..10000</a>
%H A369149 Mathematics StackExchange, <a href="https://math.stackexchange.com/questions/887718/biggest-subset-of-1-2-1000-such-that-difference-between-any-pair-of-e">Biggest subset of 1,2,...,1000 such that difference between any pair of elements =/= 4, 7</a>
%H A369149 <a href="/index/Rec#order_12">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,0,0,0,0,0,0,0,1,-1).
%F A369149 a(n+11) = a(n) + 5 for n > 5.
%F A369149 G.f.: (x + x^2 + x^3 + x^4 + x^9 - x^14 + x^17)/(1 - x - x^11 + x^12).
%e A369149 a(10) = 5 because {1, 2, 4, 7, 10} is a 5-element subset of {1,...,10} which has no two elements differing by 4 or 7, and there is no larger subset that works.
%p A369149 f:= proc(n) local L,i;
%p A369149   L:= convert(n,base,11);
%p A369149   [0,1,2,2,3,3,4,4,4,5,5][L[1]+1] + add(5*L[i]*11^(i-2),i=2..nops(L))
%p A369149 end proc:
%p A369149 f(3):= 3: f(4):= 4: f(5):= 4:
%p A369149 map(f, [$1..100]);
%K A369149 nonn,easy
%O A369149 1,2
%A A369149 _Robert Israel_, Jan 14 2024