This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A249441 #53 Jul 30 2018 12:46:57 %S A249441 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, %T A249441 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, %U A249441 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 %N 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. %C A249441 a(n) = 3 for 15, 31, 47, 63, 95, 127, 191, 255, 383, 511, 767, 1023, 1535, 2047, 3071, etc. %C A249441 The above values all occur in A249723 and from 31 onward seem to be given by A052955(n>=8). (Cf. also A249714 & A249715). - _Antti Karttunen_, Nov 04 2014 %C A249441 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). %H A249441 Charles R Greathouse IV, <a href="/A249441/b249441.txt">Table of n, a(n) for n = 0..10000</a> %H A249441 E. E. Kummer, <a href="http://gdz.sub.uni-goettingen.de/dms/load/img/?PPN=PPN243919689_0044&IDDOC=266967">Über die Ergänzungssätze zu den allgemeinen Reciprocitätsgesetzen</a>, J. Reine Angew. Math. 44 (1852), 93-146. %H A249441 Mihai Prunescu, <a href="http://home.mathematik.uni-freiburg.de/prunescu/binomsym.pdf">Sign-reductions, p-adic valuations, binomial coefficients modulo p^k and triangular symmetries.</a> Preprint 2013. %p A249441 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 %p A249441 # alternative %p A249441 A249441 := proc(n) %p A249441 local p,wrks,bi,k; %p A249441 if n in [0,1,2,3,5,7,11,23] then %p A249441 return 0 ; %p A249441 end if; %p A249441 p :=2 ; %p A249441 while true do %p A249441 wrks := false; %p A249441 bi := 1 ; %p A249441 for k from 0 to n do %p A249441 if modp(bi,p^2) = 0 then %p A249441 wrks := true; %p A249441 break; %p A249441 end if; %p A249441 bi := bi*(n-k)/(1+k) ; %p A249441 end do: %p A249441 if wrks then %p A249441 return p; %p A249441 end if; %p A249441 p := nextprime(p) ; %p A249441 end do: %p A249441 end proc: # _R. J. Mathar_, Nov 04 2014 %t A249441 row[n_] := Table[Binomial[n, k], {k, 1, (n-Mod[n, 2])/2}]; %t A249441 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]]]]; %t A249441 Table[a[n], {n, 0, 100}] (* _Jean-François Alcover_, Jul 30 2018 *) %o A249441 (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 %o A249441 (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 %o A249441 (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 %Y A249441 Cf. A005117, A007913, A048278, A052955, A249695, A249714, A249715, A249723. %K A249441 nonn,easy %O A249441 0,5 %A A249441 _Vladimir Shevelev_, Oct 28 2014 %E A249441 More terms from _Peter J. C. Moses_, Oct 28 2014