OFFSET
1,2
COMMENTS
This sequence is described by Euler in the 1739 book "Tentamen", which provides numbers with gradus between 2 and 16 (page 41); the function is later used to calculate a measure of consonance of music intervals (e.g., see ratios on page 61). A description of Euler's function appears as a footnote in Helmholtz's "Sensations of Tone", which states that when p is prime, the degree of p is p; the degree of each other number is a product of prime numbers; and the degree of a product of two factors A and B, for which separately the numbers of degree are a and b respectively, is a + b - 1.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
David De Roure, P. Willcox, and D. M. Weigl, Numbers Into Notes: Cast Your Mind Back 200 Years, Extended Abstracts for the Late-Breaking Demo Session of the 17th International Society for Music Information Retrieval Conference, 2016.
L. Euler, Tentamen novae theoriae mvsicae ex certissimis harmoniae principiis dilvcide expositae, Petropoli, ex typographia Academiae scientiarvm, 1739, page 41.
Daniel Muzzulini, Leonhard Eulers Konsonanztheorie, Musiktheorie 1994, 2, 135-146 (in German).
H. L. F. von Helmholtz, On the sensations of tone as a physiological basis for the theory of music, 1895, chapter XII. See Footnote p. 231.
Wikipedia, Sensations of Tone.
FORMULA
If n = Product (p_j^k_j) then a(n) = 1 + Sum (k_j * (p_j - 1)).
EXAMPLE
For n = 5 the prime factors are 5 so a(5) = 1 + 4 = 5.
For n = 6 the prime factors are 2 and 3 so a(6) = 1 + (1 + 2) = 4.
MATHEMATICA
Gradus[n_] := Plus @@ (Flatten[Table[#1, {#2}] & @@@ FactorInteger[n]] - 1) + 1
PROG
(PARI) a(n) = my(f = factor(n)); sum(k=1, #f~, (f[k, 1]-1)*f[k, 2])+ 1; \\ Michel Marcus, Jul 23 2016
(Python)
from sympy import factorint
def a(n): return 1 + sum(kj*(pj-1) for pj, kj in factorint(n).items())
print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Dec 12 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
David De Roure, Jul 22 2016
STATUS
approved