OFFSET
0,2
LINKS
FORMULA
a(n+3) = a(n+2)+2a(n+1)-a(n) for n=5, n>=8.
EXAMPLE
For n=4, a(4) = 10, because the numbers which cannot be expressed as a sum of any of 0,2,4,7 are 1,3,5,8,10,12,14,15,...
PROG
(Python)
MAX=10000
dp=[False]*(MAX+2)
an=0
dp[an]=True
while an<MAX:
print(an)
while dp[an]:
an+=1
an+=1
while dp[an]:
an+=1
for i in reversed(range(an, MAX)):
dp[i]|=dp[i-an]
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Akihiko Yoshida, Apr 11 2021
STATUS
approved