A178142 Sum over the divisors d = 2 and/or 3 of n.
0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3
Offset: 1
Links
- Vladimir Shevelev, A recursion for divisor function over divisors belonging to a prescribed finite sequence of positive integers and a solution of the Lahiri problem for divisor function sigma_x(n), arXiv:0903.1743 [math.NT], 2009.
- Index entries for linear recurrences with constant coefficients, signature (-1,0,1,1).
Programs
-
Mathematica
Table[Total@ Select[Divisors@ n, 2 <= # <= 3 &], {n, 120}] (* or *) Table[Total[Divisors@ n /. {d_ /; d < 2 -> Nothing, d_ /; d > 3 -> Nothing} ], {n, 120}] (* Michael De Vlieger, Feb 07 2016 *) Flatten[Table[{0,2,3,2,0,5}, {16}]] (* Amiram Eldar, Aug 03 2024 *)
-
PARI
a(n) = sumdiv(n, d, d*((d==2) || (d==3))); \\ Michel Marcus, Feb 07 2016
-
PARI
a(n) = [0,2,3,2,0,5][(n-1) % 6 + 1]; \\ Amiram Eldar, Aug 03 2024
Formula
a(n) = Sum_{d|n, d=2 or d=3} d.
a(n+6) = a(n).
a(n) = -a(n-1) + a(n-3) + a(n-4).
G.f.: -x*(2+5*x+5*x^2) / ( (x-1)*(1+x)*(1+x+x^2) ).
Extensions
Replaced recurrence by a shorter one; added keyword:less - R. J. Mathar, May 28 2010
Comments