OFFSET
1,2
COMMENTS
For n > 1, a(n) is the number of binary words of length n such that the numbers of 0's and 1's are not coprime. - Bartlomiej Pawlik, Sep 03 2023
FORMULA
a(n) = 2^n-Sum{binomial[n, k]; k>0, GCD[n, k]=1}, for n>1.
a(n) = 2 for primes.
EXAMPLE
For n=6, a(6)=52 because the sum of coefficients is restricted only to k=1,5 so a(6)=64-6-6.
PROG
(PARI) a(n) = if (n==1, 1, 2^n - 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