login
A394611
a(1) = 0. For n > 1, a(n) is the number of ways to write a(n-1) as the sum of two previous terms with distinct positions in the sequence.
6
0, 0, 1, 2, 2, 4, 3, 4, 6, 6, 8, 7, 6, 10, 11, 6, 12, 13, 10, 15, 8, 14, 18, 14, 20, 16, 19, 13, 13, 15, 17, 21, 26, 18, 22, 22, 24, 27, 22, 26, 30, 28, 37, 20, 26, 36, 27, 27, 29, 29, 31, 30, 40, 36, 35, 38, 31, 33, 44, 43, 37, 47, 33, 46, 44, 48, 46, 48, 50, 51, 43, 45, 38, 35, 46, 55, 45, 43, 49, 61, 49, 63, 52
OFFSET
1,4
COMMENTS
Conjecture: Many numbers, beginning with 5 and 9, never occur in this sequence (see A397471).
LINKS
Sean A. Irvine, Table of n, a(n) for n = 1..1000000 [4.3M, gzip]
EXAMPLE
a(2) = 0, since we only have one previous term.
a(3) = 1, since a(1) + a(2) = a(2).
a(4) = 2, since a(1) + a(3) = a(3) and a(2) + a(3) = a(3).
PROG
(Python)
def sequence(N=100):
a = [0] # a(1) = 0
for n in range(1, N):
target = a[n - 1] # a(n)
count = 0
# count pairs (i < j) with i, j in [0..n-1]
for i in range(n):
for j in range(i + 1, n):
if a[i] + a[j] == target:
count += 1
a.append(count)
return a
seq = sequence(100)
print(seq)
(Python)
from collections import Counter
from itertools import islice
def A394611_gen(): # generator of terms
alst, an, c = [], 0, Counter()
while True:
an = c[an]
yield an
c.update(an+ai for ai in alst)
alst.append(an)
print(list(islice(A394611_gen(), 83))) # Michael S. Branicky, Jun 26 2026
CROSSREFS
KEYWORD
nonn,new
AUTHOR
Joshua B. Weinstein, Jun 18 2026
STATUS
approved