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.

Showing 1-5 of 5 results.

A161885 Smallest k such that n^5 = a_1^5+...+a_k^5 and all a_i are positive integers less than n.

Original entry on oeis.org

32, 26, 19, 18, 14, 12, 9, 11, 9, 13, 6, 12, 8, 10, 9, 8, 10, 10, 9, 10, 10, 7, 6, 9, 7, 9, 8, 9, 6, 9, 6, 8, 7, 7, 6, 8, 7, 8, 7, 7, 7, 9, 8, 9, 7, 8, 6, 7, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 7, 7, 7, 6, 8, 8, 6, 7, 7, 7, 7, 5, 7, 7, 7, 7, 8, 6, 7, 7, 7, 7, 7, 6, 7, 7, 7, 7, 7, 6, 7, 7, 7, 5, 7, 6, 7, 7, 6, 7
Offset: 2

Views

Author

Dmitry Kamenetsky, Jun 21 2009

Keywords

Comments

Based on Fermat's Last Theorem: 2 never occurs in this sequence. It is not known whether 3 occurs in this sequence. The first time 4 occurs is for 144^5=27^5+84^5+110^5+133^5.
The first time 5, 6, 7, 8, 9, 10 occur is for n=73, 12, 23, 14, 8, 15; see sequence A252485. - M. F. Hasler, Dec 17 2014

Examples

			a(29) = 9 since 29^5 = 5^5 + 9^5 + 10^5 + 10^5 + 10^5 + 15^5 + 15^5 + 17^5 + 28^5, and there is no sum of less than 9 fifth powers equal to 26^5;
a(30) = 6 since 30^5 = 5^5 + 10^5 + 11^5 + 16^5 + 19^5 + 29^5;
a(72) = 5 since 72^5 = 19^5 + 43^5 + 46^5 + 47^5 + 67^5. - _M. F. Hasler_, Dec 17 2014
		

Crossrefs

