login
a(n) = (n^2 - 1)/6 - Sum_{t=0..n-1} [ A000217(t)/n ], where [ x ] means the fractional part of x here.
1

%I #13 Aug 02 2024 19:12:30

%S 0,0,1,1,3,4,6,7,11,13,16,19,24,27,33,35,42,47,53,58,67,71,78,85,95,

%T 102,112,118,128,138,147,155,170,178,191,200,213,224,238,248,263,277,

%U 290,302,322,331,347,361,380,395,413,427,445,463,482,496,519,534,554,573,594,612,637,651,678,698

%N a(n) = (n^2 - 1)/6 - Sum_{t=0..n-1} [ A000217(t)/n ], where [ x ] means the fractional part of x here.

%C a(c^n) for some constant c can be expressed as a linear recurrence with constant coefficients.

%F a(n) = (n^2 - 1 - A374968(n))/6.

%F a(2^n) = A006095(n).

%F a(3^n) has the ordinary generating function: x*(1 - 2*x + 5*x^2 + 12*x^3)/(1 - 13*x + 36*x^2 + 12*x^3 - 117*x^4 + 81*x^5).

%o (PARI) a(n) = (n^2-1)/6-sum(k=1,n,(k*(k+1)/2)%n)/n+((n+1)%2)/2

%Y Cf. A000217, A006095, A374968.

%K sign,easy

%O 1,5

%A _Thomas Scheuerle_, Jul 26 2024