cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A369543 a(0) = 1; for n >= 0, a(n+1) = n - a(n) if a(n) odd, else a(n+1) = floor((3*n + a(n))/2).

Original entry on oeis.org

1, -1, 2, 4, 6, 9, -4, 7, 0, 12, 19, -9, 20, 28, 33, -19, 34, 41, -24, 15, 4, 32, 47, -25, 48, 60, 67, -41, 68, 76, 81, -51, 82, 89, -56, 23, 12, 60, 85, -47, 86, 103, -62, 32, 80, 106, 120, 129, -82, 31, 18, 84, 118, 137, -84, 39, 16, 92, 131, -73, 132, 156, 169, -107
Offset: 0

Views

Author

Ctibor O. Zizka, Jan 25 2024

Keywords

Comments

After a chaotic part, at n = 358 the sequence settles down and becomes quasi-periodic with a 6-loop. For some choices of the initial term a(0) the sequence stays chaotic.

Examples

			For n = 0, a(0) = 1.
For n = 1, a(0) is odd, thus a(1) = 0 - 1 = -1.
For n = 2, a(1) is odd, thus a(2) = 1 - (-1) = 2.
For n = 3, a(2) is even, thus a(3) = floor((3*2 + a(2))/2) = 4.
etc.
		

Crossrefs

Cf. A133058.

Programs

  • Mathematica
    a[0] = 1; a[n_] := a[n] = If[OddQ[a[n - 1]], n - 1 - a[n - 1], Floor[(3*n - 3 + a[n - 1])/2]]; Array[a, 100, 0] (* Amiram Eldar, Jan 26 2024 *)

Formula

For k >= 0 :
a(358 + 6*k) = 1062 + 18*k.
a(359 + 6*k) = 1068 + 18*k.
a(360 + 6*k) = 1072 + 18*k.
a(361 + 6*k) = 1076 + 18*k.
a(362 + 6*k) = 1079 + 18*k.
a(363 + 6*k) = -717 - 12*k.