Programs

  • PARI
    a(n,verbose=0,m=5)={N=n^m;for(k=3,32,forvec(v=vector(k-1,i,[1,n\sqrtn(k+1-i,m)]),ispower(N-sum(i=1,k-1,v[i]^m),m,&K)&&K>0&&!(verbose&&print1("/*"n" "v"*/"))&&return(k),1))} \\ M. F. Hasler, Dec 17 2014
    
  • PARI
    a(n)={
        my(N=n^5,k=3);
        while(1,
            my(v=vector(k-1,i,[sqrtnint(max((N-(k-i)*(n-1)^5-1)\i,0),5)+1,sqrtnint((N-i+1)\(k-i+1),5)]));
            forvec(x=v,
                my(s=N-sum(i=1,#x,x[i]^5));
                if(s>0 && ispower(s,5), return(k))
            ,
                1
            );
            k++
        );
    }; \\ Charles R Greathouse IV, Dec 18 2014

Extensions

a(43)-a(83) from M. F. Hasler, Dec 17 2014
a(77) corrected by Charles R Greathouse IV, Dec 19 2014
a(84)-a(100) from Charles R Greathouse IV, Dec 19 2014

A161882 Smallest k such that n^2 = a_1^2 + ... + a_k^2 and all a_i are positive integers less than n.

Original entry on oeis.org

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

Views

Author

Dmitry Kamenetsky, Jun 21 2009

Keywords

Comments

Related to hypotenuse numbers: A161882(A009003(n))=2 for all n.
Jacobi's four-square theorem can be used to show that a(n) <= 4. - Charles R Greathouse IV, Jul 31 2011

Examples

			2^2 = 1^2 + 1^2 + 1^2 + 1^2, so a(2)=4.
3^2 = 2^2 + 2^2 + 1^2, so a(3)=3.
		

Crossrefs

Programs

  • Mathematica
    f[n_, k_] := Select[PowersRepresentations[n^2, k, 2], AllTrue[#, 0<#Jean-François Alcover, Oct 03 2020 *)
  • PARI
    A161882(n)={vecmin(factor(n)[,1]%4)==1 && return(2);  if(n==1<M. F. Hasler, Dec 17 2014

Formula

a(n)=2 iff n is in A009003 (hypotenuse numbers), a(n)=4 iff n is in A000079 (powers of 2), otherwise a(n)=3. - M. F. Hasler, Dec 17 2014

Extensions

More terms from Alois P. Heinz, Dec 04 2014

A161884 Smallest k such that n^4 = a_1^4+...+a_k^4 and all a_i are positive integers less than n.

Original entry on oeis.org

16, 6, 16, 5, 6, 6, 16, 6, 5, 7, 6, 6, 6, 5, 16, 6, 6, 6, 5, 6, 7, 6, 6, 5, 6, 6, 6, 6, 5, 5, 16, 6, 6, 5, 6, 6, 6, 6, 5, 6, 6, 6, 7, 5, 6, 6, 6, 6, 5, 6, 6, 6, 6, 5, 6, 6, 6, 6, 5, 6, 5, 6, 16, 5, 6, 6, 6, 6, 5, 6, 6, 6, 6, 5, 6, 6, 6, 6, 5, 6, 6, 6, 6, 5, 6
Offset: 2

Views

Author

Dmitry Kamenetsky, Jun 21 2009

Keywords

Comments

It follows from Balasubramanian, Deshouillers, & Dress' result g(4) = 19 that a(n) <= 20. Deshouillers, Hennecart, & Landreau and Deshouillers, Kawada, & Wooley together give an effective proof that G(4) = 16, from which it can be determined by checking the 96 exceptions that a(n) <= 17. Probably a(n) <= 16. [Charles R Greathouse IV, Jul 31 2011]

References

  • J.-M. Deshouillers, K. Kawada, and T. D. Wooley, "On sums of sixteen biquadrates", Mem. Soc. Math. Fr. 100 (2005), 120 pp.

Crossrefs

Programs

  • PARI
    a(n, verbose=0, m=4)={N=n^m; for(k=3, 99, forvec(v=vector(k-1, i, [1, n\sqrtn((k+1-i)*0.99999, m)]), ispower(N-sum(i=1, k-1, v[i]^m), m, &K)&&K>0&&!if(verbose,print1("/*"n" "v"*/"))&&return(k), 1))} \\ M. F. Hasler, Dec 17 2014

Extensions

a(51)-a(63) from M. F. Hasler, Dec 17 2014
a(64)-a(86) from Giovanni Resta, Aug 17 2015

A252486 Smallest k such that n^6 = a_1^6+...+a_k^6 where all the a_i are positive integers less than n.

Original entry on oeis.org

64, 36, 15, 29, 22, 21, 15, 19, 15, 17, 15, 16, 14, 15, 13, 12, 11, 11, 13, 14, 12, 13, 13, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 13, 11, 11, 11, 10, 11, 11, 11, 11, 11, 10, 11, 11, 11, 11, 11, 11, 11, 11, 9, 11, 10, 11, 11, 11, 9, 10, 11, 11, 11, 11, 10
Offset: 2

Views

Author

M. F. Hasler, Dec 17 2014

Keywords

Comments

Inspired by Fermat's Last Theorem: 2 never occurs in this sequence.
No n is known for which a(n)<7, according to the MathWorld page. The values 7, 8, 9, 10 and 11 occur first at indices 1141, 251, 54, 39, 18, cf. sequence A252476.
I conjecture that the sequence is bounded by the initial term. Probably even a(3)=36, a(5)=29, a(6)=22 and some more are followed only by smaller terms.
From results on Waring's problem, it is known that all a(n) <= A002804(6) = 73, and a(n) <= 24 for all sufficiently large n. - Robert Israel, Aug 17 2015

Crossrefs

Programs

  • Maple
    M:= 10^8:
    R:= Vector(M, 74, datatype=integer[4]):
    for p from 1 to floor(M^(1/6)) do
      p6:= p^6;
      if p > 1 then A[p]:= R[p6] fi;
      R[p6]:= 1;
      for j from p6+1 to M do
        R[j]:= min(R[j], 1+R[j - p6]);
      od
    od:
    F:= proc(n, k, ub)
       local lb, m, bestyet, res;
       if ub <= 0 then return -1 fi;
       if n <= M then
         if n = 0 then return 0
         elif R[n] > ub then return -1
         else return R[n]
         fi
       fi;
       lb:= floor(n/k^6);
       if lb > ub then return -1 fi;
       bestyet:= ub;
       for m from lb to 0 by -1 do
         res:= procname(n-m*k^6, k-1, bestyet-m);
         if res >= 0 then
           bestyet:= res+m;
         fi
       od:
       return bestyet
    end proc:
    for n from floor(M^(1/6))+1 to 50 do
       A[n]:= F(n^6, n-1, 73)
    od:
    seq(A[n], n=2..50); # Robert Israel, Aug 17 2015
  • Mathematica
    a[n_] := Module[{k}, For[k = 7, True, k++, If[IntegerPartitions[n^6, {k}, Range[n-1]^6] != {}, Print[n, " ", k]; Return[k]]]];
    Table[a[n], {n, 2, 100}] (* Jean-François Alcover, Jul 29 2023 *)
  • PARI
    a(n,verbose=0,m=6)={N=n^m;for(k=3,64,forvec(v=vector(k-1,i,[1,n\sqrtn(k+1-i,m)]),ispower(N-sum(i=1,k-1,v[i]^m),m,&K)&&K>0&&!(verbose&&print1("/*"n" "v"*/"))&&return(k),1))}
    
  • Python
    from itertools import count
    from sympy.solvers.diophantine.diophantine import power_representation
    def A252486(n):
        m = n**6
        for k in count(2):
            try:
                next(power_representation(m,6,k))
            except:
                continue
            return k # Chai Wah Wu, Jun 25 2024

Extensions

More terms from Manfred Scheucher, Aug 15 2015
a(53)-a(66) from Giovanni Resta, Aug 17 2015

A252487 Smallest k such that n^7 = a_1^7 + ... + a_k^7 and all a_i are positive integers less than n.

Original entry on oeis.org

128, 28, 66, 39, 28, 26, 21, 20, 18, 22, 22, 22, 20, 21, 14, 17, 14, 14, 17, 16, 17, 14, 16, 13, 15, 13, 12, 15, 13, 15, 13, 14, 13, 14, 13, 13, 14, 12, 12, 12, 13, 12, 12, 12, 11, 13, 13, 12, 12, 13, 12, 12, 11, 12, 11, 11, 12, 12, 11, 12, 9, 12, 11, 11, 11
Offset: 2

Views

Author

M. F. Hasler, Dec 17 2014

Keywords

Comments

Inspired by Fermat's Last Theorem: 2 never occurs in this sequence.
No n is known for which a(n)<7, according to the MathWorld page. The values 7, 8, 9, ... occur first at indices 568, 102, 62, ...
I conjecture that the sequence is bounded by the initial term a(2)=128. Probably even a(4)=66, a(5)=39, a(6)=28 and some more are followed only by smaller terms.
I've uploaded two scripts; one to compute the b-file and one to generate an IP file. For the first script, a parameter kmax can be set to gain a speedup but more memory is used. The other one (which also works with large integers now) should be used in case someone has a good IP-solver. Higher terms might be computable faster with a good IP solver. - Manfred Scheucher, Aug 14 2015
From results on Waring's problem, it is known that all a(n) <= A002804(7) = 143, and a(n) <= 33 for all sufficiently large n. - Robert Israel, Aug 16 2015

Crossrefs

Programs

  • Maple
    M:= 10^8:
    R:= Vector(M,144, datatype=integer[4]):
    for p from 1 to floor(M^(1/7)) do
      p7:= p^7;
      if p > 1 then A[p]:= R[p7] fi;
      R[p7]:= 1;
      for j from p7+1 to M do
        R[j]:= min(R[j],1+R[j - p7]);
      od
    od:
    F:= proc(n,k,ub)
       local lb, m, bestyet, res;
       if ub <= 0 then return -1 fi;
       if n <= M then
         if n = 0 then return 0
         elif R[n] > ub then return -1
         else return R[n]
         fi
       fi;
       lb:= floor(n/k^7);
       if lb > ub then return -1 fi;
       bestyet:= ub;
       for m from lb to 0 by -1 do
         res:= procname(n-m*k^7, k-1, bestyet-m);
         if res >= 0 then
           bestyet:= res+m;
         fi
       od:
       return bestyet
    end proc:
    for n from floor(M^(1/7))+1 to 50 do
       A[n]:= F(n^7,n-1,144)
    od:
    seq(A[n],n=2..50); # Robert Israel, Aug 17 2015
  • PARI
    a(n,verbose=0,m=7)={N=n^m;for(k=3,999,forvec(v=vector(k-1,i,[1,n\sqrtn(k+1-i,m)]),ispower(N-sum(i=1,k-1,v[i]^m),m,&K)&&K>0&&!(verbose&&print1("/*"n" "v"*/"))&&return(k),1))}

Extensions

More terms from Manfred Scheucher, Aug 15 2015
a(50)-a(66) from Giovanni Resta, Aug 17 2015
Showing 1-5 of 5 results.