This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A322558 #27 Feb 14 2025 16:25:48 %S A322558 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, %T A322558 34,7,41,12,53,22,75,42,8,50,14,64,26,90,50,9,59,16,75,30,105,58,10, %U A322558 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 %N 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). %C A322558 The graph of the sequence appears random until n>16, after which the graph creates seven distinct lines. %H A322558 Colin Barker, <a href="/A322558/b322558.txt">Table of n, a(n) for n = 0..1000</a> %H A322558 <a href="/index/Rec#order_14">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,0,2,0,0,0,0,0,0,-1). %F A322558 For n>16, the sequence follows a pattern of seven, and each term lies on one of the following lines: %F A322558 If n is of the form 7k+3, then a(n) = (11/7)n+(30/7); %F A322558 if n is of the form 7k+4, then a(n) = (4/7)n+(26/7); %F A322558 if n is of the form 7k+5, then a(n) = (15/7)n+(30/7); %F A322558 if n is of the form 7k+6, then a(n) = (8/7)n+(22/7); %F A322558 if n is of the form 7k, then a(n) = (1/7)n+3; %F A322558 if n is of the form 7k+1, then a(n) = (9/7)n+(26/7); %F A322558 if n is of the form 7k+2, then a(n) = (2/7)n+(24/7). %F A322558 From _Colin Barker_, Aug 29 2019: (Start) %F A322558 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). %F A322558 a(n) = 2*a(n-7) - a(n-14) for n>30. %F A322558 (End) %t A322558 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 *) %o A322558 (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 %Y A322558 Cf. A133058, A380820. %K A322558 nonn,easy %O A322558 0,3 %A A322558 _Jackson Haselhorst_, Aug 28 2019