OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..3327
MAPLE
M:= n -> 2*n - 2 - 2^(ilog2(n-2)+1):
A:= proc(n) option remember; S(n-1) - procname(M(n)) end proc:
S:= proc(n) option remember; A(n) + procname(n-1) end proc:
S(1):= 1: A(1):= 1: A(2):= 3:
map(A, [$1..50]); # Robert Israel, Jan 17 2020
PROG
(PARI) lista(nn) = { nn = max(nn, 3); my(va = vector(nn)); va[1] = 1; va[2] = 3; va[3] = 1; my(sa = vecsum(va)); for (n=4, nn, va[n] = sa - va[2*(n - 1 - 2^logint(n-2, 2))]; sa += va[n]; ); va; } \\ Petros Hadjicostas, May 03 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Name edited by Petros Hadjicostas, Apr 26 2020
STATUS
approved