OFFSET
1,2
COMMENTS
The key-numbers of the pitches of a ascending melodic minor scale on a standard chromatic keyboard, with root = 0 and raised seventh.
First differences are period 7: repeat [1,2,2,2,2,1,2]. - Bruno Berselli, May 27 2011
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,0,0,1,-1).
FORMULA
a(n) = a(n-1) + a(n-7) - a(n-8) for n>8; G.f.: ( 2+x+2*x^2+2*x^3+2*x^4+2*x^5+x^6 ) / ( (x^6+x^5+x^4+x^3+x^2+x+1)*(x-1)^2 ). - R. J. Mathar, May 26 2011
a(n) = 2*n-floor(2*n/7)-floor(((n-4) mod 7)/5). - Rolf Pleisch, Jun 11 2011
From Wesley Ivan Hurt, Jul 21 2016: (Start)
a(n) = a(n-7) + 12 for n>7.
a(n) = (84*n - 77 - 2*(n mod 7) - 2*((n+1) mod 7) - 2*((n+2) mod 7) - 2*((n+3) mod 7) + 5*((n+4) mod 7) - 2*((n+5) mod 7) + 5*((n+6) mod 7))/49.
a(7*k) = 12*k-1, a(7*k-1) = 12*k-3, a(7*k-2) = 12*k-5, a(7*k-3) = 12*k-7, a(7*k-4) = 12*k-9, a(7*k-5) = 12*k-10, a(7*k-6) = 12*k-12. (End)
MAPLE
A190785:=n->12*floor(n/7)+[0, 2, 3, 5, 7, 9, 11][(n mod 7)+1]: seq(A190785(n), n=0..100); # Wesley Ivan Hurt, Jul 21 2016
MATHEMATICA
Union[Flatten[Table[12n + {0, 2, 3, 5, 7, 9, 11}, {n, 0, 8}]]] (* Alonso del Arte, Jun 11 2011 *)
PROG
(Magma) [n: n in [0..110] | n mod 12 in [0, 2, 3, 5, 7, 9, 11]]; // Bruno Berselli, May 27 2011
(PARI) a(n)=n\7*12+[0, 2, 3, 5, 7, 9, 11][n%7+1] \\ Charles R Greathouse IV, Jun 08 2011
(Python)
def A190785(n):
a, b = divmod(n-1, 7)
return (0, 2, 3, 5, 7, 9, 11)[b]+12*a # Chai Wah Wu, Jan 26 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Roberto Bertocco, May 26 2011
EXTENSIONS
Zero prepended by Wesley Ivan Hurt, Jul 21 2016
STATUS
approved