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.

A020893 Squarefree sums of two squares; or squarefree numbers with no prime factors of the form 4k+3.

This page as a plain text file.
%I A020893 #64 Jun 29 2022 01:52:17
%S A020893 1,2,5,10,13,17,26,29,34,37,41,53,58,61,65,73,74,82,85,89,97,101,106,
%T A020893 109,113,122,130,137,145,146,149,157,170,173,178,181,185,193,194,197,
%U A020893 202,205,218,221,226,229,233,241,257,265,269,274,277,281,290,293,298,305,313,314,317,337,346,349
%N A020893 Squarefree sums of two squares; or squarefree numbers with no prime factors of the form 4k+3.
%C A020893 Primitively but not imprimitively represented by x^2 + y^2.
%C A020893 The disjoint union of {1}, A003654, and A031398. - _Max Alekseyev_, Mar 09 2010
%C A020893 Squarefree members of A202057. - _Artur Jasinski_, Dec 10 2011
%C A020893 Union of A231754 and 2*A231754. Squarefree numbers whose prime factors are in A002313. - _Robert Israel_, Aug 23 2017
%C A020893 It appears that a(n) is the n-th index, k, such that f(k) = 2, where f(k) = 3*(Sum_{i=1..k} floor(i^2/k)) - k^2 (see A175908). - _John W. Layman_, May 16 2011
%D A020893 Srinivasa Ramanujan, The Lost Notebook and Other Unpublished Papers, Narosa Publishing House, New Delhi, 1988; see page 123.
%H A020893 Charles R Greathouse IV, <a href="/A020893/b020893.txt">Table of n, a(n) for n = 1..10000</a>
%H A020893 Steven R. Finch, <a href="http://www.people.fas.harvard.edu/~sfinch/csolve/fermat.pdf">On a Generalized Fermat-Wiles Equation</a> [broken link]
%H A020893 Steven R. Finch, <a href="http://web.archive.org/web/20010602030546/http://www.mathsoft.com/asolve/fermat/fermat.html">On a Generalized Fermat-Wiles Equation</a> [From the Wayback Machine]
%H A020893 <a href="/index/Su#ssq">Index entries for sequences related to sums of squares</a>
%F A020893 a(n) ~ k*n*sqrt(log n), where k = 2.1524249... = A013661/A064533. - _Charles R Greathouse IV_, Apr 20 2015
%p A020893 N:= 1000: # to get all terms <= N
%p A020893 R:= {1,2}:
%p A020893 p:= 2:
%p A020893 do
%p A020893 p:= nextprime(p);
%p A020893 if p > N then break fi;
%p A020893 if p mod 4 <> 1 then next fi;
%p A020893 R:= R union select(`<=`,map(`*`,R,p),N);
%p A020893 od:
%p A020893 sort(convert(R,list)); # _Robert Israel_, Aug 23 2017
%t A020893 lim = 17; t = Join[{1}, Select[Union[Flatten[Table[x^2 + y^2, {x, lim}, {y, x}]]], # < lim^2 && SquareFreeQ[#] &]]
%t A020893 Select[Union[Total/@Tuples[Range[0,20]^2,2]],SquareFreeQ] (* _Harvey P. Dale_, Jul 26 2017 *)
%t A020893 Block[{nn = 350, p}, p = {1, 2}~Join~Select[Prime@ Range@ PrimePi@ nn, Mod[#, 4] == 1 &]; Select[Range@ nn, And[SquareFreeQ@ #, SubsetQ[p, FactorInteger[#][[All, 1]]]] &]] (* _Michael De Vlieger_, Aug 23 2017 *)
%t A020893 (* or *)
%t A020893 Select[Range[350], SquareFreeQ@ # && ! MemberQ[Mod[First /@ FactorInteger@ #, 4], 3] &] (* _Giovanni Resta_, Aug 25 2017 *)
%o A020893 (PARI) is(n)=my(f=factor(n)); for(i=1,#f~,if(f[i,2]>1 || f[i,1]%4==3, return(0))); 1 \\ _Charles R Greathouse IV_, Apr 20 2015
%o A020893 (Haskell)
%o A020893 a020893 n = a020893_list !! (n-1)
%o A020893 a020893_list = filter (\x -> any (== 1) $ map (a010052 . (x -)) $
%o A020893                              takeWhile (<= x) a000290_list) a005117_list
%o A020893 -- _Reinhard Zumkeller_, May 28 2015
%o A020893 (Python)
%o A020893 from itertools import count, islice
%o A020893 from sympy import factorint
%o A020893 def A020893_gen(): # generator of terms
%o A020893     return filter(lambda n:all(p & 3 != 3 and e == 1 for p, e in factorint(n).items()),count(1))
%o A020893 A020893_list = list(islice(A020893_gen(),30)) # _Chai Wah Wu_, Jun 28 2022
%Y A020893 Cf. A001481, A008784, A022544, A034023, A175908.
%Y A020893 Cf. also A000290, A010052, A005117, A084349, A002313, A231754.
%K A020893 nonn
%O A020893 1,2
%A A020893 _Steven Finch_
%E A020893 Edited by _N. J. A. Sloane_, Aug 30 2017