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.
%I A344443 #21 Jun 14 2022 06:54:25 %S A344443 0,5,8,10,12,13,14,15,16,17,18,18,19,19,20,20,21,21,22,22,22,23,23,23, %T A344443 24,24,24,24,25,25,25,25,26,26,26,26,27,27,27,27,27,27,28,28,28,28,28, %U A344443 28,28,29,29,29,29,29,30,29,30,30,30,30,30,30,30,30,31,31,31,31,31,31 %N A344443 Completely additive with a(2)=5; for odd prime p, a(p) = ceiling((a(p-1) + a(p+1))/2). %C A344443 Monotonic until a(55) = 30 > 29 = a(56). %C A344443 The length of a monotonic completely additive sequence using positive integers is limited by the size of the initial terms, and this constraint is related to the conflicts inherent in specifying musical scales. In either case, the route to a good compromise solution that avoids complexity can be seen as a search for rational approximations to ratios between logarithms of the first few prime numbers. %C A344443 Here a(i)/a(j) is the intended approximation to log(i)/log(j), so by starting with a(2) = 5 we open the door to using 8/5 as an approximation to log(3)/log(2) = 1.58496... . This approximation underlies simple musical scales that divide an octave into 5, where a note of twice the frequency is 5 tones higher and a note of about 3 times the frequency is 8 tones higher. The most commonly used more complex musical scales divide an octave into 12, equivalent to starting a sequence like this with a(2) = 12 (see A344444). %H A344443 Author?, <a href="https://www.physics.brocku.ca/Courses/PEP/MusicalTemperamentsAndRatios.html">Musical Temperaments and Ratios</a>. %H A344443 Encyclopedia of Mathematics, <a href="https://encyclopediaofmath.org/wiki/Additive_arithmetic_function">Additive arithmetic function</a>. %H A344443 <a href="/wiki/Index_to_OEIS:_Section_Mu#music">Index entries for sequences related to music</a>. %F A344443 a(n*k) = a(n) + a(k). %e A344443 a(4) = a(2*2) = a(2) + a(2) from the definition of completely additive. So a(4) = 5 + 5 = 10. %e A344443 3 is an odd prime number, so a(3) = ceiling((a(3-1) + a(3+1))/2). Using the values a(2) = 5 and a(4) = 10 that we already know, we get a(3) = ceiling((5 + 10)/2) = ceiling(7.5) = 8. %e A344443 The sequence is defined as completely additive, so a(1) = 0, the identity element for addition. (To see this, note that "completely additive" implies a(2) = a(2*1) = a(2)+a(1), and solve the equation for a(1).) %t A344443 a[1] = 0; a[n_] := a[n] = Plus @@ ((Last[#] * If[First[#] == 2, 5, Ceiling[(a[First[#] - 1] + a[First[#] + 1])/2]]) & /@ FactorInteger[n]); Array[a, 100] (* _Amiram Eldar_, Jun 27 2021 *) %o A344443 (PARI) A344443(n) = if(1==n,0, my(f=factor(n)); sum(k=1,#f~,f[k,2]*if(2==f[k,1],5,ceil((1/2)*(A344443(f[k,1]-1)+A344443(f[k,1]+1)))))); \\ _Antti Karttunen_, May 19 2021 %Y A344443 Equivalent sequence with a(2)=12, a(3)=19: A344444. %Y A344443 The first 11 terms match row 11 of A352957. %Y A344443 For other completely additive sequences see the references in A104244. %Y A344443 Cf. A020857, A060528, A119256. %K A344443 nonn,easy %O A344443 1,2 %A A344443 _Peter Munn_, May 19 2021