OFFSET
3,2
COMMENTS
The envelope of the lines form a cardioid.
LINKS
Lars Blomberg, Table of n, a(n) for n = 3..270
Lars Blomberg, Illustration for n = 12
Lars Blomberg, Illustration for n = 18
Lars Blomberg, Illustration for n = 32
Lars Blomberg, Illustration for n = 107
FORMULA
Empirically for n <= 270.
For n > 3 select the row in the table below for which d = n mod m. Then a(n) = (a*n^2+b*n+c)/denom.
+=============================================+
| d | m | a | b | c | denom |
+---------------------------------------------+
| 1, 5 | 6 | 5 | 0 | -29 | 24 |
| 3 | 6 | 5 | -16 | 3 | 24 |
| 2, 10 | 12 | 5 | -12 | 4 | 24 |
| 4, 8 | 12 | 5 | -12 | 16 | 24 |
| 0 | 60 | 5 | -28 | 0 | 24 |
| 6, 18, 42, 54 | 60 | 5 | -28 | 84 | 24 |
| 12, 24, 36, 48 | 60 | 5 | -28 | 96 | 24 |
| 30 | 60 | 5 | -28 | -12 | 24 |
+=============================================+
PROG
(PARI) bc=[[5, 0, -29, 24], [5, -16, 3, 24], [5, -12, 4, 24], [5, -12, 16, 24], [5, -28, 0, 24], [5, -28, 84, 24], [5, -28, 96, 24], [5, -28, -12, 24]];
m=[[1, 6, 1], [5, 6, 1], [3, 6, 2], [2, 12, 3], [10, 12, 3], [4, 12, 4], [8, 12, 4], [0, 60, 5], [6, 60, 6], [18, 60, 6], [42, 60, 6], [54, 60, 6], [12, 60, 7], [24, 60, 7], [36, 60, 7], [48, 60, 7], [30, 60, 8]];
ix(n)=for(i=1, length(m), x=m[i]; if(n%x[2]==x[1], return(x[3]))); -1
a(n)=if(n==3, return(1)); x=bc[ix(n)]; (x[1]*n^2+x[2]*n+x[3])/x[4]
vector(200, x, a(x+2))
CROSSREFS
KEYWORD
nonn
AUTHOR
Lars Blomberg, May 23 2020
STATUS
approved