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.

Showing 1-3 of 3 results.

A380873 Concatenate sum and product of decimal digits of n.

Original entry on oeis.org

0, 11, 22, 33, 44, 55, 66, 77, 88, 99, 10, 21, 32, 43, 54, 65, 76, 87, 98, 109, 20, 32, 44, 56, 68, 710, 812, 914, 1016, 1118, 30, 43, 56, 69, 712, 815, 918, 1021, 1124, 1227, 40, 54, 68, 712, 816, 920, 1024, 1128, 1232, 1336, 50, 65, 710, 815, 920, 1025, 1130, 1235, 1340, 1445, 60
Offset: 0

Views

Author

M. F. Hasler, Apr 01 2025

Keywords

Comments

This sequence is motivated by A271220 and A271268 (maybe others?) which give the trajectory of specific starting values under iterations of this map.
The fixed points of this map, (0, 10, ..., 90, 119, 1236, ...), are listed in sequence A062237 (except for 0).
Besides the fixed points, this map has also limiting cycles, for example:
* the cycle C(88) = (88, 1664, 17144, 17112, 1214) of length 5, first reached for initial values 8 (cf. A271268) and 38, 83, 88, 146, ....
* Another 5-cycle is C(18168) = (18168, 24384, 21768, 24672, 21672), first reached for initial values 188 and 233.
The infinite square array A380872 gives the trajectory of starting value r = 0, 1, 2, ... in row r.

Examples

			For n = 0, ..., 9, a(n) = 11*n because sum and product of digits of n are equal to n.
a(10) = concat(1+0, 1*0) = 10, a(11) = concat(1+1, 1*1) = 21, a(12) = concat(1+2, 1*2) = 32, etc.
		

Crossrefs

Cf. A007953 (sum of digits), A007954 (product of digits).
Cf. A062237 (fixed points of this map).
Cf. A271220 (trajectory of 6), A271268 (trajectory of 8), A380872 (trajectories of all nonnegative integers as rows of a table).

Programs

  • Maple
    a:= n-> (l-> parse(cat(add(i, i=l), mul(i, i=l))))(convert(n, base, 10)):
    seq(a(n), n=0..60);  # Alois P. Heinz, Apr 12 2025
  • Mathematica
    a[n_]:=FromDigits[Join[IntegerDigits[Total[IntegerDigits[n]]],IntegerDigits[Times@@IntegerDigits[n]]]];Array[a,61,0] (* James C. McMahon, Apr 02 2025 *)
  • PARI
    apply( {A380873(n)=eval(Str(vecsum(n=digits(n)),if(n,vecprod(n))))}, [0..99])
    
  • Python
    from math import prod
    def A380873(n): return int(f"{sum(d:=list(map(int,str(n))))}{prod(d)}")
    print(first_99 := list(map(A380873,range(99))))

A380872 Infinite square array, where row r >= 0 is the orbit of r under the map A380873: concatenate(sum of digits, product of digits).

Original entry on oeis.org

0, 0, 1, 0, 11, 2, 0, 21, 22, 3, 0, 32, 44, 33, 4, 0, 56, 816, 69, 44, 5, 0, 1130, 1548, 1554, 816, 55, 6, 0, 50, 18160, 15100, 1548, 1025, 66, 7, 0, 50, 160, 70, 18160, 80, 1236, 77, 8, 0, 50, 70, 70, 160, 80, 1236, 1449, 88, 9, 0, 50, 70, 70, 70, 80, 1236, 18144, 1664, 99, 10, 0, 50, 70, 70, 70, 80, 1236, 18128, 17144, 1881, 10, 11, 0, 50, 70, 70, 70, 80, 1236, 20128, 17112, 1864
Offset: 0

Views

Author

M. F. Hasler, Apr 01 2025

Keywords

Comments

As usual and required by the "table" display function, the array is read by falling antidiagonals.

Examples

			The array starts as follows: (Elements in column 0 are also equal to the row index.)
col.0|  1 |  2 |  3  |  4  |  5  |  6 |  7 |  8  |  9  |  10 |  11 | 12 |  13 |  14
-----+----+----+-----+-----+-----+----+----+-----+-----+-----+-----+----+-----+-----
   0    0     0     0     0     0    0    0     0     0     0     0    0     0     0
   1   11    21    32    56  1130   50   50    50    50    50    50   50    50    50
   2   22    44   816  1548 18160  160   70    70    70    70    70   70    70    70
   3   33    69  1554 15100    70   70   70    70    70    70    70   70    70    70
   4   44   816  1548 18160   160   70   70    70    70    70    70   70    70    70
   5   55  1025    80    80    80   80   80    80    80    80    80   80    80    80
   6   66  1236  1236  1236  1236 1236 1236  1236  1236  1236  1236 1236  1236  1236
   7   77  1449 18144 18128 20128  130   40    40    40    40    40   40    40    40
   8   88  1664 17144 17112  1214   88 1664 17144 17112  1214    88 1664 17144 17112
   9   99  1881  1864 19192 22162 1348 1696 22324  1396 19162 19108  190   100    10
  10   10    10    10    10    10   10   10    10    10    10    10   10    10    10
  11   21    32    56  1130    50   50   50    50    50    50    50   50    50    50
  ...  ...  ...
