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: Malo David

Malo David's wiki page.

Malo David has authored 4 sequences.

A353907 Numbers k such that k equals {alternating sum of digits of k} raised to the power of {number of digits of k}.

Original entry on oeis.org

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

Author

Malo David, May 10 2022

Comments

These are the only terms of this sequence.

Examples

			31381059609 = (9-0+6-9+5-0+1-8+3-1+3)^11.
		

Crossrefs

Fixed points of A353906.
Cf. A055017 (alternating sum starting from the last digit of n).
Cf. A055642 (number of digits of n).

Programs

  • Python
    def A(n):
       counter = 0
       S = 0
       q = n
       while q:
          q, c = q//10, q % 10
          S += (-1)** counter * c
          counter += 1
       return S ** counter
    def fixed_points_of_A():
       for i in range(1,100):
          m = int(10 ** (1 - 1/ i)) +1
          for k in range(m, 10):
             n = k**i
             e = A(n)
             if n ==e: print(n, k, i) #prints n, the value of the alternating sum, and of the power to which is raised this number.

A353906 a(n) is the {alternating sum of the digits of n} raised to the power {number of digits of n}.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 0, 1, 4, 9, 16, 25, 36, 49, 64, 4, 1, 0, 1, 4, 9, 16, 25, 36, 49, 9, 4, 1, 0, 1, 4, 9, 16, 25, 36, 16, 9, 4, 1, 0, 1, 4, 9, 16, 25, 25, 16, 9, 4, 1, 0, 1, 4, 9, 16, 36, 25, 16, 9, 4, 1, 0, 1, 4, 9, 49, 36, 25, 16, 9, 4, 1, 0, 1, 4, 64, 49, 36, 25, 16, 9
Offset: 1

Author

Malo David, May 10 2022

Keywords

Comments

The first negative term is a(120) = -1.
Note that it does not matter whether the alternating sum starts from the first or from the last digit of n. - Jianing Song, Jun 12 2022

Examples

			For n=489, a(489) = (9-8+4)^3 = 125.
		

Crossrefs

Cf. A055017 (alternating digit sum), A055642 (number of digits).
Cf. A353907 (fixed points).
Cf. A113009 (normal sum instead of alternating).

Programs

  • Mathematica
    a[n_] := Total[-(-1)^Range[m = Length[d = IntegerDigits[n]]] * d]^m; Array[a, 100] (* Amiram Eldar, May 11 2022 *)
  • PARI
    a(n) = my(d=digits(n)); sum(k=1, #d, (-1)^(k+1)*d[k])^#d; \\ Michel Marcus, May 10 2022
  • Python
    def a(n):
       counter = 0
       S = 0
       q = n
       while q:
          q, c = q//10, q % 10
          S += (-1)** counter * c
          counter += 1
       return S ** counter
    
  • Python
    def A353906(n): return sum((-1 if i % 2 else 1)*int(j) for i, j in enumerate(str(n)[::-1]))**len(str(n)) # Chai Wah Wu, May 11 2022
    

Formula

a(n) = A055017(n)^A055642(n).

A349190 Numbers k such that k equals the product of the sum of its first i digits, with i going from 1 to the total number of digits of k.

Original entry on oeis.org

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

Author

Malo David, Nov 09 2021

Keywords

Comments

a(12) > 10^22 if it exists. - Max Alekseyev, Jan 19 2025

Examples

			24192 is a term since 24192 = 2*(2+4)*(2+4+1)*(2+4+1+9)*(2+4+1+9+2).
		

Crossrefs

Programs

  • Mathematica
    Select[Range[10^5],Times@@Total/@Table[IntegerDigits[#][[;;k]],{k,IntegerLength@#}]==#&] (* Giorgos Kalogeropoulos, Nov 10 2021 *)
  • PARI
    isok(k) = {my(d=digits(k)); prod(i=1, #d, sum(j=1, i, d[j])) == k;} \\ Michel Marcus, Nov 10 2021
    
  • Python
    def main(N): # prints all terms <= N
      for k in range(1,N+1):
        n1=str(k)
        n2 = 1
        for i in range(1,len(n1)+1):
          sum1 = 0
          for j in range(0,i):
            sum1 += int(n1[j])
          n2 = n2*sum1
        if n2 == k:
           print(k, end=", ")
    
  • Python
    from itertools import islice, accumulate, count
    from math import prod
    def A349190gen(): return filter(lambda n:prod(accumulate(int(d) for d in str(n))) == n,count(1)) # generator of terms
    A349190_list = list(islice(A349190gen(),11)) # Chai Wah Wu, Dec 02 2021

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

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)