A002377 Least number of 4th powers needed to represent n.
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 5, 1, 2, 3
Offset: 1
References
- D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, p. 82.
- N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
Links
- T. D. Noe, Table of n, a(n) for n = 1..14000
- C. A. Bretschneider, Zerlegung der Zahlen bis 4100 in Biquadrate, J. Reine Angew. Math., 46 (1853), 1-28.
- Eric Weisstein's World of Mathematics, Biquadratic Number
Programs
-
Mathematica
Cnt4[n_] := Module[{k = 1}, While[Length[PowersRepresentations[n, k, 4]] == 0, k++]; k]; Array[Cnt4, 100] (* T. D. Noe, Apr 01 2011 *) seq[n_] := Module[{v = Table[0, {n}], s, p}, s = Sum[x^(k^4), {k, 1, n^(1/4)}] + O[x]^(n+1); p=1; For[k=1, k <= 19, k++, p *= s; For[i=1, i <= n, i++, If[v[[i]]==0 && Coefficient[p, x, i] != 0, v[[i]] = k]]]; v]; seq[100] (* Jean-François Alcover, Sep 28 2019, after Andrew Howroyd *)
-
PARI
seq(n)={my(v=vector(n), s=sum(k=1, sqrtint(sqrtint(n)), x^(k^4)) + O(x*x^n), p=1); for(k=1, 19, p*=s; for(i=1, n, if(!v[i] && polcoeff(p,i), v[i]=k))); v} \\ Andrew Howroyd, Jul 06 2018
-
Python
from itertools import count from sympy.solvers.diophantine.diophantine import power_representation def A002377(n): if n == 1: return 1 for k in count(1): try: next(power_representation(n,4,k)) except: continue return k # Chai Wah Wu, Jun 25 2024
Extensions
More terms from Arlin Anderson (starship1(AT)gmail.com)
Comments