login
A339141
a(n) = reverse(10*n - a(n-1)), with n>1, a(1) = 1.
1
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,2
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.
LINKS
FORMULA
a(n) = reverse(10*n - a(n-1)) where reverse means reverse the order of the digits.
EXAMPLE
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.
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 *)
PROG
(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
CROSSREFS
Sequence in context: A364664 A119656 A368238 * A180006 A259085 A033411
KEYWORD
sign,look,base
AUTHOR
Clément Vovard, Nov 25 2020
STATUS
approved