A054540 A list of equal temperaments (equal divisions of the octave) whose nearest scale steps are closer and closer approximations to the six simple ratios of musical harmony: 6/5, 5/4, 4/3, 3/2, 8/5 and 5/3.
1, 2, 3, 5, 7, 12, 19, 31, 34, 53, 118, 171, 289, 323, 441, 612, 730, 1171, 1783, 2513, 4296, 12276, 16572, 20868, 25164, 46032, 48545, 52841, 73709, 78005, 151714, 229719, 537443, 714321, 792326, 944040, 1022045, 1251764, 3755292, 3985011
Offset: 0
Keywords
A004978 a(n) = least integer m > a(n-1) such that m - a(n-1) != a(j) - a(k) for all j, k less than n; a(1) = 1, a(2) = 2.
1, 2, 4, 8, 13, 21, 31, 45, 60, 76, 97, 119, 144, 170, 198, 231, 265, 300, 336, 374, 414, 456, 502, 550, 599, 649, 702, 759, 819, 881, 945, 1010, 1080, 1157, 1237, 1318, 1401, 1486, 1572, 1662, 1753, 1845, 1945, 2049, 2156, 2264, 2380, 2499, 2623, 2750, 2882
Offset: 1
Comments
Equivalently, if S(n) = { a(j) - a(k); n > j > k > 0 }, then a(n) = a(n-1) + M where M = min( {1, 2, 3, ...} \ S(n) ) is the smallest positive integer not in S(n). - M. F. Hasler, Jun 26 2019
Examples
From _M. F. Hasler_, Jun 26 2019: (Start) After a(1) = 1, a(2) = 2, we have a(3) = least m > a(2) such that m - a(2) = m - 2 is not in { a(j) - a(k); 1 <= k < j < 3 } = { a(2) - a(1) } = { 1 }. Thus we must have m - 2 = 2, whence m = 4. The next term a(4) is the least m > a(3) such that m - a(3) = m - 4 is not in { a(j) - a(k); 1 <= k < j < 4 } = { 1, 4 - 2 = 2, 4 - 1 = 3 }, i.e., m = 4 + 4 = 8. The next term a(5) is the least m > a(4) such that m - a(4) = m - 8 is not in { a(j) - a(k); 1 <= k < j < 5 } = { 1, 2, 3, 8 - 4 = 4, 8 - 2 = 6, 8 - 1 = 7 }, i.e., m = 5 + 8 = 13. (End)
References
- N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
Links
- Chai Wah Wu, Table of n, a(n) for n = 1..10000 (terms 1..2000 from Nathaniel Johnston)
- G. E. Andrews, MacMahon's prime numbers of measurement, Amer. Math. Monthly, 82 (1975), 922-923.
Crossrefs
Programs
-
MATLAB
s=1:2000^2;d(1)=1;A004978(1)=1;A004978(2)=2; for n=3:2000 A004978(n)=A004978(n-1)+find([d,0]~=s(1:max(size(d))+1),1); d(end+1:end+n-1)=A004978(n)-A004978(1:n-1); d=sort(unique(d)); end % Nathaniel Johnston, Feb 09 2011
-
PARI
A004978_vec(N,a=[1..N],S=[1])={for(n=3,N,a[n]=a[n-1]+S[1]+1;S=setunion(S,select(t->t>S[1],vector(n-1,k,a[n]-a[n-k])));for(k=1,#S-1, if(S[k+1]-S[k]>1, S=S[k..-1];next(2)));S[#S]==#S&&S=[#S]);a} \\ M. F. Hasler, Jun 26 2019
-
Python
from itertools import count, accumulate, islice from collections import deque def A004978_gen(): # generator of terms aset, alist, c = set(), deque(), 1 for k in count(1): if k in aset: aset.remove(k) else: yield c aset |= set(k+d for d in accumulate(alist)) alist.appendleft(k) c += k A004978_list = list(islice(A004978_gen(),20)) # Chai Wah Wu, Sep 01 2025
Extensions
Definition corrected by Bryan S. Robinson, Mar 16 2006
Name edited by M. F. Hasler, Jun 26 2019
A247556 Exact differential base (a B_2 sequence) constructed as follows: Start with a(0)=0. For n>=1, let S be the set of all differences a(j)-a(i) for 0 <= i < j <= n-1, and let d be the smallest positive integer not in S. If, for every i in 1..n-1, a(n-1) + d - a(i) is not in S, then a(n) = a(n-1) + d. Otherwise, let r be the smallest positive integer such that, for every i in 1..n-1, neither a(n-1) + r - a(i) nor a(n-1) + r + d - a(i) is in S; then a(n) = a(n-1) + r and a(n+1) = a(n) + d.
0, 1, 3, 7, 12, 20, 30, 44, 65, 80, 96, 143, 165, 199, 224, 306, 332, 415, 443, 591, 624, 678, 716, 934, 973, 1134, 1174, 1449, 1491, 1674, 1720, 2113, 2161, 2468, 2517, 2855, 2906, 2961, 3245, 3302, 3711, 3772, 4081, 4148, 4603, 4673, 5557, 5628, 5917, 5989
Offset: 0
Comments
Every positive integer is uniquely represented as a difference of two distinct elements of the base set. This is a B_2 sequence.
By the definition of this sequence, with d as the smallest unused difference among terms a(0)..a(n-1), we assign a(n) = a(n-1) + d, provided that this would not cause any difference to be repeated; otherwise, we assign a(n) = a(n-1) + r and a(n+1) = a(n) + d, where r is the smallest integer that allows this assignment of a(n) and a(n+1) without causing any difference to be repeated. Thus, at each step, the smallest unused difference d is either used immediately (as a(n) - a(n-1)) or delayed by one step (and used as a(n+1) - a(n)). In this way, the sequence includes every positive integer as a difference (unlike the Mian-Chowla sequence A005282, which omits differences 33, 88, 98, 99, ...; see A080200).
The set is an optimization of Browkin's base, where r = a(n-1) + 1.
The series Sum_{n>=0} 1/(a(n+1) - a(n)) is divergent.
Conjecture: lim inf_{n->oo} (a(n+1) - a(n))/n = 1/2.
Examples
Given a(0)=0, a(1)=1, a(2)=3, a(3)=7, the differences used are 1,2,3,4,6,7, so d=5, and we can use a(4) = a(3)+d = 7+5 = 12 because appending a(4)=12 to the sequence will result in the differences 12-0=12, 12-1=11, 12-3=9, 12-7=5, none of which had already been used. Similarly, given a(0)..a(4) = 0,1,3,7,12, the differences used are 1..7,9,11,12, so d=8, and we can use a(5) = a(4)+d = 12+8 = 20 because the resulting differences will be 20, 19, 17, 13, 8, none of which had already been used. Proceeding as above, we get a(6)=30 and a(7)=44. Given a(0)..a(7) = 0,1,3,7,12,20,30,44, the differences used are 1..14,17..20,23..24,27,29..30,32,37,41,43..44, so d=15, but we cannot use a(8) = a(7)+d = 44+15 = 59 because the difference 29 would be repeated: 59-30 = 30-1. Thus, we must find the smallest r such that using both a(8) = a(7)+r and a(9) = a(8)+d will not repeat any differences. The smallest such r is 21, so a(8) = a(7)+r = 44+21 = 65 and a(9) = a(8)+d = 65+15 = 80.
References
- Jerzy Browkin, Rozwiązanie pewnego zagadnienia A. Schinzla (Polish) [The solution of a certain problem of A. Schinzel], Roczniki Polskiego Towarzystwa Matematycznego [Annals Polish Mathematical Society], Seria I, Prace Matematyczne III (1959).
Links
- Jon E. Schoenfield, Table of n, a(n) for n = 0..6039
- Andrew Pollington and Charles Vanden Eynden, The integers as differences of a sequence, Canad. Math. Bull. Vol. 24 (4), 1981 (497-499).
- Jon E. Schoenfield, Magma program.
Crossrefs
Formula
Extensions
More terms from Jon E. Schoenfield, Jan 18 2015
Edited by Jon E. Schoenfield, Jan 22 2015
Comments
Examples
Links
Crossrefs
Formula