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.

A119447 Leading diagonal of triangle A119446.

This page as a plain text file.
%I A119447 #6 Apr 07 2023 17:16:36
%S A119447 2,2,3,3,3,3,3,3,3,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,13,13,7,7,7,7,13,13,
%T A119447 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
%U A119447 13,13,13,13,13,13,13,13,13,13,13,19,19,19,19,19,19,19,19,19,19,19,19,19
%N A119447 Leading diagonal of triangle A119446.
%C A119447 a(181) = 27 is the first term greater than 19. This is because prime(181)/181 > 6 for the first time. In general this sequence is determined by prime(n)/n: the pattern for each row of the triangle is that it ends with prime(n), preceded by multiples of k = prime(n)/n down to k^2, then the largest multiple of k-1 less than k^2 and the largest multiple of k-2 less than that and so on. This sequence gives the multiple of 1. See A000960 for the sequence that gives the ending value for each starting k.
%H A119447 G. C. Greubel, <a href="/A119447/b119447.txt">Table of n, a(n) for n = 1..1000</a>
%F A119447 a(n) = A000960( prime(n)/n ).
%F A119447 a(n) = A119446(n, n).
%t A119447 t[1, n_]:= Prime[n];
%t A119447 t[m_, n_]/; 1<m<=n:= t[m,n]= (n-m+1)*Floor[(t[m-1,n]-1)/(n-m+1)];
%t A119447 t[_, _]=0;
%t A119447 A119447[n_]:= A119447[n]= t[n,n];
%t A119447 Table[A119447[n], {n,100}] (* _G. C. Greubel_, Apr 07 2023 *)
%o A119447 (Magma)
%o A119447 function t(n,k) // t = A119446
%o A119447   if k eq 1 then return NthPrime(n);
%o A119447   else return (n-k+1)*Floor((t(n,k-1) -1)/(n-k+1));
%o A119447   end if;
%o A119447 end function;
%o A119447 [t(n,n): n in [1..100]]; // _G. C. Greubel_, Apr 07 2023
%o A119447 (SageMath)
%o A119447 def t(n, k): # t = A119446
%o A119447     if (k==1): return nth_prime(n)
%o A119447     else: return (n-k+1)*((t(n, k-1) -1)//(n-k+1))
%o A119447 def A119447(n): return t(n,n)
%o A119447 [A119447(n) for n in range(1,101)] # _G. C. Greubel_, Apr 07 2023
%Y A119447 Cf. A000960, A119444, A119446.
%K A119447 nonn
%O A119447 1,1
%A A119447 _Joshua Zucker_, May 20 2006