OFFSET
1,2
COMMENTS
a(n) is a multiple of n for all n.
For n > 1, a(n) is the number of binary words of length n such that the quantities of 0's and 1's are coprime. - Bartlomiej Pawlik, Sep 03 2023
LINKS
Laszlo Toth, Weighted gcd-sum functions, J. Integer Sequences, 14 (2011), Article 11.7.7.
FORMULA
a(n) = Sum{binomial[n, k]; GCD[n, k]=1, 0<=k<=n}.
For n=prime, a(n)=2^n-2 because all k<=n except 0 and n are used.
EXAMPLE
For n=10, RRS[10]={1,3,7,9}, the corresponding coefficients are {10,120,120,10}, so the sum a(10)=260.
MAPLE
A056188 := proc(n)
a := 0 ;
for k from 1 to n do
if igcd(k, n) = 1 then
a := a+binomial(n, k);
end if ;
end do:
a ;
end proc: # R. J. Mathar, Sep 02 2017
MATHEMATICA
f[n_] := Plus @@ Binomial[n, Select[ Range[n], GCD[n, # ] == 1 &]]; Table[ f[n], {n, 33}] (* Robert G. Wilson v, Nov 04 2004 *)
PROG
(PARI) a(n) = if (n==1, 1, sum(k=0, n, if (gcd(n, k) == 1, binomial(n, k)))); \\ Michel Marcus, Mar 22 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Aug 02 2000
STATUS
approved