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..10000
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
