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.

Previous Showing 11-17 of 17 results.

A188462 Least number of 5th powers needed to represent n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
Offset: 1

Views

Author

Jean-François Alcover, Apr 01 2011

Keywords

Comments

Vaughan & Wooley (1995) prove that a(n) <= 17 for large enough n; in fact it is conjectured that a(n) <= 6 for large enough n. The maximum value is a(223) = 37. - Charles R Greathouse IV, Jul 05 2017

Examples

			33 = 2^5 + 1^5 (least decomposition) hence a(33) = 2.
		

Crossrefs

Cf. A002828 (squares), A002376 (cubes), A002377 (4th powers), A374012 (6th powers).

Programs

  • Mathematica
    Cnt5[n_] := Module[{k = 1}, While[Length[PowersRepresentations[n, k, 5]] == 0, k++]; k]; Array[Cnt5, 105] (* T. D. Noe, Apr 01 2011 *)
  • Python
    from itertools import count
    from sympy.solvers.diophantine.diophantine import power_representation
    def A188462(n):
        if n == 1: return 1
        for k in count(1):
            try:
                next(power_representation(n,5,k))
            except:
                continue
            return k # Chai Wah Wu, Jun 25 2024

A274459 Least number of perfect powers that add up to n.

Original entry on oeis.org

1, 2, 3, 1, 2, 3, 4, 1, 1, 2, 3, 2, 2, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 1, 2, 1, 2, 2, 3, 2, 1, 2, 2, 2, 1, 2, 3, 3, 2, 2, 3, 2, 2, 2, 3, 3, 2, 1, 2, 3, 2, 2, 2, 3, 3, 2, 2, 2, 3, 2, 3, 2, 1, 2, 3, 3, 2, 3, 3, 3, 2, 2, 2, 3, 2, 3, 3, 3, 2, 1, 2, 3, 3, 2
Offset: 1

Views

Author

Sergio Pimentel, Jun 23 2016

Keywords

Comments

