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 A257587 #28 Mar 11 2024 04:42:54 %S A257587 0,1,4,9,16,25,36,49,64,81,1,0,-3,-8,-15,-24,-35,-48,-63,-80,4,3,0,-5, %T A257587 -12,-21,-32,-45,-60,-77,9,8,5,0,-7,-16,-27,-40,-55,-72,16,15,12,7,0, %U A257587 -9,-20,-33,-48,-65,25,24,21,16,9,0,-11,-24,-39,-56,36,35,32 %N A257587 If n = abcd... in decimal, a(n) = a^2 - b^2 + c^2 - d^2 + ... %H A257587 Michel Marcus, <a href="/A257587/b257587.txt">Table of n, a(n) for n = 0..10000</a> %F A257587 a(A352535(n)) = 0. - _Bernard Schott_, Jul 12 2022 %t A257587 A257587[n_] := Total[-(-1)^Range[Max[IntegerLength[n], 1]]*IntegerDigits[n]^2]; %t A257587 Array[A257587, 100, 0] (* _Paolo Xausa_, Mar 11 2024 *) %o A257587 (Python) %o A257587 def a(n): return sum(int(d)**2*(-1)**i for i, d in enumerate(str(n))) %o A257587 print([a(n) for n in range(63)]) # _Michael S. Branicky_, Jul 11 2022 %o A257587 (PARI) a(n) = my(d=digits(n)); sum(k=1, #d, (-1)^(k+1)*d[k]^2); \\ _Michel Marcus_, Jul 12 2022 %Y A257587 First 100 terms coincide with those of A177894, but then they diverge. %Y A257587 Cf. A257588, A257796, A352535 (indices of zeros). %K A257587 sign,base %O A257587 0,3 %A A257587 _N. J. A. Sloane_, May 10 2015