login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A051013 Number of nonaveraging sequences on {1,2,...,n}. 6
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,2

LINKS

Table of n, a(n) for n=0..40.

Eric Weisstein's World of Mathematics, Nonaveraging Sequence

Wikipedia, Salem-Spencer set

Index entries related to non-averaging sequences

FORMULA

a(n) = 2^n - A018788(n). - David Nacin, Mar 03 2012

EXAMPLE

The only subset of s = {1,2,3} that contains a 3-term arithmetic progression is s itself, so a(3) = 7.

MATHEMATICA

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 *)

PROG

(Python)

#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

CROSSREFS

Cf. A018788.

Row sums of A334187.

Sequence in context: A001036 A054150 A130709 * A128609 A335471 A168043

Adjacent sequences:  A051010 A051011 A051012 * A051014 A051015 A051016

KEYWORD

nonn

AUTHOR

Eric W. Weisstein

EXTENSIONS

More terms from John W. Layman, Nov 27 2001

a(29)-a(37) from Donovan Johnson, Aug 15 2010

a(38)-a(40) from Alois P. Heinz, Oct 27 2011

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 26 23:32 EDT 2020. Contains 337378 sequences. (Running on oeis4.)