OFFSET
1,3
LINKS
Peter Kagey, Table of n, a(n) for n = 1..250
Project Euler, Problem 203: Squarefree Binomial Coefficients
EXAMPLE
a(5) = 1 + 2 + 3 + 6 = 12 because the squarefree numbers in the first 5 rows of Pascal's triangle are 1, 2, 3, and 6:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
MATHEMATICA
lim = 35; t = Select[#, SquareFreeQ] & /@ Table[Binomial[n, k], {n, 0, lim}, {k, 0, n}]; Table[Total@ Union[Flatten@ Take[t, n]], {n, lim}] (* Michael De Vlieger, Feb 11 2016 *)
PROG
(PARI) row(n) = vector(n, k, k--; binomial(n-1, k));
sqfrow(n) = select(x->issquarefree(x), row(n));
lista(nn) = {my(s = 0, vsqf = []); for (n=1, nn, vsqf = concat(vsqf, sqfrow(n)); vsqf = vecsort(vsqf, , 8); print1(vecsum(vsqf), ", "); ); } \\ Michel Marcus, Feb 11 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Kagey, Feb 10 2016
STATUS
approved