OFFSET
0,10
COMMENTS
The sequence derives from an "open middle" task for first graders:
"Using the digits 1 to 9 at most one time each, place a digit in each place to create a true statement: __ = __ + __ = __ + __ + __." There are four ways to do this and we ask what happens if we increase our available numbers. Thus we are counting ways to make these sums from 6 distinct numbers, so it makes sense to start at 6 numbers. (Otherwise there are some uninteresting leading zeros.)
LINKS
David A. Corneth, Table of n, a(n) for n = 0..10000 (first 101 terms from Jean-Marc Rebert)
Index entries for linear recurrences with constant coefficients, signature (1,1,0,0,-2,1,-1,0,1,-1,2,0,0,-1,-1,1).
FORMULA
G.f.: -x^8*(5*x^7 +4*x^6 +6*x^5 +6*x^4 +6*x^3 +5*x^2 +3*x +1)/((x^2+1) *(x^2-x+1) *(x^2+x+1)^2 *(x+1)^3 *(x-1)^5). - Alois P. Heinz, Apr 30 2023
EXAMPLE
The task of finding distinct numbers a, b, c, d, e, f from {1, ..., n} is impossible for n < 8, so a(n) = 0 for n < 8.
For n = 8, there is one possibility of choosing the six numbers, 1 + 3 + 4 = 2 + 6 = 8, so a(8) = 1.
For n = 9, there are four possibilities: 1 + 3 + 4 = 2 + 6 = 8, 1 + 2 + 6 = 4 + 5 = 9, 1 + 3 + 5 = 2 + 7 = 9, 2 + 3 + 4 = 1 + 8 = 9, so a(9) = 4.
MATHEMATICA
LinearRecurrence[{1, 1, 0, 0, -2, 1, -1, 0, 1, -1, 2, 0, 0, -1, -1, 1}, {0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 10, 20, 36, 60, 93, 141}, 100] (* Paolo Xausa, Aug 13 2023 *)
PROG
(Python)
import itertools
sequence = []
n = 30 # Gives the sequence for sets {1, ..., 30}
for k in range (1, n):
adder = 0
choice = itertools.permutations(range(1, k), r=6)
for perm in choice:
if perm[0] == perm[3] + perm[4] + perm[5]:
if perm[0] == perm[1] + perm[2]:
adder+=1
sequence.append(adder//12) # Each combination is counted 12 times
print(sequence)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ingólfur Gíslason, Apr 30 2023
STATUS
approved