Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #22 Sep 07 2022 10:25:12
%S 5,8,14,17,23,26,32,35,41,44,50,53,59,62,68,71,77,80,86,89,95,98,104,
%T 107,113,116,122,125,131,134,140,143,149,152,158,161,167,170,176,179,
%U 185,188,194,197,203,206,212,215,221,224,230,233,239,242,248,251
%N Numbers congruent to 5 or 8 mod 9.
%C These numbers cannot be written as the sum of two triangular numbers.
%H Arkadiusz Wesolowski, <a href="/A253195/b253195.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,-1).
%F a(n) = a(n-1) + a(n-2) - a(n-3), n >= 4.
%F G.f.: x*(5 + 3*x + x^2)/((1 + x)*(1 - x)^2).
%F a(n) = a(n-2) + 9.
%F a(n) = 9*n - a(n-1) - 5.
%F a(n) = 4*n + 2*ceiling(n/2) - floor(n/2) - 1.
%F a(n) = (9*n - (3/2)*(1 + (- 1)^n) + 1)/2.
%F E.g.f.: 1 + ((18*x - 1)*exp(x) - 3*exp(-x))/4. - _David Lovler_, Sep 06 2022
%t LinearRecurrence[{1, 1, -1}, {5, 8, 14}, 56]
%t Select[Range[300],MemberQ[{5,8},Mod[#,9]]&] (* _Harvey P. Dale_, Mar 17 2020 *)
%o (Magma) [n: n in [0..251] | n mod 9 in {5, 8}];
%o (PARI) Vec(x*(5 + 3*x + x^2)/((1 + x)*(1 - x)^2) + O(x^80)) \\ _Michel Marcus_, Mar 25 2015
%Y Subsequence of A014132 and of A020757.
%K nonn,easy
%O 1,1
%A _Arkadiusz Wesolowski_, Mar 24 2015