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.

A229062 1 if n is representable as sum of two nonnegative squares, otherwise 0.

This page as a plain text file.
%I A229062 #47 Jan 26 2024 14:28:10
%S A229062 1,1,1,0,1,1,0,0,1,1,1,0,0,1,0,0,1,1,1,0,1,0,0,0,0,1,1,0,0,1,0,0,1,0,
%T A229062 1,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1,1,0,1,1,0,0,0,0,1,0,0,1,0,0,1,1,0,0,
%U A229062 1,0,0,0,1,1,1,0,0,0,0,0,1,1,1,0,0,1,0,0,0,1,1,0,0,0,0,0,0,1,1,0,1,1,0,0,1,0,1,0,0,1,0,0,0,1
%N A229062 1 if n is representable as sum of two nonnegative squares, otherwise 0.
%C A229062 Characteristic function of A001481.
%C A229062 a(n) = 1 if A000161(n) > 0.
%C A229062 a(A022544(n)) = 0.
%C A229062 Multiplicative because A002654 is. - _Andrew Howroyd_, Aug 01 2018
%C A229062 For positive n, m = 2*a(n) + 1 is the smallest positive integer such that m * n is not a sum of two squares. - _Peter Schorn_, Dec 29 2023
%H A229062 Antti Karttunen, <a href="/A229062/b229062.txt">Table of n, a(n) for n = 0..65537</a>
%H A229062 <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>
%F A229062 a(n) = min{1, A004018(n)}. - _N. J. A. Sloane_, Jan 11 2020
%t A229062 Join[{1},Table[If[SquaresR[2,n]>1,1,0],{n,120}]] (* _Harvey P. Dale_, Aug 25 2017 *)
%o A229062 (PARI) a(n)=my(f=0); my(r=sqrtint(n)); forstep(i=r, 1, -1, if(issquare(n-i*i), f=1; break)); f
%o A229062 (PARI) a(n)=if(0==n,1,(sumdiv(n, d,(d%4==1) - (d%4==3)) > 0)); \\ _Andrew Howroyd_, Aug 01 2018, the check for 0-argument added by _Antti Karttunen_, Apr 22 2022
%o A229062 (Python)
%o A229062 from sympy import factorint
%o A229062 def A229062(n): return int(all(p & 3 != 3 or e & 1 == 0 for p, e in factorint(n).items())) # _Chai Wah Wu_, Jun 28 2022
%Y A229062 Cf. A002654, A004018, A070176. Partial sums are in A102548.
%Y A229062 Cf. A000161, A022544.
%K A229062 nonn,mult
%O A229062 0,1
%A A229062 _Ralf Stephan_, Sep 17 2013