login
A374968
a(n) = 6*Sum_{t=0..n-1} [ A000217(t)/n ], where [ x ] means the fractional part of x here.
1
0, 0, 3, 2, 9, 6, 11, 12, 21, 14, 21, 24, 29, 24, 33, 26, 45, 36, 41, 42, 51, 38, 57, 60, 65, 54, 63, 56, 75, 72, 71, 78, 93, 68, 87, 78, 95, 90, 99, 92, 111, 102, 101, 108, 123, 92, 129, 126, 137, 120, 129, 122, 141, 138, 137, 132, 159, 134, 159, 156, 161, 156, 171, 146, 189, 156, 167, 174, 189
OFFSET
0,3
COMMENTS
For n > 3, a(n) can be a prime number only if n can be divided by 6. If n cannot be divided by 6 then a(n) has at least one divisors of the set {2, 3}.
a(c^n) for some constant c can be expressed as a linear recurrence with constant coefficients.
FORMULA
a(n) = -3*((n+1) Mod 2) + Sum_{k=1..n} ((k*(k+1)/2) Mod n)*6/n, for n > 0.
a(2^n) = A068156(n).
a(3^n) has the ordinary generating function: x*(-6*x - 2)/(9*x^4 - 12*x^3 + 4*x - 1).
a(5^n) has the ordinary generating function: x*(-18*x - 6)/(25*x^4 - 30*x^3 + 6*x - 1).
a(6^n) has the ordinary generating function: x*(9*x^2 - 18*x - 11)/(18*x^4 - 21*x^3 - 3*x^2 + 7*x - 1).
a(n) = n^2 - A374981(n)*6 - 1.
PROG
(PARI) a(n) = if(n==0, 0, sum(k=1, n, (k*(k+1)/2)%n)*6/n-3*((n+1)%2))
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Thomas Scheuerle, Jul 26 2024
STATUS
approved