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.

A255131 n minus the least number of squares that add up to n: a(n) = n - A002828(n).

This page as a plain text file.
%I A255131 #27 Dec 23 2024 14:53:44
%S A255131 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,
%T A255131 24,24,27,27,27,30,30,32,32,35,35,35,35,38,39,39,40,41,43,43,43,45,48,
%U A255131 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
%N A255131 n minus the least number of squares that add up to n: a(n) = n - A002828(n).
%C A255131 The associated beanstalk-sequence starts from a(0) as: 0, 3, 6, 8, 11, 15, 16, 18, 21, ... (A276573).
%H A255131 Robert Israel, <a href="/A255131/b255131.txt">Table of n, a(n) for n = 0..10000</a>
%H A255131 <a href="https://web.archive.org/web/*/http://list.seqfan.eu/oldermail/seqfan/2013-August/011588.html">Discussion on the SeqFan mailing list</a>
%F A255131 a(n) = n - A002828(n).
%F A255131 a(n) = A260740(n) + A062535(n).
%e A255131 a(0) = 0, because no squares are needed for an empty sum, and 0 - 0 = 0.
%e A255131 a(3) = 0, because 3 cannot be represented as a sum of less than three squares (1+1+1), and 3 - 3 = 0.
%e A255131 a(4) = 3, because 4 can be represented as a sum of just one square (namely 4 itself), and 4 - 1 = 3.
%p A255131 f:= proc(n) local F, x;
%p A255131    if issqr(n) then return n-1 fi;
%p A255131    if nops(select(t -> t[1] mod 4 = 3 and t[2]::odd, ifactors(n)[2])) = 0 then return n-2 fi;
%p A255131    x:= n/4^floor(padic:-ordp(n, 2)/2);
%p A255131    if x mod 8 = 7 then n-4 else n-3 fi
%p A255131 end proc:
%p A255131 f(0):= 0:
%p A255131 map(f, [$0..100]); # _Robert Israel_, Mar 27 2018
%t A255131 {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 *)
%Y A255131 Subsequence: A005563.
%Y A255131 Cf. A000290, A002828, A062535, A260731, A260732, A260733, A260734, A262689, A276573.
%Y A255131 Cf. also A011371, A236840, A260740.
%K A255131 nonn
%O A255131 0,5
%A A255131 _Antti Karttunen_, Feb 24 2015