[go: up one dir, main page]

login
A070868
a(1) = a(2) = 1; a(n) = a(a(n-1)) + a(n+1 - 2*a(n-1)).
2
1, 1, 2, 2, 2, 3, 3, 4, 3, 4, 4, 4, 5, 4, 6, 5, 6, 6, 7, 6, 7, 6, 7, 7, 7, 8, 8, 9, 7, 9, 7, 10, 8, 11, 8, 11, 9, 10, 10, 11, 10, 11, 10, 11, 11, 11, 12, 11, 13, 12, 13, 13, 14, 12, 14, 11, 15, 13, 16, 12, 14, 12, 15, 14, 14, 14, 15, 16, 15, 16, 16, 15, 17, 16, 16, 16, 16, 17, 17, 18
OFFSET
1,3
REFERENCES
S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 129.
FORMULA
a(n) = a(a(n-1)) + a(n+1 -2*a(n-1)), with a(1) = a(2) = 1.
MATHEMATICA
a[1]=a[2]=1; a[n_]:= a[n]= a[a[n-1]] +a[n+1 -2*a[n-1]]; Table[a[n], {n, 80}]
PROG
(Sage)
@CachedFunction
def a(n): # A070868
if (n<3): return 1
else: return a(a(n-1)) + a(n+1 -2*a(n-1))
[a(n) for n in (1..90)] # G. C. Greubel, Mar 28 2022
CROSSREFS
Cf. A070881.
Sequence in context: A177903 A107325 A003050 * A342219 A272612 A155216
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, May 19 2002
EXTENSIONS
More terms from Robert G. Wilson v, May 20 2002
STATUS
approved