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-10 of 12 results. Next

A118503 Sum of digits of prime factors of n, with multiplicity.

Original entry on oeis.org

0, 2, 3, 4, 5, 5, 7, 6, 6, 7, 2, 7, 4, 9, 8, 8, 8, 8, 10, 9, 10, 4, 5, 9, 10, 6, 9, 11, 11, 10, 4, 10, 5, 10, 12, 10, 10, 12, 7, 11, 5, 12, 7, 6, 11, 7, 11, 11, 14, 12, 11, 8, 8, 11, 7, 13, 13, 13, 14, 12, 7, 6, 13, 12, 9, 7, 13, 12, 8, 14, 8, 12, 10, 12, 13, 14, 9, 9, 16, 13
Offset: 1

Views

Author

Jonathan Vos Post, May 06 2006

Keywords

Comments

This is to A095402 (Sum of digits of all distinct prime factors of n) as bigomega = A001222 is to omega = A001221. See also: A007953 Digital sum (i.e., sum of digits) of n.

Examples

			a(22) = 4 because 22 = 2 * 11 and the digital sum of 2 + the digital sum of 11 = 2 + 2 = 4.
a(121) = 4 because 121 = 11^2 = 11 * 11, summing the digits of the prime factors with multiplicity gives A007953(11) + A007953(11) = 2 + 2 = 4.
a(1000) = 21 because = 2^3 * 5^3 = 2 * 2 * 2 * 5 * 5 * 5 and 2 + 2 + 2 + 5 + 5 + 5 = 21, as opposed to A095402(1000) = 7.
		

Crossrefs

