Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #18 Jan 03 2021 01:01:52
%S 1,1,1,1,1,2,1,1,1,2,1,2,1,2,3,1,1,2,1,2,3,2,1,2,1,2,1,2,1,2,1,1,2,2,
%T 3,2,1,2,3,2,1,2,1,2,3,2,1,2,1,2,3,3,1,2,3,2,3,2,1,2,1,2,3,1,2,2,1,2,
%U 3,3,1,2,1,2,3,3,4,4,1,2,1,2,1,2,3,2,3,3,1,2,3,4,3,2,3,2,1,2,3,3,1,2,1,2,3,2,1,2,1,2
%N a(n) is the least number of terms needed to represent n as a sum of powers of the same prime.
%C A000961 gives all n such that a(n)=1. A024619 gives all n such that a(n) > 1.
%C If a(n) < m, let p be a prime such that n is a sum of < m powers of p. Then for any positive integers c_1, ... c_m that add up to n, p divides the m-nomial coefficient n!/(c_1!*c_2!*...*c_m!). If a(n) >= m then there is no prime that divides all such coefficients.
%H Alois P. Heinz, <a href="/A187279/b187279.txt">Table of n, a(n) for n = 1..10000</a>
%H Mathematics StackExchange, <a href="https://math.stackexchange.com/questions/2962334/the-largest-number-y-in-which-xxyx2/2962386#2962386">The largest number y in which (x!)^(x+y)|(x^2)!</a>
%e a(15) = 3 because 15 can be expressed with powers of 3 as 3^2+3^1+3^1, or with powers of 7 as 7^1+7^1+7^0, or with powers of 13 as 13^1+13^0+13^0, but there is no such expression with fewer than three terms.
%p with(numtheory):
%p b:= proc(n, p) local c, m; m:=n; c:=0;
%p while m>0 do c:= c+irem(m, p, 'm') od; c
%p end:
%p a:= n-> min(seq(b(n, ithprime(i)), i=1..pi(n+1))):
%p seq(a(n), n=1..100); # _Alois P. Heinz_, Nov 06 2013
%t Join[{1}, Table[Min[Plus @@@ IntegerDigits[n, Prime[Range[PrimePi[n]]]]], {n, 2, 110}]] (* _T. D. Noe_, Mar 08 2011 *)
%K nonn,easy
%O 1,6
%A _David Wasserman_, Mar 07 2011