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.

A339141 a(n) = reverse(10*n - a(n-1)), with n>1, a(1) = 1.

Original entry on oeis.org

1, 91, -16, 65, -51, 111, -14, 49, 14, 68, 24, 69, 16, 421, -172, 233, -36, 612, -224, 424, -412, 236, -6, 642, -293, 355, -58, 833, -345, 546, -632, 259, 17, 323, 72, 882, -215, 595, -502, 209, 102, 813, -383, 328, 221, 932, -264, 447, 34, 664, -451
Offset: 1

Views

Author

Clément Vovard, Nov 25 2020

Keywords

Comments

Note that for x<0, reverse(x) is defined by -1*reverse(-x).
Starting the sequence with other numbers also gives similar-looking graphs.

Examples

			For n = 2, 10*n = 10*2 = 20, 20 - a(n-1) = 20 - 1 = 19, reverse(19) = 91.
For n = 3, 10*n = 10*3 = 30, 30 - a(3-1) = 30 - 91 = -61, reverse(-61) = -16.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<2, n, (p-> signum(p)* (f->
          parse(cat(f[-i]$i=1..length(f))))(""||(abs(p))))(10*n-a(n-1)))
        end:
    seq(a(n), n=1..60);  # Alois P. Heinz, Jan 06 2021
  • Mathematica
    nmax=51; a[1]=1; a[n_]:=Sign[10n-a[n-1]]IntegerReverse[10n-a[n-1]]; Table[a[n],{n,nmax}] (* Stefano Spezia, Dec 05 2020 *)
  • PARI
    rev(n) = sign(n)*fromdigits(Vecrev(digits(n)));
    a(n) = if (n==1, 1, rev(10*n-a(n-1))); \\ Michel Marcus, Dec 05 2020

Formula

a(n) = reverse(10*n - a(n-1)) where reverse means reverse the order of the digits.