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.

Original entry on oeis.org

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, 14, 15, 15, 15, 16, 17, 17, 18, 18, 19, 19, 19, 20, 20, 20, 21, 22, 22, 23, 23, 24, 24, 24, 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
Offset: 1

Views

Author

Robert Israel, Jan 14 2024

Keywords

Comments

a(n) is the independence number of the graph with vertices 1,...,n and edges joining vertices that differ by 4 or 7.

Examples

			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.
		

Programs

  • Maple
    f:= proc(n) local L,i;
      L:= convert(n,base,11);
      [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))
    end proc:
    f(3):= 3: f(4):= 4: f(5):= 4:
    map(f, [$1..100]);

Formula

a(n+11) = a(n) + 5 for n > 5.
G.f.: (x + x^2 + x^3 + x^4 + x^9 - x^14 + x^17)/(1 - x - x^11 + x^12).