A212964
Number of (w,x,y) with all terms in {0,...,n} and |w-x| < |x-y| < |y-w|.
Original entry on oeis.org
0, 0, 0, 2, 6, 14, 26, 44, 68, 100, 140, 190, 250, 322, 406, 504, 616, 744, 888, 1050, 1230, 1430, 1650, 1892, 2156, 2444, 2756, 3094, 3458, 3850, 4270, 4720, 5200, 5712, 6256, 6834, 7446, 8094, 8778, 9500, 10260, 11060, 11900, 12782, 13706
Offset: 0
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- Jean-Luc Baril, Alexander Burstein, and Sergey Kirgizov, Pattern statistics in faro words and permutations, arXiv:2010.06270 [math.CO], 2020.
- Ikuko Hamamoto, One-particle motion in nuclear many-body problem, Division of Mathematical Physics, LTH, University of Lund, Sweden.
- Index entries for linear recurrences with constant coefficients, signature (3,-2,-2,3,-1).
-
[(2*n-1)*(2*n^2-2*n-3)/24 - (-1)^n/8: n in [0..50]]; // Vincenzo Librandi, Jul 25 2014
-
A212964:=n->add(floor(i^2/2) - 2*floor(i/2), i=1..n): seq(A212964(n), n=0..50); # Wesley Ivan Hurt, Jul 23 2014
-
t = Compile[{{n, _Integer}}, Module[{s = 0},
(Do[If[Abs[w - x] < Abs[x - y] < Abs[y - w], s = s + 1],
{w, 0, n}, {x, 0, n}, {y, 0, n}]; s)]];
m = Map[t[#] &, Range[0, 45]] (* A212964 *)
m/2 (* essentially A002623 *)
CoefficientList[Series[2 x^3/((1 + x) (1 - x)^4), {x, 0, 50}], x] (* Vincenzo Librandi, Jul 25 2014 *)
-
a(n) = (2*n-1)*(2*n^2-2*n-3)/24 - (-1)^n/8;
vector (100, n, a(n-1)) \\ Altug Alkan, Sep 30 2015
A051013
Number of nonaveraging subsets on {1,2,...,n}.
Original entry on oeis.org
1, 2, 4, 7, 13, 23, 40, 65, 106, 169, 278, 443, 705, 1117, 1760, 2692, 4151, 6314, 9526, 14127, 20944, 30848, 45589, 66495, 96847, 140840, 204380, 293822, 425859, 613446, 880288, 1258349, 1794256, 2545965, 3623774, 5123746, 7207773, 10159163, 14273328, 19925242, 27893419
Offset: 0
The only subset of s = {1,2,3} that contains a 3-term arithmetic progression is s itself, so a(3) = 7.
-
a[n_] := a[n] = 2^n - Count[Subsets[Range[n], {3, n}], {_, a_, _, b_, _, c_, _} /; b-a == c-b]; Table[Print[n, " ", a[n]]; a[n], {n, 0, 32}] (* Jean-François Alcover, May 30 2019 *)
-
# Prints out all such sets
def nonaveragingsets(n):
avoid=list()
for skip in range(1,(n+1)//2):
for start in range (1,n+1-2*skip):
avoid.append(set({start,start+skip,start+2*skip}))
s=list()
for i in range(3):
for smallset in comb(range(1,n+1),i):
s.append(smallset)
for i in range(3,n+1):
for temptuple in comb(range(1,n+1),i):
tempset=set(temptuple)
status=True
for avoidset in avoid:
if avoidset <= tempset:
status=False
break
if status:
s.append(tempset)
return s
# Counts all such sets
def a(n):
return len(nonaveragingsets(n)) # David Nacin, Mar 03 2012
A334892
Number T(n,k) of k-element subsets of [n] avoiding 3-term arithmetic progressions and containing n if n>0; triangle T(n,k), n>=0, 0<=k<=A003002(n), read by rows.
Original entry on oeis.org
1, 0, 1, 0, 1, 1, 0, 1, 2, 0, 1, 3, 2, 0, 1, 4, 4, 1, 0, 1, 5, 8, 3, 0, 1, 6, 12, 6, 0, 1, 7, 18, 15, 0, 1, 8, 24, 26, 4, 0, 1, 9, 32, 47, 20, 0, 1, 10, 40, 67, 40, 7, 0, 1, 11, 50, 102, 80, 18, 0, 1, 12, 60, 140, 140, 53, 6, 0, 1, 13, 72, 194, 236, 110, 16, 1
Offset: 0
1;
0, 1;
0, 1, 1;
0, 1, 2;
0, 1, 3, 2;
0, 1, 4, 4, 1;
0, 1, 5, 8, 3;
0, 1, 6, 12, 6;
0, 1, 7, 18, 15;
0, 1, 8, 24, 26, 4;
0, 1, 9, 32, 47, 20;
0, 1, 10, 40, 67, 40, 7;
0, 1, 11, 50, 102, 80, 18;
0, 1, 12, 60, 140, 140, 53, 6;
0, 1, 13, 72, 194, 236, 110, 16, 1;
0, 1, 14, 84, 248, 342, 198, 42, 3;
0, 1, 15, 98, 326, 532, 377, 100, 10;
...
Last elements of rows give
A334894.
-
b:= proc(n, s) option remember; `if`(n=0, x, b(n-1, s)+ `if`(
ormap(j-> 2*j-n in s, s), 0, expand(x*b(n-1, s union {n}))))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(
`if`(n=0, 1, b(n-1, {n}))):
seq(T(n), n=0..16);
-
b[n_, s_] := b[n, s] = If[n == 0, x, b[n-1, s] + If[
AnyTrue[s, MemberQ[s, 2#-n]&], 0, Expand[x*b[n-1, s ~Union~ {n}]]]];
T[n_] := If[n == 0, {1}, CoefficientList[b[n-1, {n}], x]];
T /@ Range[0, 16] // Flatten (* Jean-François Alcover, May 03 2021, after Alois P. Heinz *)
A262347
Number of subsets of [1..n] of maximal size that are free of 3-term arithmetic progressions.
Original entry on oeis.org
1, 1, 1, 3, 2, 1, 4, 10, 25, 4, 24, 7, 25, 6, 1, 4, 14, 43, 97, 220, 2, 18, 62, 232, 2, 33, 2, 12, 36, 106, 1, 11, 2, 4, 14, 40, 2, 4, 86, 307, 20, 1, 4, 14, 41, 99, 266, 674, 1505, 3510, 7726, 14, 50, 156, 2, 8, 26, 56, 2, 4, 6, 14, 48, 2, 4, 8, 16, 28, 108, 319, 1046, 4, 26, 82, 1, 2
Offset: 0
The largest subset of [1,6] that doesn't have any 3 terms in arithmetic progression has size 4. There are 4 such subsets with this property: {1,2,4,5}, {1,2,5,6}, {1,3,4,6} and {2,3,5,6}, so a(6)=4.
-
G:= proc(n, cons, t)
option remember;
local consn, consr;
if n < t or member({},cons) then return {} fi;
if t = 0 then return {{}} fi;
consn, consr:= selectremove(has,cons,n);
consn:= subs(n=NULL,consn);
procname(n-1,consr,t) union
map(`union`,procname(n-1,consr union consn,t-1),{n});
end proc:
F:= proc(n)
local m,cons,R;
m:= A003002(n-1);
cons:= {seq(seq({i,i+j,i+2*j},i=1..n-2*j),j=1..(n-1)/2)};
R:= G(n,cons,m+1);
if R = {} then
A003002(n):= m;
G(n,cons,m);
else
A003002(n):= m+1;
R
fi
end proc:
A003002(1):= 1:
a[1]:= 1:
for n from 2 to 40 do
a[n]:= nops(F(n))
od:
seq(a[i],i=1..40); # Robert Israel, Sep 20 2015
-
A003002 = Cases[Import["https://oeis.org/A003002/b003002.txt", "Table"], {, }][[All, 2]];
a[n_] := a[n] = Count[Subsets[Range[n], {A003002[[n+1]]}], s_ /; !MatchQ[s, {_, n1_, _, n2_, _, n3_, _} /; n2 - n1 == n3 - n2]];
Table[Print[n, " ", a[n]]; a[n], {n, 0, 25}] (* Jean-François Alcover, May 30 2020 *)
A300760
Number of ways to select 4 numbers from the set of the first n natural numbers avoiding 3-term arithmetic progressions.
Original entry on oeis.org
0, 1, 4, 10, 25, 51, 98, 165, 267, 407, 601, 849, 1175, 1580, 2089, 2703, 3452, 4338, 5395, 6622, 8058, 9706, 11606, 13758, 16210, 18963, 22066, 25520, 29379, 33645, 38376, 43571, 49293, 55545, 62391, 69831, 77937, 86710, 96223, 106477, 117550, 129444, 142241
Offset: 4
There are 4 selections of 4 natural numbers from the set {1,2,3,4,5,6} free of 3-term arithmetic progressions: {1,2,4,5}, {1,2,5,6}, {1,3,4,6}, {2,3,5,6}.
- Heinrich Ludwig, Table of n, a(n) for n = 4..1000
- Index entries for linear recurrences with constant coefficients, signature (2,0,-1,0,-2,2,0,1,0,-2,1).
-
Array[(#^4 - 12 #^3 + 51 #^2 - 78 # + 32)/24 + Boole[OddQ@ #] (-# + 2)/4 - Boole[Mod[#, 3] == 0]/3 - Boole[Mod[#, 4] == 0] &, 43, 4] (* Michael De Vlieger, Mar 14 2018 *)
LinearRecurrence[{2,0,-1,0,-2,2,0,1,0,-2,1},{0,1,4,10,25,51,98,165,267,407,601},50] (* Harvey P. Dale, Feb 18 2024 *)
-
concat(0, Vec(x^5*(1 + 2*x + 2*x^2 + 6*x^3 + 5*x^4 + 8*x^5) / ((1 - x)^5*(1 + x)^2*(1 + x^2)*(1 + x + x^2)) + O(x^60))) \\ Colin Barker, Aug 06 2018
A334894
Number of maximal subsets of [n] avoiding 3-term arithmetic progressions and containing n if n>0.
Original entry on oeis.org
1, 1, 1, 2, 2, 1, 3, 6, 15, 4, 20, 7, 18, 6, 1, 3, 10, 29, 54, 123, 2, 16, 44, 170, 2, 31, 2, 10, 24, 70, 1, 10, 2, 2, 10, 26, 2, 2, 82, 221, 20, 1, 3, 10, 27, 58, 167, 408, 831, 2005, 4216, 14, 36, 106, 2, 6, 18, 30, 2, 2, 2, 8, 34, 2, 2, 4, 8, 12, 80, 211
Offset: 0
Showing 1-6 of 6 results.
Comments