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.

Showing 1-1 of 1 results.

A345886 a(1) = 1, a(n) = a(n-1)/3 if a(n-1) is divisible by 3, otherwise a(n) = n - a(n-1).

Original entry on oeis.org

1, 1, 2, 2, 3, 1, 6, 2, 7, 3, 1, 11, 2, 12, 4, 12, 4, 14, 5, 15, 5, 17, 6, 2, 23, 3, 1, 27, 9, 3, 1, 31, 2, 32, 3, 1, 36, 12, 4, 36, 12, 4, 39, 13, 32, 14, 33, 11, 38, 12, 4, 48, 16, 38, 17, 39, 13, 45, 15, 5, 56, 6, 2, 62, 3, 1, 66, 22, 47, 23, 48, 16, 57, 19, 56, 20, 57, 19, 60, 20, 61, 21, 7, 77, 8
Offset: 1

Views

Author

Altug Alkan, Jun 28 2021

Keywords

Comments

See comments section of A345877.

Crossrefs

Cf. A345877.

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = If[Divisible[a[n - 1], 3], a[n - 1]/3, n - a[n - 1]]; Array[a, 100] (* Amiram Eldar, Jun 29 2021 *)
  • PARI
    q=vector(100); q[1]=1; for(n=2, #q, q[n] = if(q[n-1]%3, n-q[n-1], q[n-1]/3)); q
Showing 1-1 of 1 results.