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.

A018825 Numbers that are not the sum of 2 nonzero squares.

Original entry on oeis.org

1, 3, 4, 6, 7, 9, 11, 12, 14, 15, 16, 19, 21, 22, 23, 24, 27, 28, 30, 31, 33, 35, 36, 38, 39, 42, 43, 44, 46, 47, 48, 49, 51, 54, 55, 56, 57, 59, 60, 62, 63, 64, 66, 67, 69, 70, 71, 75, 76, 77, 78, 79, 81, 83, 84, 86, 87, 88, 91, 92, 93, 94, 95, 96, 99, 102, 103, 105, 107, 108, 110
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A022544, A081324, A000404 (complement), A004431.

Programs

  • Haskell
    import Data.List (elemIndices)
    a018825 n = a018825_list !! (n-1)
    a018825_list = tail $ elemIndices 0 a025426_list
    -- Reinhard Zumkeller, Aug 16 2011
    
  • Maple
    isA000404 := proc(n)
        local x,y ;
        for x from 1 do
            if x^2> n then
                return false;
            end if;
            for y from 1 do
                if x^2+y^2 > n then
                    break;
                elif x^2+y^2 = n then
                    return true;
                end if;
            end do:
        end do:
    end proc:
    A018825 := proc(n)
        if n = 1 then
            1;
        else
            for a from procname(n-1)+1 do
                if not isA000404(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    seq(A018825(n),n=1..30) ; # R. J. Mathar, Jul 28 2014
  • Mathematica
    q=13;q2=q^2+1;lst={};Do[Do[z=a^2+b^2;If[z<=q2,AppendTo[lst,z]],{b,a,1,-1}],{a,q}];lst; u=Union@lst;Complement[Range[q^2],u] (* Vladimir Joseph Stephan Orlovsky, May 30 2010 *)
  • PARI
    is(n)=my(f=factor(n), t=prod(i=1,#f~, if(f[i,1]%4==1, f[i,2]+1, if(f[i,2]%2 && f[i,1]>2, 0, 1)))); if(t!=1, return(!t)); for(k=sqrtint((n-1)\2)+1, sqrtint(n-1), if(issquare(n-k^2), return(0))); 1 \\ Charles R Greathouse IV, Sep 02 2015

Formula

A025426(a(n)) = 0; A063725(a(n)) = 0. - Reinhard Zumkeller, Aug 16 2011