%I #48 Jul 01 2026 20:14:16
%S 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,
%T 13,15,17,21,26,18,22,22,24,27,22,26,30,28,37,20,26,36,27,27,29,29,31,
%U 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
%N 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.
%C Conjecture: Many numbers, beginning with 5 and 9, never occur in this sequence (see A397471).
%C It follows from the Erdős-Fuchs theorem that the average behavior of a representation function cannot be too close to a linear function, but it is still possible to give an estimate for the growth of this sequence as n/sqrt(2) because if we write g(x) = Sum_{k>=0} x^floor(k/sqrt(2)), then we know that [x^m] (1/2)*(g(x)^2-g(x^2)) will be relatively close to m or even exactly m in many cases. - _Thomas Scheuerle_, Jun 29 2026
%H Sean A. Irvine, <a href="/A394611/b394611.txt">Table of n, a(n) for n = 1..10000</a>
%H Sean A. Irvine, <a href="/A394611/a394611_1.txt.gz">Table of n, a(n) for n = 1..1000000</a> [4.3M, gzip]
%F a(n) = [x^a(n-1)] (1/2)*(g(x)^2-g(x^2)), where g(x) = Sum_{k=1..n-1} x^a(k). - _Thomas Scheuerle_, Jun 29 2026
%e a(2) = 0, since we only have one previous term.
%e a(3) = 1, since a(1) + a(2) = a(2).
%e a(4) = 2, since a(1) + a(3) = a(3) and a(2) + a(3) = a(3).
%o (Python)
%o def sequence(N=100):
%o a = [0] # a(1) = 0
%o for n in range(1, N):
%o target = a[n - 1] # a(n)
%o count = 0
%o # count pairs (i < j) with i,j in [0..n-1]
%o for i in range(n):
%o for j in range(i + 1, n):
%o if a[i] + a[j] == target:
%o count += 1
%o a.append(count)
%o return a
%o seq = sequence(100)
%o print(seq)
%o (Python)
%o from collections import Counter
%o from itertools import islice
%o def A394611_gen(): # generator of terms
%o alst, an, c = [], 0, Counter()
%o while True:
%o an = c[an]
%o yield an
%o c.update(an+ai for ai in alst)
%o alst.append(an)
%o print(list(islice(A394611_gen(), 83))) # _Michael S. Branicky_, Jun 26 2026
%o (PARI)
%o ListA(max_n) = {my(M=Map(), v=[0], c=0, p=0); while(#v<max_n, c=0; mapisdefined(M, v[#v], &c); v=concat(v, c); for(k=1, #v-1, c=0; p=v[#v]+v[k]; mapisdefined(M, p, &c); mapput(~M, p, c+1))); v} \\ _Thomas Scheuerle_, Jun 29 2026
%Y Cf. A393702, A395907, A397173-A397180, A397471.
%K nonn,new
%O 1,4
%A _Joshua B. Weinstein_, Jun 18 2026