login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A215537 Lowest k such that k is representable as both the sum of n and of n+1 nonzero squares. 1
25, 17, 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, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
25 = 5^2 = 3^2 + 4^2
17 = 4^2 + 1^2 = 3^2 + 2^2 + 2^2
12 = 2^2 + 2^2 + 2^2 = 3^2 + 1^2 + 1^2 + 1^2
after this just add 1^2 to both sides.
MAPLE
# true if a is representable as a sum of n squares, each square >= m^2.
isRepnSqrsMin := proc(a, n, m)
local mpr ;
if a < n*m^2 then
return false;
end if;
if n = 1 then
if a>= m^2 and issqr(a) then
true;
else
false;
end if;
else
for mpr from m to a do
if a-mpr^2 < 1 then
return false;
elif procname(a-mpr^2, n-1, mpr) then
return true;
end if;
end do:
end if;
end proc:
# true if a is representable as a sum of n positive squares.
isRepnSqrs := proc(a, n)
isRepnSqrsMin(a, n, 1) ;
end proc:
A215537 := proc(n)
local k;
for k from 1 do
if isRepnSqrs(k, n) and isRepnSqrs(k, n+1) then
return k;
end if;
end do:
end proc: # R. J. Mathar, Sep 11 2012
CROSSREFS
Cf. A000290 (representable as sum of 1 square), A000404 (sum of 2 positive squares), A000408 (sum of 3 positive squares), A000414 (sum of 4 positive squares), A047700 (sum of 5 positive squares)
Sequence in context: A040602 A281335 A028937 * A104790 A291429 A334562
KEYWORD
nonn
AUTHOR
Jon Perry, Aug 15 2012
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 15:11 EDT 2024. Contains 371794 sequences. (Running on oeis4.)