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 #21 Sep 08 2022 08:45:38
%S 0,1,9,16,24,25,33,40,48,49,57,64,72,73,81,88,96,97,105,112,120,121,
%T 129,136,144,145,153,160,168,169,177,184,192,193,201,208,216,217,225,
%U 232,240,241,249,256,264,265,273,280,288,289,297,304,312,313,321,328,336,337,345
%N Numbers n such that n^2 - n is divisible by 24.
%H Vincenzo Librandi, <a href="/A151973/b151973.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,1,-1).
%F a(n) = a(n-1)+a(n-4)-a(n-5) for n>5. G.f.: x^2*(8*x^3+7*x^2+8*x+1) / ((x-1)^2*(x+1)*(x^2+1)). - _Colin Barker_, Nov 29 2012
%F a(n) = (12*n+3*i^(n*(n-1))-2*(-1)^n-17)/2, where i=sqrt(-1). - _Bruno Berselli_, Nov 29 2012
%p A151973:=n->(12*n+3*I^(n*(n-1))-2*I^(2*n)-17)/2: seq(A151973(n), n=1..100); # _Wesley Ivan Hurt_, Jun 07 2016
%t CoefficientList[Series[x (8 x^3 + 7 x^2 + 8 x + 1) / ((x - 1)^2 (x + 1) (x^2 + 1)), {x, 0, 40}], x] (* _Vincenzo Librandi_, Jun 19 2013 *)
%o (Magma) [n: n in [0..350] | IsZero(n*(n-1) mod 24)]; // _Bruno Berselli_, Nov 29 2012
%o (PARI) is(n)=(n^2-n)%24==0 \\ _Charles R Greathouse IV_, Oct 16 2015
%K nonn,easy
%O 1,3
%A _N. J. A. Sloane_, Aug 23 2009