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.

A357282 a(n) = number of subsets S of {1,2,...,n} having more than 1 element such that (difference between least two elements of S) = difference between greatest two elements of S.

Original entry on oeis.org

0, 0, 1, 4, 9, 18, 33, 60, 109, 202, 381, 732, 1425, 2802, 5545, 11020, 21957, 43818, 87525, 174924, 349705, 699250, 1398321, 2796444, 5592669, 11185098, 22369933, 44739580, 89478849, 178957362, 357914361, 715828332, 1431656245, 2863312042, 5726623605
Offset: 0

Views

Author

Clark Kimberling, Sep 27 2022

Keywords

Examples

			The 4 relevant subsets of {1,2,3} are {1,2}, {1,3}, {2,3}, and {1,2,3}.
		

Crossrefs

Programs

  • Mathematica
    s[n_] := s[n] = Select[Subsets[Range[n]], Length[#] >= 2 &];
    a[n_] := Select[s[n], #[[2]] - #[[1]] == #[[-1]] - #[[-2]] &];
    Table[Length[a[n]], {n, 0, 18}]

Formula

a(n) = A000295(n)-2*A272144(n-2) for n >= 2.
a(n) = 4*a(n-1) - 4*a(n-2) - 2*a(n-3) + 5*a(n-4) - 2*a(n-5).
G.f.: -((x^2 (-1 + 3 x^2))/((-1 + x)^3 (1 + x) (-1 + 2 x))).