login
A344443
Completely additive with a(2)=5; for odd prime p, a(p) = ceiling((a(p-1) + a(p+1))/2).
3
0, 5, 8, 10, 12, 13, 14, 15, 16, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 30, 29, 30, 30, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31
OFFSET
1,2
COMMENTS
Monotonic until a(55) = 30 > 29 = a(56).
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.
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).
FORMULA
a(n*k) = a(n) + a(k).
EXAMPLE
a(4) = a(2*2) = a(2) + a(2) from the definition of completely additive. So a(4) = 5 + 5 = 10.
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.
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).)
MATHEMATICA
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 *)
PROG
(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
CROSSREFS
Equivalent sequence with a(2)=12, a(3)=19: A344444.
The first 11 terms match row 11 of A352957.
For other completely additive sequences see the references in A104244.
Sequence in context: A194425 A314376 A205841 * A332556 A049195 A172019
KEYWORD
nonn,easy
AUTHOR
Peter Munn, May 19 2021
STATUS
approved