|
|
A330772
|
|
a(n) = 1 for n<1; for n >= 0, a(n+1) = 2*a(n-a(n)).
|
|
7
|
|
|
2, 2, 2, 4, 2, 4, 4, 4, 8, 4, 8, 4, 8, 4, 8, 8, 8, 16, 4, 16, 8, 16, 8, 16, 8, 16, 8, 8, 32, 2, 16, 16, 16, 16, 32, 4, 32, 4, 32, 8, 32, 16, 32, 16, 16, 64, 2, 32, 16, 32, 32, 8, 32, 16, 8, 4, 16, 64, 2, 32, 16, 32, 4, 4, 64, 4, 64, 4, 8, 32, 8, 8, 8, 128
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
From the current term count back the same number of terms and double it to obtain the next term. Because a(n) can exceed n, negative indexes are also occasionally referenced.
|
|
LINKS
|
|
|
EXAMPLE
|
a(1) = 2*a(0-a(0)) = 2*a(-1) = 2.
a(2) = 2*a(1-a(1)) = 2*a(-1) = 2.
a(3) = 2*a(2-a(2)) = 2*a(0) = 2.
a(4) = 2*a(3-a(3)) = 2*a(1) = 4.
|
|
PROG
|
(Python)
a = [2]
for n in range(1000):
if(a[n] > n):
a.append(2)
else:
a.append(2*a[n-a[n]])
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|