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.

A383430 a(n) is the size of the largest subset of {1,...,n} such that no two elements differ by 5 or 8.

This page as a plain text file.
%I A383430 #37 May 13 2025 17:07:45
%S A383430 1,2,3,4,5,5,5,5,5,5,6,6,6,7,8,8,9,10,10,10,11,11,11,12,12,12,13,14,
%T A383430 14,15,16,16,16,17,17,17,18,18,18,19,20,20,21,22,22,22,23,23,23,24,24,
%U A383430 24,25,26,26,27,28,28,28,29,29,29,30,30,30,31,32,32,33,34,34,34,35,35,35,36
%N A383430 a(n) is the size of the largest subset of {1,...,n} such that no two elements differ by 5 or 8.
%H A383430 Mathematics Stack Exchange, <a href="https://math.stackexchange.com/questions/4688682/find-the-maximum-number-of-elements-in-the-set-m-such-that-no-two-elements-hav?rq=1">Find the maximum number of elements in the set M such that no two elements have a difference of 5 or 8</a>
%H A383430 <a href="/index/Rec#order_14">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,0,0,0,0,0,0,0,0,0,1,-1).
%F A383430 a(n) = a(n-13) + 6 for n > 20.
%e A383430 a(13) = 6 because {1, 2, 4, 5, 8, 11} is a 6-element subset of {1..13} which has no two elements differing by 5 or 8, and there is no larger subset that works.
%o A383430 (Python)
%o A383430 def a(n):
%o A383430     low = [0, 1, 2, 3, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 7, 8, 8, 9, 10, 10, 10]
%o A383430     if n < len(low):
%o A383430         return low[n]
%o A383430     else:
%o A383430         return a(n - 13) + 6
%Y A383430 Cf. A369149.
%K A383430 nonn,easy
%O A383430 1,2
%A A383430 _Andrej Jakobcic_, May 05 2025