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.

A095402 Sum of digits of all distinct prime factors of n.

This page as a plain text file.
%I A095402 #10 Dec 12 2023 17:58:26
%S A095402 0,2,3,2,5,5,7,2,3,7,2,5,4,9,8,2,8,5,10,7,10,4,5,5,5,6,3,9,11,10,4,2,
%T A095402 5,10,12,5,10,12,7,7,5,12,7,4,8,7,11,5,7,7,11,6,8,5,7,9,13,13,14,10,7,
%U A095402 6,10,2,9,7,13,10,8,14,8,5,10,12,8,12,9,9,16,7,3,7,11,12,13,9,14,4,17,10
%N A095402 Sum of digits of all distinct prime factors of n.
%H A095402 Michael S. Branicky, <a href="/A095402/b095402.txt">Table of n, a(n) for n = 1..10000</a>
%e A095402 n = 1000: prime set = {2, 5}, a[1000] = 7;
%e A095402 n = 255255: prime set={3, 5, 7, 11, 13, 17}, a[255255]= 3+5+7+2+4+8 = 29.
%t A095402 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]] Table[sdp[w], {w, 1, 150}]
%t A095402 Table[Total[Flatten[IntegerDigits[First/@FactorInteger[n]]]],{n,1,100}] (Zak Seidov)
%o A095402 (Python)
%o A095402 from sympy import factorint
%o A095402 def a(n): return sum(sum(map(int, str(p))) for p in factorint(n))
%o A095402 print([a(n) for n in range(1, 91)]) # _Michael S. Branicky_, Dec 12 2023
%Y A095402 Cf. A007953, A051351, A141346.
%K A095402 nonn,base
%O A095402 1,2
%A A095402 _Labos Elemer_, Jun 21 2004