OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
FORMULA
For n>=3, a(n) = A000096(n-2).
From Chai Wah Wu, Oct 12 2018: (Start)
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 5.
G.f.: x^2*(2 - 6*x + 8*x^2 - 3*x^3)/(1 - x)^3. (End)
E.g.f.: (x/2)*(2 + 3*x - (2 - x)*exp(x)). - G. C. Greubel, Jan 30 2022
EXAMPLE
a(1)=0 because (1(3-1)/2) mod (1(1+1)/2) = 1 mod 1 = 0,
a(2)=2 because (2(6-1)/2) mod (2(2+1)/2) = 5 mod 3 = 2.
MATHEMATICA
Table[Mod[n(3n-1)/2, n(n+1)/2], {n, 100}]
Module[{nn=60}, Mod[#[[1]], #[[2]]]&/@Thread[{PolygonalNumber[ 5, Range[ nn]], Accumulate[ Range[nn]]}]] (* Harvey P. Dale, Nov 19 2022 *)
PROG
(Magma) [n lt 4 select 1+(-1)^n else n*(n-3)/2: n in [1..60]]; // G. C. Greubel, Jan 30 2022
(Sage)
def A175631(n): return 1+(-1)^n if (n<4) else 9*binomial(n/3, 2)
[A175631(n) for n in (1..60)] # G. C. Greubel, Jan 30 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Jul 29 2010
STATUS
approved