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.

A276781 a(n) = 1+n-(nearest power of prime <= n); for n > 1, a(n) = minimal b such that the numbers binomial(n,k) for b <= k <= n-b have a common divisor greater than 1.

This page as a plain text file.
%I A276781 #73 Oct 25 2024 11:45:40
%S A276781 1,1,1,1,1,2,1,1,1,2,1,2,1,2,3,1,1,2,1,2,3,4,1,2,1,2,1,2,1,2,1,1,2,3,
%T A276781 4,5,1,2,3,4,1,2,1,2,3,4,1,2,1,2,3,4,1,2,3,4,5,6,1,2,1,2,3,1,2,3,1,2,
%U A276781 3,4,1,2,1,2,3,4,5,6,1,2,1,2,1,2,3,4,5,6,1,2,3,4,5,6,7,8,1,2,3,4,1,2
%N A276781 a(n) = 1+n-(nearest power of prime <= n); for n > 1, a(n) = minimal b such that the numbers binomial(n,k) for b <= k <= n-b have a common divisor greater than 1.
%C A276781 The definition in the video has "b < k < n-b" rather than "b <= k <= n-b", but that appears to be a typographical error.
%C A276781 From _Antti Karttunen_, Jan 21 2020: (Start)
%C A276781 a(n) = 1 if n is a power of prime (term of A000961), otherwise a(n) is one more than the distance to the nearest preceding prime power.
%C A276781 For n > 1, a(n) indicates the maximum region on the row n of Pascal's triangle (A007318) such that binomial terms C(n,a(n)) .. C(n,n-a(n)) all share a common prime factor. Because for all prime powers, p^k, the binomial terms C(p^k,1) .. C(p^k,p^k-1) have p as their prime factor, we have a(A000961(n)) = 1 for all n, while for each successive n that is not a prime power, the region of shared prime factor shrinks one step more towards the center of the triangle. From this follows that this is the ordinal transform of A025528 (equally, of A065515, or of A003418(n) from n >= 1 onward), equivalent to the simple definition given above.
%C A276781 (End)
%H A276781 Antti Karttunen, <a href="/A276781/b276781.txt">Table of n, a(n) for n = 1..16384</a> (terms for n = 2..1685 from R. J. Mathar, terms 1686..10000 from Chai Wah Wu).
%H A276781 Antti Karttunen, <a href="/A276781/a276781.txt">Data supplement: n, a(n) computed for n = 1..65537</a>
%H A276781 Christophe Soulé, <a href="https://vimeo.com/100212123">Le triangle de Pascal et ses propriétés</a>, Lecture, Soc. Math. de France, Feb 13 2008; <a href="https://smf.emath.fr/evenements-smf/soule-christophe-le-triangle-de-pascal-et-ses-proprietes-2008">SMF link</a> (in French).
%F A276781 If A010055(n) == 1, a(n) = 1, otherwise a(n) = 1 + a(n-1). - _Antti Karttunen_, Jan 21 2020
%e A276781 Row 6 of Pascal's triangle is 1,6,15,20,15,6,1 and [15,20,15] have a common divisor of 5. Since 15 = binomial(6,2), a(6)=2.
%p A276781 mygcd:=proc(lis) local i,g,m;
%p A276781 m:=nops(lis); g:=lis[1];
%p A276781 for i from 2 to m do g:=gcd(g,lis[i]); od:
%p A276781 g; end;
%p A276781 f:=proc(n) local b,lis; global mygcd;
%p A276781 for b from floor(n/2) by -1 to 1 do
%p A276781 lis:=[seq(binomial(n,i),i=b..n-b)];
%p A276781 if mygcd(lis)=1 then break; fi; od:
%p A276781 b+1;
%p A276781 end;
%p A276781 [seq(f(n),n=2..120)];
%t A276781 Table[b = 1; While[GCD @@ Map[Binomial[n, #] &, Range[b, n - b]] == 1, b++]; b, {n, 92}] (* _Michael De Vlieger_, Oct 03 2016 *)
%o A276781 (PARI) A276781(n) = if(1==n,1,forstep(k=n,1,-1,if(isprimepower(k),return(1+n-k)))); \\ _Antti Karttunen_, Jan 21 2020
%o A276781 (Python)
%o A276781 from sympy import factorint
%o A276781 def A276781(n): return 1+n-next(filter(lambda m:len(factorint(m))<=1, range(n,0,-1))) # _Chai Wah Wu_, Oct 25 2024
%Y A276781 Cf. A007318, A010055, A276782 (positions of records), A000961 (positions of ones), A024619 (positions of terms > 1).
%Y A276781 Cf. A002944, A003418, A025528, A065515, A175851.
%K A276781 nonn,look
%O A276781 1,6
%A A276781 _N. J. A. Sloane_, Sep 29 2016, following a suggestion from _Eric Desbiaux_
%E A276781 Term a(1) = 1 prepended and alternative simpler definition added to the name by _Antti Karttunen_, Jan 20 2020