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.

A018886 Waring's problem: least positive integer requiring maximum number of terms when expressed as a sum of positive n-th powers.

This page as a plain text file.
%I A018886 #43 Feb 16 2025 08:32:33
%S A018886 1,7,23,79,223,703,2175,6399,19455,58367,176127,528383,1589247,
%T A018886 4767743,14319615,42991615,129105919,387186687,1161822207,3486515199,
%U A018886 10458497023,31377588223,94136958975,282427654143,847282962431,2541815332863
%N A018886 Waring's problem: least positive integer requiring maximum number of terms when expressed as a sum of positive n-th powers.
%C A018886 a(n) = (Q-1)*(2^n) + (2^n-1)*(1^n) is a sum of Q + 2^n - 2 terms, Q = trunc(3^n / 2^n).
%D A018886 G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, th. 393.
%H A018886 T. D. Noe, <a href="/A018886/b018886.txt">Table of n, a(n) for n = 1..200</a>
%H A018886 P. Pollack, <a href="https://web.archive.org/web/20130509125813/http://alpha01.dm.unito.it/personalpages/cerruti/ac/notes.pdf">Analytic and Combinatorial Number Theory</a> Course Notes, exercise 7.1.1. p. 277.
%H A018886 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/WaringsProblem.html">Waring's Problem</a>.
%F A018886 a(n) = 2^n*floor((3/2)^n) - 1 = 2^n*A002379(n) - 1.
%e A018886 a(3) = 23 = 16 +  7 = 2*(2^3) +  7*(1^3) is a sum of 9 cubes;
%e A018886 a(4) = 79 = 64 + 15 = 4*(2^4) + 15*(1^4) is a sum of 19 biquadrates.
%p A018886 A018886 := proc(n)
%p A018886 2^n*floor((3/2)^n)-1
%p A018886 end proc: # _R. J. Mathar_, May 07 2015
%t A018886 a[n_]:=-1+2^n*Floor[(3/2)^n]
%t A018886 a[Range[1,20]] (* _Julien Kluge_, Jul 21 2016 *)
%o A018886 (Python)
%o A018886 def a(n): return (3**n//2**n-1)*2**n + (2**n-1)
%o A018886 print([a(n) for n in range(1, 27)]) # _Michael S. Branicky_, Dec 17 2021
%o A018886 (Python)
%o A018886 def A018886(n): return (3**n&-(1<<n))-1 # _Chai Wah Wu_, Jun 25 2024
%Y A018886 Cf. A079611, A185187.
%Y A018886 Cf. A000079, A002379.
%K A018886 nonn,easy,nice
%O A018886 1,2
%A A018886 _N. J. A. Sloane_