login
a(n) is the greatest m > 0 such that the n-th row of Pascal's triangle (A007318) contains a multiple of k for k = 1..m.
1

%I #17 Sep 04 2024 12:19:18

%S 1,1,2,1,4,2,6,1,2,4,10,3,12,6,4,1,16,2,18,4,6,10,22,3,4,12,2,6,28,15,

%T 30,1,10,16,6,8,36,18,12,7,40,6,42,10,8,22,46,3,6,4,16,12,52,2,10,7,

%U 18,28,58,15,60,30,8,1,12,10,66,16,22,24,70,8,72,36

%N a(n) is the greatest m > 0 such that the n-th row of Pascal's triangle (A007318) contains a multiple of k for k = 1..m.

%C The sequence A006093 appears to give the fixed points of this sequence.

%H Alois P. Heinz, <a href="/A374840/b374840.txt">Table of n, a(n) for n = 0..10000</a>

%e For n = 6: the sixth row of Pascal's triangle is 1, 6, 15, 20, 15, 6, 1; it contains a multiple of 1 (1), of 2 (6), of 3 (6), of 4 (20), of 5 (15), of 6 (6), but not of 7, so a(6) = 6.

%p A374840 := proc(n)

%p local dvsn ,m,a;

%p if n = 0 then

%p return 1;

%p end if;

%p dvsn := {} ;

%p for m from 1 to (n+2)/2 do

%p binomial(n,m) ;

%p dvsn := dvsn union numtheory[divisors](%) ;

%p end do:

%p for a from 1 do

%p if not a in dvsn then

%p return a-1 ;

%p end if;

%p end do:

%p end proc:

%p seq(A374840(n),n=0..40) ; # _R. J. Mathar_, Jul 30 2024

%p # second Maple program:

%p a:= proc(n) local k, s; s:= {seq(binomial(n,k), k=0..n/2)};

%p for k while ormap(x-> irem(x, k)=0, s) do od: k-1

%p end:

%p seq(a(n), n=0..73); # _Alois P. Heinz_, Sep 04 2024

%t a[n_] := If[n == 0, 1, Module[{dd, m, k}, dd = {}; For[m = 1, m <= (n + 2)/2, m++, dd = Union[dd, Divisors[Binomial[n, m]]]]; For[k = 1, True, k++, If[FreeQ[dd, k], Return[k - 1]]]]];

%t Table[a[n], {n, 0, 73}] (* _Jean-François Alcover_, Sep 04 2024, after _R. J. Mathar_ *)

%o (PARI) a(n) = { my (b = binomial(n)[1..(n+2)\2]); for (m = 2, oo, ok = 0; for (i = 1, #b, if (b[i] % m==0, next(2); ); ); return (m-1); ); }

%Y Cf. A006093, A007318, A249151.

%K nonn

%O 0,3

%A _Rémy Sigrist_, Jul 22 2024