OFFSET
1,1
COMMENTS
For a(1)=3 the members of the sequence from a(12) onwards are of the form a(6*r+6)=1, a(6*r+7)=3+r, a(6*r+8)=2, a(6*r+9)=3+r, a(6*r+10)=3, a(6*r+11)=4+r, r>=1.
For every integer a(1)>=1, from a(a(1)*a(1)+3) onwards, the members of the sequence are of the form a(n)=1, a(n+1)=a(1)+r, a(n+2)=2, a(n+3)=a(1)+r, ... , a(n+2*a(1)-2)=a(1), a(n+2*a(1)-1)=a(1)+r+1. n = a(1)*a(1)+2*a(1)*(r-1)+3, r>=1.
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (0,1,0,0,0,1,0,-1).
FORMULA
From Colin Barker, Mar 20 2016: (Start)
a(n) = a(n-2)+a(n-6)-a(n-8) for n>9.
G.f.: x*(3+x-2*x^2+x^3+x^5-2*x^6-2*x^7+3*x^8+x^10-3*x^11-x^12+2*x^13-x^14) / ((1-x)^2*(1+x)^2*(1-x+x^2)*(1+x+x^2)).
(End)
EXAMPLE
a(1)=3. The number of occurrences of 3 in {3} is 1, thus a(2)=1. The number of occurrences of 1 in {3,1} is 1, thus a(3)=1. The number of occurrences of 1 in {3, 1, 1} is 2, thus a(4)=2. The number of occurrences of 2 in {3, 1, 1, 2} is 1, thus a(5)=1. The number of occurrences of 1 in {3, 1, 1, 2, 1} is 3, thus a(6)=3 , and so on.
MATHEMATICA
LinearRecurrence[{0, 1, 0, 0, 0, 1, 0, -1}, {3, 1, 1, 2, 1, 3, 2, 2, 3, 3, 4, 1, 4, 2, 4}, 120] (* Harvey P. Dale, Dec 16 2023 *)
PROG
(PARI) Vec(x*(3+x-2*x^2+x^3+x^5-2*x^6-2*x^7+3*x^8+x^10-3*x^11-x^12+2*x^13-x^14) / ((1-x)^2*(1+x)^2*(1-x+x^2)*(1+x+x^2)) + O(x^100)) \\ Colin Barker, Mar 20 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ctibor O. Zizka, Mar 19 2016
STATUS
approved