|
|
A078359
|
|
Number of ways to write n as sum of a positive square and a positive cube.
|
|
5
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,17
|
|
COMMENTS
|
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
|
|
LINKS
|
|
|
FORMULA
|
G.f.: (Sum_{k>=1} x^(k^2)) * (Sum_{k>=1} x^(k^3)). - Seiichi Manyama, Jun 17 2023
|
|
EXAMPLE
|
a(1025)=4, as 1025 = 5^2 + 10^3 = 30^2 + 5^3 = 31^2 + 4^3 = 32^2 + 1^3.
|
|
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]];
|
|
PROG
|
(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)]
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|