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.
%I A231016 #23 Aug 13 2025 22:08:24 %S A231016 0,8,9,16,18,25,31,32,33,34,39,40,41,42,43,46,48,50,52,54,58,61,67,69, %T A231016 74,75,77,79,80,82,84,85,87,88,90,93,95,96,97,99,101,103,104,105,107, %U A231016 110,111,113,115,116,117,118,121,123,127,129,131,133,135,137,141 %N A231016 Numbers m with non-unique solution to m = +- 1^2 +- 2^2 +- ... +- k^2 with minimal k giving at least one solution. %C A231016 The minimal k = A231015(m). %C A231016 Complement of A231272. %H A231016 Alois P. Heinz, <a href="/A231016/b231016.txt">Table of n, a(n) for n = 1..10000</a> %H A231016 Andrica, D., Vacaretu, D., <a href="http://www.cs.ubbcluj.ro/~studia-m/2006-4/andrica.pdf">Representation theorems and almost unimodal sequences</a>, Studia Univ. Babes-Bolyai, Mathematica, Vol. LI, 4 (2006), 23-33. %F A231016 { n : A231071(n) > 1 }. %e A231016 0 = 1 + 4 - 9 + 16 - 25 - 36 + 49 = sum with signs reversed, so 0 is a member. %e A231016 9 = - 1 - 4 + 9 + 16 + 25 - 36 = 1 + 4 + 9 - 16 - 25 + 36, so 9 is a member. %e A231016 A000330(k) = k(k+1)(2k+1)/6 = 1^2 + 2^2 + ... + k^2 is not a member, for k > 0. %p A231016 b:= proc(n, i) option remember; local m, t; m:= (1+(3+2*i)*i)*i/6; %p A231016 if n>m then 0 elif n=m then 1 else %p A231016 t:= b(abs(n-i^2), i-1); %p A231016 if t>1 then return 2 fi; %p A231016 t:= t+b(n+i^2, i-1); `if`(t>1, 2, t) %p A231016 fi %p A231016 end: %p A231016 a:= proc(n) option remember; local m, k; %p A231016 for m from 1+ `if`(n=1, -1, a(n-1)) do %p A231016 for k while b(m, k)=0 do od; %p A231016 if b(m, k)>1 then return m fi %p A231016 od %p A231016 end: %p A231016 seq(a(n), n=1..80); # _Alois P. Heinz_, Nov 06 2013 %t A231016 b[n_, i_] := b[n, i] = Module[{m, t}, m = (1+(3+2*i)*i)*i/6; Which[n>m, 0, n == m, 1, True, t = b[Abs[n-i^2], i-1]; If[t>1, Return[2]]; t = t + b[n+i^2, i-1]; If[t>1, 2, t]]]; a[n_] := a[n] = Module[{m, k}, For[m = 1 + If[n == 1, -1, a[n-1]], True, m++, For[k = 1, b[m, k] == 0, k++]; If[b[m, k]>1, Return[m]]]]; Table[a[n], {n, 1, 80}] (* _Jean-François Alcover_, Jan 28 2014, after _Alois P. Heinz_ *) %Y A231016 Cf. A000330, A231015, A231071, A231272. %K A231016 nonn %O A231016 1,2 %A A231016 _Jonathan Sondow_, Nov 06 2013