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.

A241494 Pyramid Top Numbers: write the decimal digits of 'n' (a nonnegative integer) and take successive absolute differences ("pyramidalization"). The number at the top of the pyramid is 'a(n)'.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 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
Offset: 0

Views

Author

Filipi R. de Oliveira, Apr 24 2014

Keywords

Comments

Through the so-called "pyramidalization" process (see A227876), a given nonnegative integer is expanded into its digits and transformed into a pyramid of successive absolute differences between digits. The present sequence is built only with the top number 'a(n)' generated from its correspondent nonnegative integer 'n'.

Examples

			If n=1735, a(n)=0:
______0 ------>a(n)
____2_:_2
__6_:_4_:_2
1_:_7_:_3_:_5
		

Crossrefs

Cf. A227876 for the pyramidalization process.
Cf. A076313 - its first 100 terms have the same absolute value, diverging afterwards; cf. A225693 and A055017 (A040997) for the same reason.

Programs

  • PARI
    a(n)=my(d=Vecsmall(digits(n))); forstep(k=#d-1,1,-1, for(j=1,k, d[j]=abs(d[j]-d[j+1]))); d[1] \\ Charles R Greathouse IV, Apr 24 2025

Formula

a(n)=n, if 0<=n<=9.
a(n)=|mod(n;10)-floor(n/10)|, if 10<=n<=99.