login
A175631
a(n) = (n-th pentagonal number) modulo (n-th triangular number).
1
0, 2, 0, 2, 5, 9, 14, 20, 27, 35, 44, 54, 65, 77, 90, 104, 119, 135, 152, 170, 189, 209, 230, 252, 275, 299, 324, 350, 377, 405, 434, 464, 495, 527, 560, 594, 629, 665, 702, 740, 779, 819, 860, 902, 945, 989, 1034, 1080, 1127, 1175, 1224, 1274, 1325, 1377, 1430
OFFSET
1,2
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
Cf. A000096 (n(n+3)/2), A000217 (triangular numbers), A000326 (pentagonal numbers), A175630 (n-th pentagonal number mod (n+2)).
Sequence in context: A024308 A059432 A256488 * A243816 A243159 A339327
KEYWORD
nonn
AUTHOR
Zak Seidov, Jul 29 2010
STATUS
approved