Cf. A001221, A001222, A007953, A095402, A102217, A289142 (positions of multiples of 3's).

Programs

  • Maple
    A118503 := proc(n) local a; a := 0 ; for p in ifactors(n)[2] do a := a+ op(2, p)*A007953(op(1, p)) ; end do: a ; end proc: # R. J. Mathar, Sep 14 2011
  • Mathematica
    sdpf[n_]:=Total[Flatten[IntegerDigits/@Flatten[Table[#[[1]],{#[[2]]}]&/@FactorInteger[n]]]]; Join[{0},Array[sdpf,100,2]] (* Harvey P. Dale, Sep 19 2013 *)
  • PARI
    A118503(n) = { my(f=factor(n)); sum(i=1, #f~, f[i, 2]*sumdigits(f[i, 1])); }; \\ Antti Karttunen, Jun 08 2024

Formula

a(n) = Sum_{i=1..k} (e_i)*A007953(p_i) where prime decomposition of n = (p_1)^(e_1) * (p_2)^(e_2) * ... * (p_k)^(e_k).

Extensions

a(0) removed by Joerg Arndt at the suggestion of Antti Karttunen, Jun 08 2024

A095418 Excess of sum of all decimal digits of distinct prime factors for n-th repunit over corresponding digit-sum for repunit itself (which is n).

Original entry on oeis.org

-1, 0, 10, 0, 10, 20, 30, 17, 32, 26, 34, 35, 49, 53, 42, 51, 43, 74, 0, 56, 95, 77, 0, 81, 38, 94, 97, 106, 104, 80, 109, 123, 108, 96, 97, 132, 100, 65, 145, 136, 141, 184, 145, 173, 123, 99, 139, 172, 196, 120, 170, 176, 179, 213, 161, 169, 122, 201, 217, 184, 211, 216
Offset: 1

Views

Author

Labos Elemer, Jun 22 2004

Keywords

Examples

			n=60: concatenated distinct-prime factor-set for 60th-repunit is:
371113313741611012112412712161354190919901279612906161418890139526741,
its digit sum is 244, so a(60) = 244 - 60 = 184.
The value of this excess-sum is zero if n=2,4,19,23.
		

Crossrefs

Programs

  • Mathematica
    a[1] = -1; a[n_] := Total@ Flatten[IntegerDigits /@ First /@ FactorInteger[(10^n - 1)/9]] - n; Array[a, 62] (* Giovanni Resta, Jul 19 2018 *)

Formula

a(n) = A095402(A002275(n)) - n = A095417(n) - n.

Extensions

Data corrected by Giovanni Resta, Jul 19 2018

A095417 Sum of all decimal digits of distinct prime factors for n-th repunit.

Original entry on oeis.org

0, 2, 13, 4, 15, 26, 37, 25, 41, 36, 45, 47, 62, 67, 57, 67, 60, 92, 19, 76, 116, 99, 23, 105, 63, 120, 124, 134, 133, 110, 140, 155, 141, 130, 132, 168, 137, 103, 184, 176, 182, 226, 188, 217, 168, 145, 186, 220, 245, 170, 221, 228, 232, 267, 216, 225, 179, 259
Offset: 1

Views

Author

Labos Elemer, Jun 22 2004

Keywords

Examples

			n=60: concatenated distinct-prime factor-set for 60th-repunit is:
371113313741611012112412712161354190919901279612906161418890139526741,
its digit sum=a(60)=244.
		

Crossrefs

Programs

  • Mathematica
    a[1]=0; a[n_] := Total[ Flatten[ IntegerDigits /@ First /@ FactorInteger[(10^n - 1)/9]]]; Array[a, 60] (* Giovanni Resta, Jul 19 2018 *)

Formula

a(n) = A095402(A002275(n)).

Extensions

Data corrected by Giovanni Resta, Jul 19 2018

A095403 Sum of digits of n minus the sum of digits of all distinct prime factors of n.

Original entry on oeis.org

1, 0, 0, 2, 0, 1, 0, 6, 6, -6, 0, -2, 0, -4, -2, 5, 0, 4, 0, -5, -7, 0, 0, 1, 2, 2, 6, 1, 0, -7, 0, 3, 1, -3, -4, 4, 0, -1, 5, -3, 0, -6, 0, 4, 1, 3, 0, 7, 6, -2, -5, 1, 0, 4, 3, 2, -1, 0, 0, -4, 0, 2, -1, 8, 2, 5, 0, 4, 7, -7, 0, 4, 0, -1, 4, 1, 5, 6, 0, 1, 6, 3, 0, 0, 0, 5, 1, 12, 0, -1, -1, 4, 5, 0, -1, 10, 0, 8, 13, -6, 0, -10, 0, -1, -9, -3, 0, 4, 0, -7, -10
Offset: 1

Views

Author

Labos Elemer, Jun 21 2004

Keywords

Examples

			n=1000: A007953[1000]=1, prime set={2,5}, A095402[1000]=7, a[1000]=1-7=-6
		

Crossrefs

Programs

  • Mathematica
    ffi[x_] :=Flatten[FactorInteger[x]] lf[x_] :=Length[FactorInteger[x]] ba[x_] :=Table[Part[ffi[x], 2*j-1], {j, 1, lf[x]}] sd[x_] :=Apply[Plus, IntegerDigits[x]] tdp[x_] :=Flatten[Table[IntegerDigits[Part[ba[x], j]], {j, 1, lf[x]}], 1] sdp[x_] :=Apply[Plus, tdp[x]] a=Table[sd[w], {w, 1, 150}];b=Table[sdp[w], {w, 1, 150}];b-a

Formula

a[n]=A007953[n]-A095402[n]

A095405 Numbers n such that Sum-of-digits-of-n = Sum-of-digits-of-all-distinct-prime-factors-of-n.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 22, 23, 29, 31, 37, 41, 43, 47, 53, 58, 59, 61, 67, 71, 73, 79, 83, 84, 85, 89, 94, 97, 101, 103, 107, 109, 113, 127, 131, 136, 137, 139, 149, 151, 157, 160, 163, 166, 167, 173, 179, 181, 191, 193, 197, 199, 202, 211, 223, 227, 229, 233, 234
Offset: 1

Views

Author

Labos Elemer, Jun 21 2004

Keywords

Examples

			n=85: digit sum=13, prime factor-digit sum=5+1+7=13, so 85 is here.
		

Crossrefs

Programs

  • Mathematica
    ffi[x_] :=Flatten[FactorInteger[x]] lf[x_] :=Length[FactorInteger[x]] ba[x_] :=Table[Part[ffi[x], 2*j-1], {j, 1, lf[x]}] sd[x_] :=Apply[Plus, IntegerDigits[x]] tdp[x_] :=Flatten[Table[IntegerDigits[Part[ba[x], j]], {j, 1, lf[x]}], 1] sdp[x_] :=Apply[Plus, tdp[x]] a=Table[sd[w], {w, 1, 256}];b=Table[sdp[w], {w, 1, 150}];b-a; Flatten[Position[Sign[b-a], 0]]
    Select[Range[2,300],Total[Flatten[IntegerDigits/@FactorInteger[#][[All, 1]]]] == Total[IntegerDigits[#]]&] (* Harvey P. Dale, Sep 29 2019 *)

Formula

Solutions to A007953[x]=A095402[x].

A141346 Sum of the distinct digits of the prime factors of n.

Original entry on oeis.org

0, 2, 3, 2, 5, 5, 7, 2, 3, 7, 1, 5, 4, 9, 8, 2, 8, 5, 10, 7, 10, 3, 5, 5, 5, 6, 3, 9, 11, 10, 4, 2, 4, 10, 12, 5, 10, 12, 4, 7, 5, 12, 7, 3, 8, 5, 11, 5, 7, 7, 11, 6, 8, 5, 6, 9, 13, 11, 14, 10, 7, 6, 10, 2, 9, 6, 13, 10, 5, 14, 8, 5, 10, 12, 8, 12, 8, 6, 16, 7, 3, 7, 11, 12, 13, 9, 14, 3, 17, 10
Offset: 1

Views

Author

Rick L. Shepherd, Jun 26 2008

Keywords

Comments

Motivated by seeking an explanation for A080592. For n >= 2, 1 <= a(n) <= 45. For n >= 1, a(n) <= A095402(n).

Examples

			a(44) = 3 as 44 = 2^2 * 11 and the sum of the distinct digits of the prime factors is 1 + 2 (whereas A095402(44) = 4 = 1 + 1 + 2).
		

Crossrefs

Programs

  • Mathematica
    Join[{0},Rest[Total[Union[Flatten[IntegerDigits/@Transpose[ FactorInteger[ #]][[1]]]]]&/@Range[90]]] (* Harvey P. Dale, Nov 30 2011 *)
  • Python
    from sympy import factorint
    def a(n):
        s = set()
        for p in factorint(n): s |= set(str(p))
        return sum(map(int, s))
    print([a(n) for n in range(1, 91)]) # Michael S. Branicky, Dec 12 2023

A095404 Numbers n such that Sum-of-digits-of-n > Sum-of-digits-of-all-distinct-prime-factors-of-n.

Original entry on oeis.org

1, 4, 6, 8, 9, 16, 18, 24, 25, 26, 27, 28, 32, 33, 36, 39, 44, 45, 46, 48, 49, 52, 54, 55, 56, 62, 64, 65, 66, 68, 69, 72, 75, 76, 77, 78, 80, 81, 82, 86, 87, 88, 92, 93, 96, 98, 99, 108, 117, 121, 124, 125, 128, 129, 135, 138, 143, 144, 147, 148, 155, 156, 159, 162, 164
Offset: 1

Views

Author

Labos Elemer, Jun 21 2004

Keywords

Examples

			n=24: digit sum=6, prime factor-digit sum=2+3=5, so 24 is here;
n=153: digit sum=9, prime factor-digit sum=3+5+3=11>9, so 153 is here.
		

Crossrefs

Programs

  • Mathematica
    ffi[x_] :=Flatten[FactorInteger[x]] lf[x_] :=Length[FactorInteger[x]] ba[x_] :=Table[Part[ffi[x], 2*j-1], {j, 1, lf[x]}] sd[x_] :=Apply[Plus, IntegerDigits[x]] tdp[x_] :=Flatten[Table[IntegerDigits[Part[ba[x], j]], {j, 1, lf[x]}], 1] sdp[x_] :=Apply[Plus, tdp[x]] a=Table[sd[w], {w, 1, 256}];b=Table[sdp[w], {w, 1, 150}];b-a; Flatten[Position[Sign[b-a], 1]]

Formula

Solutions to A007953[x]>A095402[x].

A095406 Numbers n such that Sum-of-digits-of-n < Sum-of-digits-of-all-distinct-prime-factors-of-n.

Original entry on oeis.org

10, 12, 14, 15, 20, 21, 30, 34, 35, 38, 40, 42, 50, 51, 57, 60, 63, 70, 74, 90, 91, 95, 100, 102, 104, 105, 106, 110, 111, 112, 114, 115, 116, 118, 119, 120, 122, 123, 126, 130, 132, 133, 134, 140, 141, 142, 145, 146, 150, 152, 153, 154, 158, 161, 170, 171, 174
Offset: 1

Views

Author

Labos Elemer, Jun 21 2004

Keywords

Examples

			n=38: digit sum=11, prime factor-digit sum=2+1+9=12>11, so 38 is here;
n=10^j:digit sum=1, prime factor-digit sum=2+5=7?1. so 10^j is here for all j [this implies that the sequence is infinite].
		

Crossrefs

Programs

  • Mathematica
    ffi[x_] :=Flatten[FactorInteger[x]] lf[x_] :=Length[FactorInteger[x]] ba[x_] :=Table[Part[ffi[x], 2*j-1], {j, 1, lf[x]}] sd[x_] :=Apply[Plus, IntegerDigits[x]] tdp[x_] :=Flatten[Table[IntegerDigits[Part[ba[x], j]], {j, 1, lf[x]}], 1] sdp[x_] :=Apply[Plus, tdp[x]] a=Table[sd[w], {w, 1, 256}];b=Table[sdp[w], {w, 1, 150}];b-a; Flatten[Position[Sign[b-a], -1]]
    Select[Range[200],Total[IntegerDigits[#]]Harvey P. Dale, May 06 2012 *)

Formula

Solutions to A007953[x] < A095402[x].

A176707 Sum of digits of all distinct prime factors of n-th semiprime.

Original entry on oeis.org

2, 5, 3, 7, 9, 8, 10, 4, 5, 6, 5, 10, 12, 12, 7, 7, 7, 11, 7, 13, 13, 6, 9, 8, 12, 9, 7, 13, 9, 14, 11, 7, 13, 15, 10, 13, 10, 16, 15, 2, 9, 8, 10, 17, 15, 14, 10, 6, 16, 12, 9, 18, 11, 12, 13, 4, 17, 19, 10, 15, 10, 18, 16, 4, 18, 10, 6, 12, 11, 10, 12, 11, 12, 13, 12, 7, 16, 19, 14, 14, 7
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Apr 24 2010

Keywords

Examples

			a(1)=2 because 1st semiprime=2*2 and 2=2; a(2)=5 because 2nd semiprime=2*3 and 2<3.
		

Crossrefs

Cf. A095402.

Programs

  • Maple
    A007953 := proc(n) add(d,d=convert(n,base,10)) ; end proc:
    A176707 := proc(n) s := A001358(n) ; add( A007953(p), p = numtheory[factorset](s) ) ; end proc: seq(A176707(n),n=1..120) ; # R. J. Mathar, Apr 25 2010
  • Python
    from sympy import factorint
    def aupton(terms):
      alst, m = [], 4
      while len(alst) < terms:
        f = factorint(m)
        if sum(f.values()) == 2: # semiprime
          alst.append(sum(sum(map(int, str(p))) for p in f.keys()))
        m += 1
      return alst
    print(aupton(81)) # Michael S. Branicky, Feb 05 2021

Extensions

a(13), a(34) etc. corrected by - R. J. Mathar, Apr 25 2010

A118541 Product of digits of prime factors of n, with multiplicity.

Original entry on oeis.org

1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 12, 3, 14, 15, 16, 7, 18, 9, 20, 21, 2, 6, 24, 25, 6, 27, 28, 18, 30, 3, 32, 3, 14, 35, 36, 21, 18, 9, 40, 4, 42, 12, 4, 45, 12, 28, 48, 49, 50, 21, 12, 15, 54, 5, 56, 27, 36, 45, 60, 6, 6, 63, 64, 15, 6, 42, 28, 18, 70, 7, 72, 21, 42, 75, 36, 7, 18
Offset: 0

Views

Author

Jonathan Vos Post, May 06 2006

Keywords

Comments

See also: A007954 Product of digits of n. See also: A118503 Sum of digits of prime factors of n, with multiplicity.

Examples

			a(22) = 2 because 22 = 2 * 11 and the digital product of 2 * the digital product of 11 = 2 * ! * 1 = 2.
a(121) = 1 because 121 = 11^2 = 11 * 11, multiplying the digits of the prime factors with multiplicity gives A007954(11) +A007954(11) = 1 * 1 = 1.
		

Crossrefs

Programs

  • Mathematica
    Table[Times @@ Flatten@ Map[IntegerDigits, Table[#1, {#2}] & @@@ FactorInteger@ n], {n, 0, 78}] (* Michael De Vlieger, Jun 16 2016 *)
  • PARI
    \\ here b(n) is A007954.
    b(n)={my(v=digits(n)); prod(i=1, #v, v[i])}
    a(n)={my(f=factor(n)); prod(i=1, #f~, my(p=f[i,1], e=f[i,2]); b(p)^e)} \\ Andrew Howroyd, Jul 23 2018

Formula

Completely multiplicative with a(p) = A007954(p) for prime p.

Extensions

a(36) corrected by Giovanni Resta, Jun 16 2016
Keyword:mult added by Andrew Howroyd, Jul 23 2018
Showing 1-10 of 12 results. Next