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.

User: Filipi R. de Oliveira

Filipi R. de Oliveira's wiki page.

Filipi R. de Oliveira has authored 5 sequences.

A253015 Sequence of determinants of matrices based on the digits of nonnegative integers.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, 1, -1, -5, -11, -19, -29, -41, -55, -71, -4, -1, 4, 1, -4, -11, -20, -31, -44, -59, -9, -5, 1, 9, 5, -1, -9, -19, -31, -45, -16, -11, -4, 5, 16, 11, 4, -5, -16
Offset: 0

Author

Filipi R. de Oliveira, Dec 25 2014

Keywords

Comments

A given nonnegative integer is transformed into a square matrix whose order equals the quantity of the number's digits. Each element of the main diagonal is a digit of this original number, while other elements are calculated from this diagonal. The determinant of this matrix is the element of the sequence.

Examples

			For n=124, a(124)=2, as follows:
B(1,1) = 1;
B(2,2) = 2;
B(3,3) = 4;
B(1,2) = abs(B(1,1) - B(2,2)) = abs(1-2) = 1;
B(2,3) = abs(B(2,2) - B(3,3)) = abs(2-4) = 2;
B(1,3) = abs(B(1,2) - B(2,3)) = abs(1-1) = 1;
B(2,1) = B(1,1) + B(2,2) = 1 + 2 = 3;
B(3,2) = B(2,2) + B(3,3) = 2 + 4 = 6;
B(3,1) = B(2,1) + B(3,2) = 3 + 6 = 9.
Thus,
_______|1 1 1|
B(124)=|3 2 2| --> det(B(124)) = a(124) = 2.
_______|9 6 4|
		

Crossrefs

See A227876, since the process of matrix construction is this so-called "pyramidalization".

Formula

a(n) = det(B) where B is the n X n matrix with B(i,i) given by the i-th digit of n, B(i,j) = abs(B(i,j-1)-B(i+1,j)) if i < j and B(i,j) = B(i-1,j) + B(i,j+1) if i > j.

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

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.

A240237 Concatenated digits of pyramidalized numbers: Write the decimal digits of n (a nonnegative integer) and take successive absolute differences ("pyramidalization"), then concatenate, from left to right, all the digits in each level of the pyramid, and finally concatenate those results for all levels, from the base up. The result is a(n).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 101, 110, 121, 132, 143, 154, 165, 176, 187, 198, 202, 211, 220, 231, 242, 253, 264, 275, 286, 297, 303, 312, 321, 330, 341, 352, 363, 374, 385, 396, 404, 413, 422, 431, 440, 451, 462, 473, 484, 495, 505, 514, 523, 532, 541, 550, 561, 572, 583, 594, 606, 615
Offset: 0

Author

Filipi R. de Oliveira, Apr 02 2014

Keywords

Comments

Through the so-called "pyramidalization" process a given nonnegative integer is decomposed into its digits, which are "reassembled" afterwards by concatenating each level of the pyramid (separately, from left to right) and subsequently concatenating these results, from the base to the top.
The number of digits of the resulting number is the triangular number t(d) where d is the number of digits in the original number n.

Examples

			a(1248) = 1248124121:
     1    --> 1
    1 2   --> 1.2
   1 2 4  --> 1.2.4
  1 2 4 8 --> 1.2.4.8 -->> 1248.124.12.1 --> 1248124121
		

Crossrefs

Cf. A227876, which describes the pyramidalization process, and A000217 (triangular numbers). Cf. also A007908.

Formula

a(n) = n for 0 <= n <= 9;
a(n) = 10*n + |floor(n/10) - (n mod 10)| for 10 <= n <= 99.

A238986 Ground Pyramidalized Numbers: Write the decimal digits of 'n' (a nonnegative integer) and take successive absolute differences ("pyramidalization"), then sum all digits of each level of the pyramid. If total is greater than 9, repeat the process until result is between 0 and 9, which is 'a(n)' (0 <= a(n) <= 9).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 2, 2, 4, 6, 8, 2, 4, 8, 4, 4, 4, 4, 4, 6, 8, 2, 4, 8, 4, 4, 6, 6, 6, 6, 8, 2, 4, 8, 4, 4, 8, 8, 8, 8, 8, 2, 4, 8, 4, 4, 2, 2, 2, 2, 2, 2, 4, 8, 4, 4
Offset: 0

Author

Filipi R. de Oliveira, Mar 07 2014

Keywords

Comments

A given nonnegative integer 'n' is decomposed to its digits and the absolute differences between the digits are taken, then the differences between differences between digits (and so on, until the top of the "gap-pyramid" is reached - we could call this process "pyramidalization"). If the sum 's(n)' of the resulting digits is 0 <= s(n) <= 9, it's 'a(n)'; if greater than 9, the same process is applied to the result, and to the subsequent result if necessary, and so on, until the result is smaller than 10.

Examples

			If n=364, a(364)=4, for...
