cp's OEIS Frontend

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.

A249695 a(n)=0, if A249441(n)=0; otherwise, a(n) is the smallest i such that A249441(n)^2 divides binomial(n,i).

This page as a plain text file.
%I A249695 #28 Mar 27 2020 03:03:08
%S A249695 0,0,0,0,1,0,3,0,1,2,3,0,1,6,3,7,1,2,3,4,1,6,3,0,1,2,3,12,1,6,3,5,1,2,
%T A249695 3,4,1,6,3,8,1,2,3,12,1,6,3,21,1,2,3,4,1,6,3,24,1,2,3,12,1,6,3,1,1,2,
%U A249695 3,4,1,6,3,8,1,2,3,12,1,6,3,16,1,2,3,4,1,6,3
%N A249695 a(n)=0, if A249441(n)=0; otherwise, a(n) is the smallest i such that A249441(n)^2 divides binomial(n,i).
%C A249695 After a(0) = 0, A048278 gives the positions of seven other zeros in the sequence. - _Antti Karttunen_, Nov 04 2014
%H A249695 Antti Karttunen, <a href="/A249695/b249695.txt">Table of n, a(n) for n = 0..10000</a>
%p A249695 A249695 := proc(n)
%p A249695     a41n := A249441(n) ;
%p A249695     if a41n = 0 then
%p A249695         return 0;
%p A249695     end if;
%p A249695     bi := 1;
%p A249695     for i from 0 do
%p A249695         if modp(bi,a41n^2)= 0 then
%p A249695             return i;
%p A249695         end if;
%p A249695         bi := bi*(n-i)/(1+i) ;
%p A249695     end do:
%p A249695 end proc: # _R. J. Mathar_, Nov 04 2014
%t A249695 bb[n_] := Table[Binomial[n, k], {k, 1, (n - Mod[n, 2])/2}];
%t A249695 a41[n_] := If[MemberQ[{0, 1, 2, 3, 5, 7, 11, 23}, n], 0, For[p = 2, True, p = NextPrime[p], If[AnyTrue[bb[n], Divisible[#, p^2]&], Return[p]]]];
%t A249695 a[n_] := If[(a41n = a41[n]) == 0, 0, For[i = 1, True, i++, If[Divisible[ Binomial[n, i], a41n^2], Return[i]]]];
%t A249695 a /@ Range[0, 100] (* _Jean-François Alcover_, Mar 27 2020 *)
%o A249695 (PARI)
%o A249695 A249695(n) = { forprime(p=2,3,for(k=0,floor(n/2),if((0==(binomial(n,k)%(p*p))),return(k)))); return(0); } \\ Straightforward and unoptimized version. But fast enough for 10000 terms.
%o A249695 A249695(n) = { for(p=2,3, my(o=0); for(k=1, n\2, o+=valuation((n-k+1)/k, p); if(o>1, return(k)))); return(0); } \\ This version is based on _Charles R Greathouse IV_'s code for A249441.
%o A249695 for(n=0, 10000, write("b249695.txt", n, " ", A249695(n)));
%o A249695 \\ _Antti Karttunen_, Nov 04 2014
%Y A249695 A249714 and A249715 give the record values and their positions.
%Y A249695 Cf. A048278, A249441, A249722, A249723, A249726.
%Y A249695 Differs from A249442 for the first time at n=9.
%K A249695 nonn
%O A249695 0,7
%A A249695 _Vladimir Shevelev_, Nov 04 2014