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.

A349194 a(n) is the product of the sum of the first i digits of n, as i goes from 1 to the total number of digits of n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 36, 42, 48, 54, 60, 66, 72, 78, 84, 90, 49, 56, 63, 70, 77
Offset: 1

Views

Author

Malo David, Nov 10 2021

Keywords

Comments

The only primes in the sequence are 2, 3, 5 and 7. - Bernard Schott, Nov 23 2021

Examples

			For n=256, a(256) = 2*(2+5)*(2+5+6) = 182.
		

Crossrefs

Cf. A055642, A284001 (binary analog), A349190 (fixed points).
Cf. A007953 (sum of digits), A059995 (floor(n/10)).
Cf. A349278 (similar, with the last digits).

Programs

  • Magma
    f:=func; [f(n):n in [1..100]]; // Marius A. Burtea, Nov 23 2021
  • Mathematica
    Table[Product[Sum[Part[IntegerDigits[n],j],{j,i}],{i,Length[IntegerDigits[n]]}],{n,74}] (* Stefano Spezia, Nov 10 2021 *)
  • PARI
    a(n) = my(d=digits(n)); prod(i=1, #d, sum(j=1, i, d[j])); \\ Michel Marcus, Nov 10 2021
    
  • PARI
    first(n)=if(n<9,return([1..n])); my(v=vector(n)); for(i=1,9,v[i]=i); for(i=10,n, v[i]=sumdigits(i)*v[i\10]); v \\ Charles R Greathouse IV, Dec 04 2021
    
  • Python
    from math import prod
    from itertools import accumulate
    def a(n): return prod(accumulate(map(int, str(n))))
    print([a(n) for n in range(1, 100)]) # Michael S. Branicky, Nov 10 2021
    

Formula

For n>10: a(n) = a(A059995(n))*A007953(n) where A059995(n) = floor(n/10).
In particular, for n<100: a(n) = floor(n/10)*A007953(n)
From Bernard Schott, Nov 23 2021: (Start)
a(n) = 1 iff n = 10^k, k >= 0 (A011557).
a(n) = 2 iff n = 10^k + 1, k >= 0 (A000533 \ {1}).
a(n) = 3 iff n = 10^k + 2, k >= 0 (A133384).
a(n) = 5 iff n = 10^k + 4, k >= 0.
a(n) = 7 iff n = 10^k + 6, k >= 0. (End)
From Marius A. Burtea, Nov 23 2021: (Start)
a(A002275(n)) = n! = A000142(n), n >= 1.
a(A090843(n - 1)) = (2*n - 1)!! = A001147(n), n >= 1.
a(A097166(n)) = (3*n - 2)!!! = A007559(n).
a(A093136(n)) = 2^n = A000079(n).
a(A093138(n)) = 3^n = A000244(n). (End)

A349279 Fixed points of A349278.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 24, 45, 8643024
Offset: 1

Views

Author

Michel Marcus, Nov 13 2021

Keywords

Comments

This is similar to A349190 but with digits taken in reversed order.
If it exists, a(13) > 10^18. - Max Alekseyev, Jan 19 2025

Examples

			24 is a term because A349278(24) = 4*(4+2) = 4*6 = 24.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Times @@ Accumulate @ Reverse @ IntegerDigits[n]; Select[Range[100], f[#] == # &] (* Amiram Eldar, Nov 13 2021 *)
  • Python
    from math import prod
    from itertools import accumulate
    def ok(n):
      return n == (0 if n%10==0 else prod(accumulate(map(int, str(n)[::-1]))))
    print([k for k in range(1, 10**7) if ok(k)]) # Michael S. Branicky, Nov 13 2021

A349251 a(n) is the integer reached after repeated application of the map x->A349194(x) or -1 if this process does not terminate.

Original entry on oeis.org

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

Views

Author

Michel Marcus, Nov 12 2021

Keywords

Comments

Heuristics suggest that numbers n such that a(n) = -1 have density 1 and may be quite dense by 10^10. - Charles R Greathouse IV, Nov 15 2021

Examples

			For n=19, A349194(19) = 10 and A349194(10) = 1 and 1 is a fixed point of A349194 (see A349190), so a(19)=1.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Times @@ Accumulate @ IntegerDigits[n]; a[n_, itermax_] := Module[{m = FixedPoint[f, n, itermax]}, If[f[m] == m, m, 0]]; itermax = 100; Table[a[k, itermax], {k, 1, 100}] (* returns 0 if the number of iterations exceeds itermax, Amiram Eldar, Nov 12 2021 *)
  • PARI
    f(n) = my(d=digits(n)); prod(i=1, #d, sum(j=1, i, d[j])); \\ A349194
    a(n) = {my(nb=0); while (1, my(m=f(n)); nb++; if (m==n, return (m)); if (nb > 100, return (0)); n = m;);}
Showing 1-3 of 3 results.