login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A072401
1 iff n is of the form 4^m*(8k+7).
11
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, 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, 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
OFFSET
0,1
COMMENTS
Characteristic function of A004215, indicating numbers not the sum of 3 integer squares.
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
LINKS
J.-P. Allouche and J. Shallit, The ring of k-regular sequences, Theoretical Computer Sci., 98 (1992), 163-197; preprint. See Example 20.
Eric Weisstein's World of Mathematics, Square Numbers.
FORMULA
a(n) = 1 - A057427(7 - A072400(n)).
a(A004215(k)) = 1 for k>0.
a(n) = A057427(A064873(n)).
For n<112: a(n)=A064873(n), but A064873(112)=2, as also a(112 - 1) = 1.
MATHEMATICA
A072400[n_] := Mod[If[Mod[n, 4] == 0, n/4^IntegerExponent[n, 4], n], 8];
a[n_] := 1 - Sign[7 - A072400[n]];
Table[a[n], {n, 0, 96}] (* Jean-François Alcover, Dec 13 2021 *)
PROG
(Python)
def A072401(n): return ((m:=(~n&n-1).bit_length())&1^1)&int((n>>m)&7==7) # Chai Wah Wu, Aug 01 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jun 16 2002
STATUS
approved