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.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Primitively but not imprimitively represented by x^2 + y^2.
The disjoint union of {1}, A003654, and A031398. - Max Alekseyev, Mar 09 2010
Squarefree members of A202057. - Artur Jasinski, Dec 10 2011
Union of A231754 and 2*A231754. Squarefree numbers whose prime factors are in A002313. - Robert Israel, Aug 23 2017
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

References

  • Srinivasa Ramanujan, The Lost Notebook and Other Unpublished Papers, Narosa Publishing House, New Delhi, 1988; see page 123.

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