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)'.
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
Examples
If n=1735, a(n)=0: ______0 ------>a(n) ____2_:_2 __6_:_4_:_2 1_:_7_:_3_:_5
Links
- Filipi R. de Oliveira, Table of n, a(n) for n = 0..9999
Crossrefs
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.
Comments