For example, row 1 is the trajectory of 1 under the map A380873: 1 -> concat (1,1) = 11 -> concat(1+1, 1*1) = 21 -> concat(2+1,2*1) = 32 -> concat(3+2,3*2) = 56 -> ...
Most of the  initial rows reach a fixed point after not too many iterations, but for example row 8 (A271268) and also 38, 83, 88, 146,... reach a cycle of length 5, C(88) = (88, 1664, 17144, 17112, 1214). Another 5-cycle is C(18168) = (18168, 24384, 21768, 24672, 21672), first reached in row 188 and 233.
Fixed points (see A062237) are the multiples of 10 less than 100, and 119 and 1236 (for row 6, 66, 123, ...), 19144 (row 289), and others.
		

Crossrefs

Cf. A380873 (iterated function), A007953 (sum of digits), A007954 (product of digits).
Cf. A271220 (row 6), A271268 (row 8).

Programs

  • PARI
    A380872_row(r, num_columns=30)=vector(num_columns, i, r=if(i>1, eval(Str(vecsum(r=digits(r)), if(r, vecprod(r)))), r))
    A380872_array(rows=9, cols=rows)=Mat(vectorv(rows,i,A380872_row(i-1, cols)))

Formula

A(r,0) = r; A(r,n+1) = A380873(A(r,n)) = concat(A007953(A(r,n)), A007954(A(r,n))).

A271268 Concatenate sum of digits of previous term and product of digits of previous term, starting with 8.

Original entry on oeis.org

8, 88, 1664, 17144, 17112, 1214, 88, 1664, 17144, 17112, 1214, 88, 1664, 17144, 17112, 1214, 88, 1664, 17144, 17112, 1214, 88, 1664, 17144, 17112, 1214, 88, 1664, 17144, 17112, 1214, 88, 1664, 17144, 17112, 1214, 88, 1664, 17144, 17112, 1214, 88, 1664, 17144
Offset: 0

Views

Author

Sander Claassen, Apr 03 2016

Keywords

Comments

Each term is created by calculating the sum of the digits of the previous number, and the product of its digits. The results are concatenated to give the new number. Starting with 8, the second number is 88. The third number is generated as follows: 8+8 = 16, 8*8 = 64, which gives 1664. Continuing this way, the 7th number in this sequence becomes 88, equal to the second number of the sequence. Therefore, the pattern 88, 1664, 17144, 17112, 1214, ... repeats indefinitely.

Crossrefs

Cf. A271220.

Programs

  • Haskell
    a271268 = 8 : cycle [88, 1664, 17144, 17112, 1214]
    -- Correction by Peter Kagey, Aug 25 2016
    
  • Mathematica
    NestList[FromDigits@ Join[IntegerDigits@ Total@ #, IntegerDigits[Times @@ #]] &@ IntegerDigits@ # &, 8, 48] (* Michael De Vlieger, Aug 26 2016 *)
    PadRight[{8},50,{1214,88,1664,17144,17112}] (* Harvey P. Dale, Oct 04 2017 *)
  • PARI
    /* first rather for illustration, second is more efficient to get a(n) */
    A271268_first(n)=vector(n,i,n=if(i>1,eval(Str(vecsum(n=digits(n)),vecprod(n))), 8))
    apply( {A271268(n)=[8, 17112, 1214, 88, 1664, 17144][n%5+(n>1)*2]}, [1..15]) \\ M. F. Hasler, Apr 01 2025
  • Python
    from functools import reduce
    from operator import mul
    def product(seq):
        return reduce(mul, seq, 1)
    def conversion(n):
        n = str(n)
        return str(sum(int(i) for i in n)) + \
               str(product(int(i) for i in n))
    def a271268(n):
        if n == 1:
            return 8
        else:
            r = 8
            while n > 1:
                r = conversion(r)
                n -= 1
            return int(r)
    
  • Python
    from math import prod  # first program for illustration - better use the second one
    def A271268_gen(n = 8): # optional parameter defines starting value
        while True: yield n; d=list(map(int,str(n))); n=int(f"{sum(d)}{prod(d)}")
    def A271268(n = None): # if no n given, generator of "infinite" sequence
        return (8, 17112, 1214, 88, 1664, 17144)[n%5+1 if n>1 else 0] if n \
            else (A271268(n)for n in range(1,1<<59)) # M. F. Hasler, Apr 01 2025
    

Extensions

Offset changed to 0 by Sean A. Irvine, Apr 12 2025
Showing 1-3 of 3 results.