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.

A040115 Concatenate absolute values of differences between adjacent digits of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1
Offset: 0

Views

Author

Keywords

Comments

Let the decimal expansion of n be abcd...efg, say. Then a(n) has decimal expansion |a-b| |b-c| |c-d| ... |e-f| |f-g|. Leading zeros in a(n) are omitted.
From M. F. Hasler, Nov 09 2019: (Start)
This sequence coincides with A080465 up to a(109) but is thereafter completely different.
Eric Angelini calls a(n) the "ghost" of the number n and considers iterations of n -> n +- a(n) depending on parity of a(n), cf. A329200 and A329201. (End)

Examples

			a(371) = 46, for example.
a(110) = 01 = 1, while A080465(110) = 10 - 1 = 9. - _M. F. Hasler_, Nov 09 2019
		

Crossrefs

Cf. A329200, A329201: iterations of n +- a(n).

Programs

  • Mathematica
    Table[FromDigits[Abs[Differences[IntegerDigits[n]]]],{n,110}] (* Harvey P. Dale, Dec 16 2021 *)
  • PARI
    apply( A040115(n)=fromdigits(abs((n=digits(n+!n))[^-1]-n[^1])), [10..199]) \\ Works for all n >= 0. - M. F. Hasler, Nov 09 2019

Formula

a(n) = 0 iff n is a repdigit >= 11 (A010785). - Bernard Schott, May 09 2022

Extensions

Definition clarified by N. J. A. Sloane, Aug 19 2008
Name edited by M. F. Hasler, Nov 09 2019
Terms a(0) = a(1) = ... = a(9) = 0 prepended by Max Alekseyev, Jul 26 2024