login
A376635
a(n+1) = size of the largest subset S of 1...n such that i+j <= n implies a(i+j) = a(i)+a(j) for i and j in S. Start with a(1) = 1.
0
1, 1, 1, 2, 3, 3, 4, 5, 4, 5, 5, 6, 7, 8, 9, 9, 8, 9, 10, 11, 12, 13, 12, 12, 13, 14, 15, 16, 17, 17, 16, 17, 17, 17, 17, 18, 19, 20, 21, 22, 23, 23, 22, 23, 24, 24, 24, 25, 25, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 35, 35, 36, 37, 37, 37, 37, 38, 38, 39, 39
OFFSET
1,4
LINKS
MAPLE
f:= proc(n) local V, E, G, i, j; uses GraphTheory;
V:= select(t -> 2*t > n or 2*A[t] = A[2*t], [$1..n]);
E:= select(t -> t[1]+t[2] <= n and A[t[1]]+A[t[2]] <> A[t[1]+t[2]], {seq(seq({V[i], V[j]}, i=1..j-1), j=1..nops(V))});
G:= Graph(V, E);
IndependenceNumber(G)
end proc:
A[1]:= 1:
for n from 1 to 99 do A[n+1]:= f(n) od:
seq(A[i], i=1..100); # Robert Israel, Oct 31 2024
PROG
(Python)
from itertools import combinations, count, islice
def c(n, s, a): # test the condition for subset s
for ii, i in enumerate(s):
for j in s[ii:]:
if i+j <= n:
if a[i] + a[j] != a[i+j]:
return False
else:
break
return True
def agen(): # generator of terms
a, valid = [None, 1], [tuple()]
yield 1
for n in count(1):
new_valid, r = [], 0
for s in valid:
if c(n, s, a):
new_valid.extend([s, s+(n, )])
r = max(r, len(s)+1)
valid = new_valid
yield r
a.append(r)
print(list(islice(agen(), 30))) # Michael S. Branicky, Oct 01 2024
CROSSREFS
Sequence in context: A280386 A204979 A243351 * A071585 A328801 A106500
KEYWORD
nonn,new
AUTHOR
Bryle Morga, Sep 30 2024
EXTENSIONS
a(23)-a(58) from Michael S. Branicky, Oct 01 2024
More terms from Robert Israel, Oct 31 2024
STATUS
approved