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-4 of 4 results.

A062237 Numbers k which are (sum of digits of k) concatenated with (product of digits of k).

Original entry on oeis.org

0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 119, 1236, 19135, 19144, 261296, 3634992, 43139968
Offset: 1

Views

Author

Erich Friedman, Jun 30 2001

Keywords

Comments

For a d-digit number with d >= 88, the sum and product of the digits together have fewer than d digits. So every element of this sequence has 87 or fewer digits, hence it is finite. - David W. Wilson, Apr 28 2005
Fixed points of the map A380873: concatenate sum and product of digits. - M. F. Hasler, Apr 01 2025

Examples

			1236 has sum of digits 12 and product of digits 36.
		

Crossrefs

Cf. A007953 (sum of digs), A007954 (product of digs), A038364, A038369, A066282, A380873, A380872 (trajectories under map).

Programs

  • Mathematica
    sdpdQ[n_]:=Module[{idn=IntegerDigits[n],s,p},s=Total[idn];p=Times@@idn;n==FromDigits[Join[IntegerDigits[s],IntegerDigits[p]]]]; Select[Range[44*10^6],sdpdQ] (* Harvey P. Dale, Nov 23 2024 *)
  • Python
    from math import prod
    from sympy.utilities.iterables import multiset_permutations as mp
    from itertools import count, islice, combinations_with_replacement as mc
    def c(s):
        d = list(map(int, s))
        return sorted(s) == sorted(str(sum(d)) + str(prod(d)))
    def ok(s):
        d = list(map(int, s))
        return s[0] != '0' and "".join(s) == str(sum(d)) + str(prod(d))
    def nd(d): yield from ("".join(m) for m in mc("0123456789", d))
    def b(): yield from (s for d in count(1) for s in nd(d) if c(s))
    def a(): yield from (int("".join(p)) for s in b() for p in mp(s) if ok(p))
    print(list(islice(a(), 16))) # Michael S. Branicky, Jun 30 2022

Extensions

More terms from Harvey P. Dale, Jul 04 2001
More terms from David W. Wilson, Apr 28 2005; he reports on May 03 2005 that there are no further terms.
Offset corrected by Altug Alkan, Apr 10 2018

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))))

A271220 Concatenate sum of digits of previous term and product of digits of previous term, starting with 6.

Original entry on oeis.org

6, 66, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236
Offset: 0

Views

Author

Sander Claassen, Apr 02 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 6, the second number is 66. The third number is generated as follows: 6+6 = 12, 6*6 = 36, which gives 1236. After that, the numbers remain unchanged, because 1+2+3+6 = 12 and 1x2x3x6 = 36, so combined 1236 again.
For more information, see A380873 (the iterated function), A380872 (all trajectories), A062237 (fixed points). - M. F. Hasler, Apr 02 2025

Crossrefs

Cf. A380873 (the iterated function), A007953 (sum of digits), A007954 (product of digits), A380872 (all trajectories), A062237 (fixed points).

Programs

  • Mathematica
    NestList[FromDigits[Flatten@ {IntegerDigits@ Total@ #, IntegerDigits@ If[Length@ # == 1, #, Times @@ #]}] &@ IntegerDigits@ # &, 6, 50] (* Michael De Vlieger, Apr 02 2016 *)
  • PARI
    A380872_row(6) \\ M. F. Hasler, Apr 02 2025

Formula

a(n) = 1236 for all n > 2. - M. F. Hasler, Apr 02 2025

Extensions

Offset changed to 0 by M. F. Hasler, Apr 02 2025

A380871 Limit of the trajectory of n under A380873: concatenate sum and product of digits, if it ends on a fixed point, otherwise the least element of the limit cycle.

Original entry on oeis.org

0, 50, 70, 70, 70, 80, 1236, 40, 88, 10, 10, 50, 50, 60, 20, 50, 70, 50, 70, 10, 20, 50, 70, 50, 70, 80, 70, 10, 80, 90, 30, 60, 50, 70, 60, 90, 90, 40, 88, 90, 40, 20, 70, 60, 70, 20, 70, 40, 70, 10, 50, 50, 80, 90, 20, 80, 50, 50, 80, 40, 60, 70, 70, 90, 70, 50, 1236, 70, 70, 70, 70, 50, 10
Offset: 0

Views

Author

M. F. Hasler, Apr 02 2025

Keywords

Comments

The fixed points of A380873 are listed in A062237, except for 0.
The first two limit cycles that occur are both of length 5:
* C(88) = (88, 1664, 17144, 17112, 1214), reached for n = 8, 38, 83, 88, ... and
* C(18168) = (18168, 24384, 21768, 24672, 21672), reached for n = 188, 233, ...

Examples

			The trajectory of n = 1 under A380873 is: 1 -> concat(1, 1) = 11 -> concat(1+1, 1*1) = 21 -> concat(2+1, 2*1) = 32 -> concat(3+2, 3*2) = 56 -> concat(3+2, 3*2) = 1130 -> concat(1+1+3+0, 1*1*3*0) = 50 -> concat(5+0, 5*0) = 50, so a fixed point is reached, and a(1) = 50.
The trajectory of n = 8 under A380873 is: 8 -> concat(8, 8) = 88 -> concat(8+8, 8*8) = 1664 -> concat(1+6+6+4, 1*6*6*4) = 17144 -> concat(1+7+1+4+4, 1*7*1*4*4) = 17112 -> concat(1+7+1+1+2, 1*7*1*1*2) = 1214 -> concat(1+2+1+4, 1*2*1*4) = 88 -> 1664 etc.: here the limit 5-cycle C(88) = (88, 1664, 17144, 17112, 1214) is reached, so a(8) = min(C(88)) = 88.
		

Crossrefs

Cf. A380873 (iterated function), A007953 (sum of digits), A007954 (product of digits), A062237 (nonzero fixed points of A380873), A380872 (trajectories under A380873).

Programs

  • PARI
    apply( {A380871(n)=for(i=0,1,my(S=[n]); while(!setsearch(S, n=A380873(n)), S=setunion(S,[n])); i&& n=S[1]);n}, [0..90])
Showing 1-4 of 4 results.