login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A322558 a(0)=1, a(1)=1; for n>1, a(n)=a(n-1)+a(n-2) if a(n-1) is less than or equal to n-1, otherwise a(n)=a(n-1)-(n-1). 1
1, 1, 2, 3, 5, 1, 6, 7, 13, 5, 18, 8, 26, 14, 1, 15, 16, 31, 14, 45, 26, 6, 32, 10, 42, 18, 60, 34, 7, 41, 12, 53, 22, 75, 42, 8, 50, 14, 64, 26, 90, 50, 9, 59, 16, 75, 30, 105, 58, 10, 68, 18, 86, 34, 120, 66, 11, 77, 20, 97, 38, 135, 74, 12, 86, 22, 108, 42, 150, 82, 13, 95, 24, 119, 46, 165, 90, 14, 104, 26 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
The graph of the sequence appears random until n>16, after which the graph creates seven distinct lines.
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,2,0,0,0,0,0,0,-1).
FORMULA
For n>16, the sequence follows a pattern of seven, and each term lies on one of the following lines:
If n is of the form 7k+3, then a(n) = (11/7)n+(30/7);
if n is of the form 7k+4, then a(n) = (4/7)n+(26/7);
if n is of the form 7k+5, then a(n) = (15/7)n+(30/7);
if n is of the form 7k+6, then a(n) = (8/7)n+(22/7);
if n is of the form 7k, then a(n) = (1/7)n+3;
if n is of the form 7k+1, then a(n) = (9/7)n+(26/7);
if n is of the form 7k+2, then a(n) = (2/7)n+(24/7).
From Colin Barker, Aug 29 2019: (Start)
G.f.: (1 + x + 2*x^2 + 3*x^3 + 5*x^4 + x^5 + 6*x^6 + 5*x^7 + 11*x^8 + x^9 + 12*x^10 - 2*x^11 + 24*x^12 + 2*x^13 - 12*x^14 - 10*x^15 + 8*x^16 - 2*x^17 + 3*x^18 - 6*x^19 + 4*x^20 + 11*x^21 + 15*x^22 - 17*x^23 - 2*x^24 - 2*x^25 - 4*x^26 - 4*x^27 - 4*x^28 - 8*x^29 + 8*x^30) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6)^2).
a(n) = 2*a(n-7) - a(n-14) for n>30.
(End)
MATHEMATICA
a[0] = a[1] = 1; a[n_] := a[n] = If[a[n - 1] <= n - 1, a[n - 1] + a[n - 2], a[n - 1] - n + 1]; Array[a, 100, 0] (* Amiram Eldar, Aug 29 2019 *)
PROG
(PARI) Vec((1 + x + 2*x^2 + 3*x^3 + 5*x^4 + x^5 + 6*x^6 + 5*x^7 + 11*x^8 + x^9 + 12*x^10 - 2*x^11 + 24*x^12 + 2*x^13 - 12*x^14 - 10*x^15 + 8*x^16 - 2*x^17 + 3*x^18 - 6*x^19 + 4*x^20 + 11*x^21 + 15*x^22 - 17*x^23 - 2*x^24 - 2*x^25 - 4*x^26 - 4*x^27 - 4*x^28 - 8*x^29 + 8*x^30) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6)^2) + O(x^40)) \\ Colin Barker, Aug 29 2019
CROSSREFS
Cf. A133058.
Sequence in context: A105870 A328145 A096534 * A139047 A343376 A210945
KEYWORD
nonn,easy
AUTHOR
Jackson Haselhorst, Aug 28 2019
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 16:08 EDT 2024. Contains 371794 sequences. (Running on oeis4.)