OFFSET
1,1
COMMENTS
The sequence is a solution to the recursion a(a(n) + n) = a(n) + 4n, which is similar to the Golomb recursion b(b(n) + kn) = 2b(n) + kn, k=1,2,...
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
E. J. Barbeau, J. Chew and S. Tanny, A matrix dynamics approach to Golomb's recursion, Electronic J. Combinatorics, #4.1 16 1997.
FORMULA
a(1)=1, a(2*3^m+r) = 8*3^m - 2r with m=0, 1, 2, ..., 0 <= r <= 4*3^m - 1. - Ralf Stephan, Jan 16 2003
a(n) = 12*3^floor(log(n/2)/log(3)) - 2*n. - Benoit Cloitre, Jan 23 2003
MATHEMATICA
Table[12*3^Floor[Log[n/2]/Log[3]] - 2*n , {n, 1, 50}] (* G. C. Greubel, Nov 27 2016 *)
PROG
(PARI) a(n) = if(n==1, 2, m=floor(log(n/2)/log(3)); r=n-2*3^m; 8*3^m-2*r)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Edited by Ralf Stephan, Jan 16 2003
STATUS
approved