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-3 of 3 results.

A055394 Numbers that are the sum of a positive square and a positive cube.

Original entry on oeis.org

2, 5, 9, 10, 12, 17, 24, 26, 28, 31, 33, 36, 37, 43, 44, 50, 52, 57, 63, 65, 68, 72, 73, 76, 80, 82, 89, 91, 100, 101, 108, 113, 122, 126, 127, 128, 129, 134, 141, 145, 148, 150, 152, 161, 164, 170, 171, 174, 177, 185, 189, 196, 197, 204, 206, 208, 217, 220, 223
Offset: 1

Views

Author

Henry Bottomley, May 12 2000

Keywords

Comments

This sequence was the subject of a question in the German mathematics competition Bundeswettbewerb Mathematik 2017 (see links). The second round contained a question A4 which asks readers to "Show that there are an infinite number of a such that a-1, a, and a+1 are members of A055394". - N. J. A. Sloane, Jul 04 2017 and Oct 14 2017
This sequence was also the subject of a question in the 22nd All-Russian Mathematical Olympiad 1996 (see link). The 1st question of the final round for Grade 9 asked competitors "What numbers are more frequent among the integers from 1 to 1000000: those that can be written as a sum of a square and a positive cube, or those that cannot be?" Answer is that there are more numbers not of this form. - Bernard Schott, Feb 18 2022

Examples

			a(5)=17 since 17=3^2+2^3.
		

Crossrefs

Cf. A022549, A055393, A078360. Complement of A066650.

Programs

  • Maple
    isA055394 := proc(n)
        local a,b;
        for b from 1 do
            if b^3 >= n then
                return false;
            end if;
            asqr := n-b^3 ;
            if asqr >= 0 and issqr(asqr) then
                return true;
            end if;
        end do:
        return;
    end proc:
    for n from 1 to 1000 do
        if isA055394(n) then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, Dec 03 2015
  • Mathematica
    r[n_, y_] := Reduce[x > 0 && n == x^2 + y^3, x, Integers]; ok[n_] := Catch[Do[If[r[n, y] =!= False, Throw[True]], {y, 1, Ceiling[n^(1/3)]}]] == True; Select[Range[300], ok] (* Jean-François Alcover, Jul 16 2012 *)
    solQ[n_] := Length[Reduce[p^2 + q^3 == n && p > 0 && q > 0, {p, q}, Integers]] > 0; Select[Range[224], solQ] (* Jayanta Basu, Jul 11 2013 *)
    isQ[n_] := For[k = 1, k <= (n-1)^(1/3), k++, If[IntegerQ[Sqrt[n-k^3]], Return[True]]; False];
    Select[Range[1000], isQ] (* Jean-François Alcover, Apr 06 2021, after Charles R Greathouse IV *)
  • PARI
    list(lim)=my(v=List()); for(n=1,sqrtint(lim\1-1), for(m=1,sqrtnint(lim\1-n^2,3), listput(v,n^2+m^3))); Set(v) \\ Charles R Greathouse IV, May 15 2015
    
  • PARI
    is(n)=for(k=1,sqrtnint(n-1,3), if(issquare(n-k^3), return(1))); 0 \\ Charles R Greathouse IV, May 15 2015

Formula

a(n) >> n^(6/5). - Charles R Greathouse IV, May 15 2015

A078359 Number of ways to write n as sum of a positive square and a positive cube.

Original entry on oeis.org

0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 25 2002

Keywords

Comments

a(A066650(n))=0, a(A055394(n))>0, a(A078360(n))=1, a(A054402(n))>1.
Earliest entries with a(n)=3 are n=1737, 2089, 2628, 2817. Earliest entries with a(n)=4 are n=1025, 19225, 27289, 29025, 39329, 48025, 54225. Earliest entries with a(n)=5 are n=92025, 540900, 567225, 747225. There are no a(n)>=6 in the range n=1..700000. - R. J. Mathar, Aug 16 2006
a(3375900) = 6 and a(5472225) = 7 are the first entries with those values. - Robert Israel, Jun 25 2024, [but see A060835. - Hugo Pfoertner, Jun 26 2024]

Examples

			a(1025)=4, as 1025 = 5^2 + 10^3 = 30^2 + 5^3 = 31^2 + 4^3 = 32^2 + 1^3.
		

Crossrefs

Programs

  • Maple
    interface(prettyprint=0) : A078359 := proc(n) local resul,isq,icu ; resul := 0 ; icu := 1 ; while icu^3 < n do if issqr(n-icu^3) then resul := resul+1 ; fi ; icu := icu+1 ; od ; RETURN(resul) ; end: for n from 1 to 100000 do printf("%d %d ",n,A078359(n)) ; od ; # R. J. Mathar, Aug 16 2006
  • Mathematica
    a[n_] := Which[r = Reduce[x > 0 && y > 0 && n == x^2 + y^3, {x, y}, Integers]; r === False, 0, r[[0]] === And, 1, r[[0]] === Or, Length[r], True, Print["error: ", r]];
    Table[a[n], {n, 1, 105}] (* Jean-François Alcover, Feb 13 2018 *)
  • Python
    from collections import Counter
    from itertools import count, takewhile, product
    def aupto(lim):
      sqs = list(takewhile(lambda x: x<=lim-1, (i**2 for i in count(1))))
      cbs = list(takewhile(lambda x: x<=lim-1, (i**3 for i in count(1))))
      cts = Counter(sum(p) for p in product(sqs, cbs))
      return [cts[i] for i in range(1, lim+1)]
    print(aupto(105)) # Michael S. Branicky, May 29 2021

Formula

G.f.: (Sum_{k>=1} x^(k^2)) * (Sum_{k>=1} x^(k^3)). - Seiichi Manyama, Jun 17 2023

A273530 Numbers n such that n is the sum of two nonzero squares in exactly one way, n+1 is the sum of a positive square and a positive cube in exactly one way and n+2 is the sum of 2 positive cubes in exactly one way.

Original entry on oeis.org

349, 853, 12634, 42937, 51741, 59912, 97677, 169748, 195137, 199528, 231892, 269728, 337768, 343636, 392272, 403037, 599561, 920456, 1458538, 1521873, 1645873, 1894121, 2337928, 2388697, 3131728, 3159673, 3186349, 3731769, 3835024, 3890248, 4037794
Offset: 1

Views

Author

Altug Alkan, May 24 2016

Keywords

Examples

			349 is a term because 349 = 5^2 + 18^2, 350 = 15^2 + 5^3, 351 = 2^3 + 7^3.
		

Crossrefs

Showing 1-3 of 3 results.