OFFSET
0,3
COMMENTS
On the graph it seems that there are lines where the density of points is higher than elsewhere. These lines correspond to those which are easily observable on A001414. Up to n=100000 there are 13413 prime numbers in this sequence while at A001414 there are 21877; surely the primes are distributed differently in these sequences.
Regarding the MATLAB code: factor(0)=sum(factor(0))=0 and factor(1)=sum(factor(1))=1, this can be very misleading, attention needed during using sum(factor(n)) as sopfr(n).
LINKS
Bence Bernáth, Table of n, a(n) for n = 0..10000
Bence Bernáth, Table of n, a(n) for n = 0..200000
Michael De Vlieger, First 65 terms drawn as a spiral, akin to the Harriss drawing at A005132.
Michael De Vlieger, video of first 128 steps of this sequence, with audio accompaniment generated by aspects of the sequence. Nov 19, 2019.
EXAMPLE
a(3)=6, factor(6)=[2 3], sum of factor(6) is 5. Then n=4, sum of factor(4) is 2+2=4. 5-4 = 1 but 1 is already in the sequence so a(4)=5+4=9.
MATHEMATICA
Block[{f}, f[n_] := Total@ Flatten[ConstantArray[#1, #2] & @@@ FactorInteger[n]]; Nest[Append[#1, If[And[#3 >= 0, FreeQ[#1, #3]], #3, f@ #1[[-1]] + f@ #2]] & @@ {#1, #2, f@ #1[[-1]] - f@#2} & @@ {#, Length@ #} &, {0}, 69] ] (* Michael De Vlieger, Nov 19 2019 *)
PROG
(MATLAB)
length_seq=100000;
sequence(1)=0; %sum(factor(0))=0
sequence(2)=1; %sum(factor(1))=1
for i1=2:1:length_seq
if (sum(factor(sequence(i1)))-sum(factor((i1))))>0 && (ismember((sum(factor(sequence(i1)))-sum(factor((i1)))), sequence)==0)
sequence(i1+1)=(sum(factor(sequence(i1)))-sum(factor((i1))));
else
sequence(i1+1)=(sum(factor(sequence(i1)))+sum(factor((i1))));
end
end
result=transpose(sequence);
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Bence Bernáth, Nov 17 2019
STATUS
approved