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!)
A255131 n minus the least number of squares that add up to n: a(n) = n - A002828(n). 22
0, 0, 0, 0, 3, 3, 3, 3, 6, 8, 8, 8, 9, 11, 11, 11, 15, 15, 16, 16, 18, 18, 19, 19, 21, 24, 24, 24, 24, 27, 27, 27, 30, 30, 32, 32, 35, 35, 35, 35, 38, 39, 39, 40, 41, 43, 43, 43, 45, 48, 48, 48, 50, 51, 51, 51, 53, 54, 56, 56, 56, 59, 59, 59, 63, 63, 63, 64, 66, 66, 67, 67, 70, 71, 72, 72, 73, 74, 75, 75, 78, 80, 80, 80, 81 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,5
COMMENTS
The associated beanstalk-sequence starts from a(0) as: 0, 3, 6, 8, 11, 15, 16, 18, 21, ... (A276573).
LINKS
FORMULA
a(n) = n - A002828(n).
a(n) = A260740(n) + A062535(n).
EXAMPLE
a(0) = 0, because no squares are needed for an empty sum, and 0 - 0 = 0.
a(3) = 0, because 3 cannot be represented as a sum of less than three squares (1+1+1), and 3 - 3 = 0.
a(4) = 3, because 4 can be represented as a sum of just one square (namely 4 itself), and 4 - 1 = 3.
MAPLE
f:= proc(n) local F, x;
if issqr(n) then return n-1 fi;
if nops(select(t -> t[1] mod 4 = 3 and t[2]::odd, ifactors(n)[2])) = 0 then return n-2 fi;
x:= n/4^floor(padic:-ordp(n, 2)/2);
if x mod 8 = 7 then n-4 else n-3 fi
end proc:
f(0):= 0:
map(f, [$0..100]); # Robert Israel, Mar 27 2018
MATHEMATICA
{0}~Join~Table[n - (If[First@ # > 0, 1, Length[First@ Split@ #] + 1] &@ SquaresR[Range@ 4, n]), {n, 84}] (* Michael De Vlieger, Sep 08 2016, after Harvey P. Dale at A002828 *)
CROSSREFS
Subsequence: A005563.
Cf. also A011371, A236840, A260740.
Sequence in context: A142716 A211515 A260740 * A280453 A289903 A285047
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 24 2015
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 March 19 04:26 EDT 2024. Contains 370952 sequences. (Running on oeis4.)