Least number of perfect powers (A001597) needed to add up to n.
This sequence is close to but not exactly equal to A063274.
a(n) is at most 4 since any number can be written as a sum of 4 squares (Lagrange's theorem), but it is possible that for a sufficiently large n, a(n) < 4.
a(n) <= a(i) + a(n-i) for 1 <= i <= n-1. (for computational ease, the maximum value for i can be chosen as floor(n/2)). a(1991) = 4. for 1992 <= k <= 20000, there is no k such that a(k) = 4. - David A. Corneth, Jun 24 2016 [Next such k is 25887, see A113505. - Vaclav Kotesovec, Jun 25 2016]

Examples

			a(31) = 2 since 31 can be written as the sum of two (31 = 3^3 + 2^2 = 27 + 4) but no fewer than two perfect powers.
		

Crossrefs

Cf. A063275 (indices for which a(n)=3), A113505 (indices for which a(n)=4).

Programs

  • Mathematica
    nn = 72; t = Select[Range@ nn, # == 1 || GCD @@ FactorInteger[#][[All, 2]] > 1 &]; Table[Min@ Map[Length, Select[IntegerPartitions@ n, AllTrue[#, MemberQ[t, #] &] &]], {n, nn}] (* Michael De Vlieger, Jun 23 2016, after Ant King at A001597 *)
  • PARI
    lista(n) = {my(v = vector(n)); for(i = 2,sqrtint(n), for(j = 2, logint(n, i), v[i^j] = 1)); v[1]=1; v[2]=2; for(i=3, #v, if(v[i]==0, v[i] = vecmin(vector( i\2, k,v[k] + v[i-k]))));v} \\ David A. Corneth, Jun 24 2016; corrected by Peter Schorn, Jun 09 2022

Extensions

More terms from Michael De Vlieger, Jun 23 2016
Terms from a(74) from David A. Corneth, Jun 24 2016

A374012 Least number of 6th powers needed to represent n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
Offset: 1

Views

Author

Seiichi Manyama, Jun 25 2024

Keywords

Comments

a(703) = 73.

References

  • Pillai, S. S. (1940) On Waring’s problem g(6) = 73. Proc. Indian Acad. Sci. 12A: 30-40

Crossrefs

Programs

  • PARI
    a_vector(n, k=6) = my(v=vector(n), cnt=0, d=0, p=1, s=sum(j=1, sqrtnint(n, k), x^j^k)+x*O(x^n)); while(cnt
    				
  • Python
    from itertools import count
    from sympy.solvers.diophantine.diophantine import power_representation
    def A374012(n):
        if n == 1: return 1
        for k in count(1):
            try:
                next(power_representation(n,6,k))
            except:
                continue
            return k # Chai Wah Wu, Jun 25 2024

Formula

a(n) <= 73.

A084355 Least number of positive cubes needed to represent n!.

Original entry on oeis.org

1, 1, 2, 6, 3, 5, 5, 4, 4, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3
Offset: 0

Views

Author

Hugo Pfoertner, Jun 22 2003

Keywords

Examples

			a(4)=3 because 4!=24=2^3+2^3+2^3.
a(0)=1 because 0!=1=1^3.
a(1)=1 because 1!=1=1^3.
a(2)=2 because 2!=2=1^3+1^3.
a(3)=6 because 3!=6=1^3+1^3+1^3+1^3+1^3+1^3.
a(4)=3 because 4!=24=2^3+2^3+2^3.
a(5)=5 because 5!=120=1^3+3^3+3^3+4^3+1^3.
a(6)=5 because 6!=720=4^3+6^3+6^3+6^3+2^3.
a(7)=4 because 7!=5040=1^3+5^3+17^3+1^3.
a(8)=4 because 8!=40320=2^3+10^3+34^3+2^3.
a(9)=3 because 9!=362880=52^3+56^3+36^3.
a(10)=3 because 10!=3628800=96^3+140^3+4^3.
a(11)=3 because 11!=39916800=222^3+303^3+105^3.
a(12)=3 because 12!=479001600=214^3+777^3+47^3.
a(13)=4 because 13!=6227020800=106^3+255^3+1838^3+33^3.
a(14)=3 because 14!=87178291200=1344^3+4392^3+312^3.
a(15)=3 because 15!=1307674368000=2040^3+10908^3+1092^3.
a(16)=3 because 16!=20922789888000=8400^3+27040^3+8240^3.
a(17)=3 because 17!=355687428096000=22848^3+69984^3+9984^3.
a(18)=3 because 18!=6402373705728000=54060^3+184080^3+18900^3.
From _Donovan Johnson_, May 17 2010: (Start)
a(19)=3 because 19!=121645100408832000=131040^3+331200^3+436320^3.
a(20)=3 because 20!=2432902008176640000=87490^3+1034430^3+1098440^3.
(End)
		

Crossrefs

Programs

  • PARI
    a(n,up,dw,k)=local(i,m);if(k==1,if(n==round(sqrtn(n,3))^3,return(1),return(-1)),forstep(i=up,dw,-1,m=n-i^3;if(a(m,min(i,floor(sqrtn(m,3))),ceil(sqrtn(m/(k-1),3)),k-1)==1,return(1)))) for(n=0,18,for(k=1,9,if(a(n!,floor(sqrtn(n!,3)),ceil(sqrtn(n!/k,3)),k)==1,print1(k", ");break))) \\ Herman Jamke (hermanjamke(AT)fastmail.fm), Apr 01 2007

Formula

a(n)=A002376(n!).

Extensions

More terms from David W. Wilson, Jun 23 2003
More terms from Herman Jamke (hermanjamke(AT)fastmail.fm), Apr 01 2007
a(19)-a(20) from Donovan Johnson, May 17 2010

A100854 Least number of positive cubes that sum to n^2.

Original entry on oeis.org

1, 4, 2, 2, 4, 3, 7, 1, 3, 4, 6, 4, 5, 6, 3, 4, 4, 5, 5, 6, 4, 4, 4, 2, 5, 5, 1, 4, 5, 4, 4, 2, 4, 5, 4, 4, 4, 6, 4, 4, 5, 4, 6, 5, 4, 6, 6, 3, 4, 5, 5, 6, 3, 4, 4, 5, 5, 5, 3, 4, 5, 4, 4, 1, 4, 5, 5, 4, 4, 6, 3, 3, 5, 6, 5, 4, 4, 3, 5, 4, 2, 5, 5, 3, 5, 5, 3, 6, 5, 3, 4, 6, 5, 5, 4, 3, 5, 2, 4, 3
Offset: 1

Views

Author

Giovanni Teofilatto, Jan 08 2005

Keywords

Examples

			a(2)=4 because 4=1+1+1+1;
a(3)=2 because 9=1+8;
a(4)=2 because 16=8+8.
		

Crossrefs

Cf. A002376 (least number of positive cubes needed to represent n).

Programs

  • Mathematica
    nn=100^2; cnt=Table[10, {nn}]; maxN=Floor[nn^(1/3)]; Do[v={a, b, c, d, e, f, g, h, i}; n=Plus@@(v^3); If[n>0 && n<=nn, cnt[[n]]=Min[cnt[[n]], 9-Count[v, 0]]], {a, 0, maxN}, {b, a, maxN}, {c, b, maxN}, {d, c, maxN}, {e, d, maxN}, {f, e, maxN}, {g, f, maxN}, {h, f, maxN}, {i, h, maxN}]; Table[cnt[[n^2]], {n, 100}] (T. D. Noe)

Formula

a(n) = A002376(n^2). - R. J. Mathar, May 06 2016

Extensions

Corrected and extended by T. D. Noe, Jan 10 2005

A338497 Least number of odd cubes needed to represent n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 3
Offset: 1

Views

Author

Ilya Gutkovskiy, Oct 31 2020

Keywords

Crossrefs

A354761 Least number of squares and cubes that add up to n.

Original entry on oeis.org

1, 2, 3, 1, 2, 3, 4, 1, 1, 2, 3, 2, 2, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 1, 2, 1, 2, 2, 3, 2, 2, 2, 2, 2, 1, 2, 3, 3, 2, 2, 3, 2, 2, 2, 3, 3, 3, 1, 2, 3, 2, 2, 2, 3, 3, 2, 2, 3, 3, 2, 3, 2, 1, 2, 3, 3, 2, 3, 3, 3, 2, 2, 2, 3, 2, 3, 3, 3, 2, 1, 2, 3, 3, 2, 3
Offset: 1

Views

Author

Peter Schorn, Jun 06 2022

Keywords

Comments

a(n) <= 4 since any number can be written as a sum of 4 squares (Lagrange's theorem).
Sequence first differs from A063274, A225926 and A274459 at n = 32 since 32 is a powerful number, a prime power and a perfect power but neither a square nor a cube.

Examples

			a(1) = 1, a(4) = 1 (4 = 2^2), a(7) = 4 (7 = 2^2 + 1^2 + 1^2 + 1^2), a(8) = 1 (8 = 2^3), a(12) = 2 (12 = 2^3 + 2^2), a(17) = 2 (17 = 4^2 + 1^2), a(32) = 2 (32 = 4^2 + 4^2).
		

Crossrefs

Programs

  • PARI
    lista(n) = {my(v = vector(n)); for(j = 2, 3, for(i = 2, sqrtnint(n, j), v[i^j] = 1)); v[1]=1; v[2]=2; for(i=3, #v, if(v[i]==0, v[i] = vecmin(vector(i\2, k, v[k] + v[i-k])))); v}
Previous Showing 11-17 of 17 results.