.
____1
__3_:_2__ -->b'(364)=3+6+4+|3-6|+|6-4|+||3-6|-|6-4||=3+6+4+3+2+1=19>9
3_:_6_:_4
.
__8
1_:_9  --> b''(364)=1+9|1-9|=1+9+8=18>9
.
__7
1_:_8 --> b'''(364)=1+8+|1-8|=1+8+7=16>9
.
__5
1_:_6 --> b''''(364)=1+6+|1-6|=1+6+5=12>9
.
__1
1_:_2 --> b'''''(364)=1+2+|1-2|=1+2+1=4=a(364)
		

Crossrefs

Cf. A227876. The pyramidalization process is applied and reapplied to each term until the result reaches its "ground limit".
Cf. A007318. The pyramidalization process relates to Pascal's Triangle because it is done in the opposite direction (towards the top instead of the base), using the contrary operation (absolute difference instead of sum of the prior terms).

Programs

  • Mathematica
    a[n_] := If[n < 10, n, Block[{d = IntegerDigits@ n, s}, s = Total@ d; While[Length@ d > 1, d = Abs@ Differences@ d; s += Total@d]; If[s < 10, s, a@s]]]; a /@ Range[0, 99] (* Giovanni Resta, Mar 16 2014 *)

Formula

a(n)=n, if 0<=n<=9;
b'(n)=n-9*floor(n/10)+|-n+11*floor(n/10)|, if 10<=n<=99;
b'(n)=a(n), if 0<=b'(n)<=9;
else, b''(n)=b'(n)-9*floor(b'(n)/10)+|-b'(n)+11*floor(b'(n)/10)|;
b''(n)=a(n), if 0<=b''(n)<=9;
else, b'''(n)=...
c'(n)=n-9*floor(n/10)-9*floor(n/100)+|-floor(n/10)+11*floor(n/100)|+|-n+11*floor(n/10)-10*floor(n/100)|+||-floor(n/10)+11*floor(n/100)|-|-n+11*floor(n/10)-10*floor(n/100)||, if 100<=n<=999.
c'(n)=a(n), if 0<=c'(n)<=9;
else, if 10<=c'(n)<=99, c''(n)=c'(n)-9*floor(c'(n)/10)+|-c'(n)+11*floor(c'(n)/10)|;
c''(n)=a(n), if 0<=c''(n)<=9
else, ...

A227876 Write the decimal digits of n and take successive absolute differences; sequence is the sum of all digits at each level of the pyramid.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 2, 2, 4, 6, 8, 10, 12, 14, 16, 18, 4, 4, 4, 6, 8, 10, 12, 14, 16, 18, 6, 6, 6, 6, 8, 10, 12, 14, 16, 18, 8, 8, 8, 8, 8, 10, 12, 14, 16, 18, 10, 10, 10, 10, 10, 10, 12, 14, 16, 18, 12, 12, 12, 12, 12, 12, 12, 14, 16, 18, 14, 14, 14, 14, 14, 14, 14, 14, 16, 18, 16, 16, 16, 16, 16, 16, 16, 16, 16, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 3, 4, 7, 10, 13, 16, 19, 22, 25, 28, 4, 3, 6, 9, 12, 15, 18, 21, 24, 27, 7, 6, 7, 8, 11, 14, 17, 20, 23, 26
Offset: 0

Author

Filipi R. de Oliveira, Oct 25 2013

Keywords

Comments

A given nonnegative integer n is decomposed into its digits and the absolute differences between the digits are taken, then the differences between differences between digits (and so on, until the top of the difference pyramid is reached). The sum of the resulting digits is a(n).

Examples

			a(364)=19
.
____1____
__3_:_2_ --> 3+6+4+|3-6|+|6-4|+||3-6|-|6-4||=3+6+4+3+2+1=19
3_:_6_:_4
		

Crossrefs

Cf. A031298.

Programs

  • Haskell
    a227876 n = fst $ until (null . snd) h (0, a031298_row n) where
                h (s, ds) = (s + sum ds, map abs $ zipWith (-) ds $ tail ds)
    -- Reinhard Zumkeller, Apr 28 2014
  • Mathematica
    Join[{0},Table[Total[Abs[Flatten[NestList[Differences[Abs[#]]&, IntegerDigits[n], IntegerLength[n]-1]]]],{n,130}]] (* Harvey P. Dale, Mar 02 2015 *)
  • PARI
    a(n)=my(d=digits(n),s); while(#d, s+=sum(i=1,#d,d[i]); d=vector(#d-1,i,abs(d[i+1]-d[i]))); s \\ Charles R Greathouse IV, Oct 25 2013
    

Formula

a(n)=n, if 0<=n<=9;
a(n)=n-9*floor(n/10)+|-n+11*floor(n/10)|, if 10<=n<=99;
a(n)=n-9*floor(n/10)-9*floor(n/100)+|-floor(n/10)+11*floor(n/100)|+|-n+11*floor(n/10)-10*floor(n/100)|+||-floor(n/10)+11*floor(n/100)|-|-n+11*floor(n/10)-10*floor(n/100)||, if 100<=n<=999.