A367116 a(0) = 1; for n >= 1, a(n) is the largest number m = Product_{j=1..k} (b(j)-1) where {b(1), ..., b(k)} is a vector of positive integers such that Sum_{i=1..k} b(i)^2 = n.
1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 0, 1, 2, 0, 0, 3, 2, 4, 0, 3, 2, 4, 0, 3, 6, 4, 8, 3, 6, 4, 8, 9, 6, 12, 8, 16, 6, 12, 8, 16, 18, 12, 24, 16, 32, 12, 24, 27, 32, 36, 24, 48, 32, 64, 24, 48, 54, 64, 72, 48, 96, 64, 128, 81, 96, 108, 128, 144, 96, 192, 128, 256
Offset: 0
Keywords
Examples
For n = 23, it's impossible to write 23 as the sum of positive squares other than 1, so a(23) = 0; For n = 69, a(69) = max{0, a(65), 2*a(60), 3*a(53), 4*a(44), 5*a(33), 6*a(20), 7*a(5)} = 2*a(60) = 256.
Links
- Yifan Xie, Table of n, a(n) for n = 0..1000
Programs
-
Mathematica
a[nn_] := Module[{v},v = {1};For[n = 2, n <= nn, n++,Module [{i=1,t=0},While[i^2
James C. McMahon, Dec 17 2023 From PARI *) -
PARI
lista(nn) = {my(v = vector(nn+1)); v[1] = 1; for(n=2, nn+1, my(i=1, t=0); for(i=1, sqrtint(n-1), t=max(t, (i-1)*v[n-i*i])); v[n] = t); v;}
Formula
a(n) = Max_{i^2 <= n} (i-1)*a(n^2-i).
Let n = 4*k + r, 0 <= r <= 3. a(n) = max{2^(4*ceiling((k - 2*r)/9) + r)*3^(ceiling((k - 2*r - 9*ceiling((k - 2*r)/9))/4)), 2^(4*(ceiling((k - 2*r)/9) - 1) + r)*3^(ceiling((k - 2*r - 9*ceiling((k - 2*r)/9 - 1))/4))}
Comments