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 A072401 #35 May 15 2025 00:50:04 %S A072401 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0, %T A072401 0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,0, %U A072401 0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,1,0 %N A072401 1 iff n is of the form 4^m*(8k+7). %C A072401 Characteristic function of A004215, indicating numbers not the sum of 3 integer squares. %C A072401 a(n) + 1 is the smallest positive number such that (a(n) + 1) * n is the sum of three squares. - _Peter Schorn_, Jul 18 2023 %H A072401 Jean-Paul Allouche and Jeffrey Shallit, <a href="https://doi.org/10.1016/0304-3975(92)90001-V">The ring of k-regular sequences</a>, Theoretical Computer Sci., 98 (1992), 163-197; <a href="http://www.cs.uwaterloo.ca/~shallit/Papers/as0.ps">preprint</a>. See Example 20. %H A072401 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/SquareNumber.html">Square Numbers</a>. %H A072401 <a href="/index/Su#ssq">Index entries for sequences related to sums of squares</a>. %H A072401 <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>. %F A072401 a(n) = 1 - A057427(7 - A072400(n)). %F A072401 a(A004215(k)) = 1 for k>0. %F A072401 a(n) = A057427(A064873(n)). %F A072401 For n<112: a(n) = A064873(n), but A064873(112) = 2, as also a(112 - 1) = 1. %F A072401 Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 1/6. - _Amiram Eldar_, May 15 2025 %t A072401 A072400[n_] := Mod[If[Mod[n, 4] == 0, n/4^IntegerExponent[n, 4], n], 8]; %t A072401 a[n_] := 1 - Sign[7 - A072400[n]]; %t A072401 Table[a[n], {n, 0, 96}] (* _Jean-François Alcover_, Dec 13 2021 *) %o A072401 (Python) %o A072401 def A072401(n): return ((m:=(~n&n-1).bit_length())&1^1)&int((n>>m)&7==7) # _Chai Wah Wu_, Aug 01 2023 %o A072401 (PARI) a(n) = if(n, (n >> (2*valuation(n, 4))) % 8 == 7, 0); \\ _Amiram Eldar_, May 15 2025 %Y A072401 Cf. A004215, A057427, A064873, A072400. %Y A072401 Cf. A071374. %K A072401 nonn,easy %O A072401 0,1 %A A072401 _Reinhard Zumkeller_, Jun 16 2002