%I #24 Aug 02 2024 19:12:14
%S 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,
%T 54,63,56,75,72,71,78,93,68,87,78,95,90,99,92,111,102,101,108,123,92,
%U 129,126,137,120,129,122,141,138,137,132,159,134,159,156,161,156,171,146,189,156,167,174,189
%N a(n) = 6*Sum_{t=0..n-1} [ A000217(t)/n ], where [ x ] means the fractional part of x here.
%C 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}.
%C a(c^n) for some constant c can be expressed as a linear recurrence with constant coefficients.
%F a(n) = -3*((n+1) Mod 2) + Sum_{k=1..n} ((k*(k+1)/2) Mod n)*6/n, for n > 0.
%F a(2^n) = A068156(n).
%F a(3^n) has the ordinary generating function: x*(-6*x - 2)/(9*x^4 - 12*x^3 + 4*x - 1).
%F a(5^n) has the ordinary generating function: x*(-18*x - 6)/(25*x^4 - 30*x^3 + 6*x - 1).
%F 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).
%F a(n) = n^2 - A374981(n)*6 - 1.
%o (PARI) a(n) = if(n==0, 0, sum(k=1, n, (k*(k+1)/2)%n)*6/n-3*((n+1)%2))
%Y Cf. A000217, A068156, A374981.
%K nonn,easy
%O 0,3
%A _Thomas Scheuerle_, Jul 26 2024