OFFSET
1,3
COMMENTS
Equivalently, numbers that are congruent to {0, 1, 7, 15} mod 21. - Bruno Berselli, Aug 06 2012
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,0,1,-1).
FORMULA
From Bruno Berselli, Aug 06 2012: (Start)
G.f.: x^2*(1+6*x+8*x^2+6*x^3)/((1+x)*(1-x)^2*(1+x^2)).
a(n) = (42*n +14*i^((n-1)*n) -3*(-1)^n -3)/8 -7, where i=sqrt(-1). (End)
a(n) = a(n-1) + a(n-4) - a(n-5) for n>5. - Wesley Ivan Hurt, Jun 07 2016
E.g.f.: (24 + (21*x - 31)*cosh(x) + 7*(sin(x) + cos(x) + (3*x - 4)*sinh(x)))/4. - Ilya Gutkovskiy, Jun 07 2016
MAPLE
A151971:=n->(42*n+14*I^((n-1)*n)-3*I^(2*n)-3)/8-7: seq(A151971(n), n=1..100); # Wesley Ivan Hurt, Jun 07 2016
MATHEMATICA
Select[Range[0, 400], Divisible[#^2-#, 21]&] (* Harvey P. Dale, Jun 04 2012 *)
PROG
(Magma) [n: n in [0..309] | IsZero((n^2-n) mod 21)]; // Bruno Berselli, Aug 06 2012
(Maxima) makelist((42*n+14*%i^((n-1)*n)-3*(-1)^n-3)/8-7, n, 1, 60); /* Bruno Berselli, Aug 06 2012 */
CROSSREFS
For m^2 == m (mod n), see: n=2: A001477; n=3: A032766; n=4: A042948; n=5: A008851; n=6: A032766; n=7: A047274; n=8: A047393; n=9: A090570; n=10: A008851; n=11: A112651; n=12: A112652; n=13:A112653; n=14: A047274; n=15: A151972; n=16: A151977; n=17: A151978; n=18: A090570; n=19: A151979; n=20: A151980; n=21: A151971; n=22: A112651; n=24: A151973; n=26: A112653; n=30: A151972; n=32: A151983; n=34: A151978; n=38: A151979; n=42: A151971; n=48: A151981; n=64: A151984.
Cf. A215202.
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Aug 23 2009
STATUS
approved