|
|
A249441
|
|
a(n) is the smallest prime whose square divides at least one entry in the n-th row of Pascal's triangle, or 0 if there is no such prime.
|
|
7
|
|
|
0, 0, 0, 0, 2, 0, 2, 0, 2, 2, 2, 0, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,5
|
|
COMMENTS
|
a(n) = 3 for 15, 31, 47, 63, 95, 127, 191, 255, 383, 511, 767, 1023, 1535, 2047, 3071, etc.
Using the Kummer theorem on carries, one can prove that, if a(n)>3 or 0, then n>23 takes the form of either 1...1 or 101...1 in base 2 and simultaneously 212...2 in base 3. However, it is easy to see that this leads to a contradiction. Thus there are no terms greater than 3 and only 8 zeros, i.e., there are only 8 rows in Pascal's triangle that contain all squarefree numbers. It turns out that the latter result has been known for a long time (see A048278).
|
|
LINKS
|
|
|
MAPLE
|
a_list := proc(len) local s; s := proc(L, p) local n; seq(max(op(map(b-> padic[ordp](b, p), {seq(binomial(n, k), k=0..n)}))), n=0..L); map(k-> `if`(k<2, 0, p), [%]) end: zip((x, y)-> `if`(x=0, y, x), s(len, 2), s(len, 3)) end: a_list(86); # Peter Luschny, Nov 01 2014
# alternative
local p, wrks, bi, k;
if n in [0, 1, 2, 3, 5, 7, 11, 23] then
return 0 ;
end if;
p :=2 ;
while true do
wrks := false;
bi := 1 ;
for k from 0 to n do
if modp(bi, p^2) = 0 then
wrks := true;
break;
end if;
bi := bi*(n-k)/(1+k) ;
end do:
if wrks then
return p;
end if;
p := nextprime(p) ;
end do:
|
|
MATHEMATICA
|
row[n_] := Table[Binomial[n, k], {k, 1, (n-Mod[n, 2])/2}];
a[n_] := If[MemberQ[{0, 1, 2, 3, 5, 7, 11, 23}, n], 0, For[p = 2, True, p = NextPrime[p], If[AnyTrue[row[n], Divisible[#, p^2]&], Return[p]]]];
|
|
PROG
|
(PARI) a(n) = my(o=0); for(k=1, n\2, o+=valuation((n-k+1)/k, 2); if(o>1, return(2))); if(n<24 && n!=15, 0, 3) \\ Charles R Greathouse IV, Nov 03 2014
(PARI) A249441(n) = { forprime(p=2, 3, for(k=0, n\2, if((0==(binomial(n, k)%(p*p))), return(p)))); return(0); } \\ This is more straightforward, but a slower implementation - Antti Karttunen, Nov 03 2014
(PARI) a(n)=if((n+1)>>valuation(n+1, 2)<5, if(n<24 && setsearch([1, 2, 3, 5, 7, 11, 23], n), 0, 3), 2) \\ Charles R Greathouse IV, Nov 06 2014
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|