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.

A243970 Smallest positive integer m such that n can be expressed as a partial sum of the divisors of m taken in decreasing order.

This page as a plain text file.
%I A243970 #19 Nov 29 2024 13:51:57
%S A243970 1,1,2,2,3,5,4,4,7,6,10,6,6,9,8,8,16,10,10,19,15,14,12,14,14,12,26,12,
%T A243970 12,29,16,16,21,18,34,20,18,37,18,18,27,20,20,43,24,30,46,33,32,28,24,
%U A243970 34,39,28,24,28,28,24,58,24,24,30,32,32,64,65,30,67,51
%N A243970 Smallest positive integer m such that n can be expressed as a partial sum of the divisors of m taken in decreasing order.
%C A243970 Sequence is similar to A167485, but here, the partial sums are evaluated in decreasing order starting from the highest divisor of n, n, down to the smallest one, 1. Thus for any n>0, a(n) exists and is at most equal to n: the highest divisor of n.
%H A243970 Antti Karttunen, <a href="/A243970/b243970.txt">Table of n, a(n) for n = 0..20000</a>
%e A243970 From n=1 to 2, these partial sums are: 1; 2, 3. So 3 has appeared in the partial divisors sums of 2. Hence a(3)=2.
%e A243970 a(11) = 6 as 11 can be written as 6 + 3 + 2 where 6, 3 and 2 are some divisors of 6 in decreasing order starting at 6. No smaller number than 6 lets us write 11 like so, proving a(11) = 6. - _David A. Corneth_, Nov 29 2024
%o A243970 (PARI) ps(n) = {vps = []; d = divisors(n); ips = 0; forstep (i=#d, 1, -1, ips += d[i]; vps = concat(vps, ips);); vps;}
%o A243970 a(n) = {if (n==0, return (1)); i=1; found=0; while (! found, v = ps(i); if (vecsearch(v, n), found=1, i++);); i;}
%o A243970 (PARI) first(n) = {
%o A243970 	n--;
%o A243970 	my(res = [1..n]);
%o A243970 	for(i = 1, n,
%o A243970 		d = divisors(i);
%o A243970 		s = 0;
%o A243970 		forstep(j = #d, 1, -1,
%o A243970 			s+=d[j];
%o A243970 			if(s <= n,
%o A243970 				res[s] = min(res[s], i);
%o A243970 			,
%o A243970 				next(2);
%o A243970 			);
%o A243970 		);
%o A243970 	);
%o A243970 	concat(1, res);
%o A243970 } \\ _David A. Corneth_, Nov 29 2024
%Y A243970 Cf. A167485.
%K A243970 nonn
%O A243970 0,3
%A A243970 _Michel Marcus_, Jun 16 2014