A020893 Squarefree sums of two squares; or squarefree numbers with no prime factors of the form 4k+3.
1, 2, 5, 10, 13, 17, 26, 29, 34, 37, 41, 53, 58, 61, 65, 73, 74, 82, 85, 89, 97, 101, 106, 109, 113, 122, 130, 137, 145, 146, 149, 157, 170, 173, 178, 181, 185, 193, 194, 197, 202, 205, 218, 221, 226, 229, 233, 241, 257, 265, 269, 274, 277, 281, 290, 293, 298, 305, 313, 314, 317, 337, 346, 349
Offset: 1
Keywords
References
- Srinivasa Ramanujan, The Lost Notebook and Other Unpublished Papers, Narosa Publishing House, New Delhi, 1988; see page 123.
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
- Steven R. Finch, On a Generalized Fermat-Wiles Equation [broken link]
- Steven R. Finch, On a Generalized Fermat-Wiles Equation [From the Wayback Machine]
- Index entries for sequences related to sums of squares
Crossrefs
Programs
-
Haskell
a020893 n = a020893_list !! (n-1) a020893_list = filter (\x -> any (== 1) $ map (a010052 . (x -)) $ takeWhile (<= x) a000290_list) a005117_list -- Reinhard Zumkeller, May 28 2015
-
Maple
N:= 1000: # to get all terms <= N R:= {1,2}: p:= 2: do p:= nextprime(p); if p > N then break fi; if p mod 4 <> 1 then next fi; R:= R union select(`<=`,map(`*`,R,p),N); od: sort(convert(R,list)); # Robert Israel, Aug 23 2017
-
Mathematica
lim = 17; t = Join[{1}, Select[Union[Flatten[Table[x^2 + y^2, {x, lim}, {y, x}]]], # < lim^2 && SquareFreeQ[#] &]] Select[Union[Total/@Tuples[Range[0,20]^2,2]],SquareFreeQ] (* Harvey P. Dale, Jul 26 2017 *) 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 *) (* or *) Select[Range[350], SquareFreeQ@ # && ! MemberQ[Mod[First /@ FactorInteger@ #, 4], 3] &] (* Giovanni Resta, Aug 25 2017 *)
-
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
-
Python
from itertools import count, islice from sympy import factorint def A020893_gen(): # generator of terms return filter(lambda n:all(p & 3 != 3 and e == 1 for p, e in factorint(n).items()),count(1)) A020893_list = list(islice(A020893_gen(),30)) # Chai Wah Wu, Jun 28 2022
Formula
a(n) ~ k*n*sqrt(log n), where k = 2.1524249... = A013661/A064533. - Charles R Greathouse IV, Apr 20 2015
Extensions
Edited by N. J. A. Sloane, Aug 30 2017
Comments