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.

This page as a plain text file.
%I A018825 #29 Sep 02 2015 11:40:54
%S A018825 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,
%T A018825 42,43,44,46,47,48,49,51,54,55,56,57,59,60,62,63,64,66,67,69,70,71,75,
%U A018825 76,77,78,79,81,83,84,86,87,88,91,92,93,94,95,96,99,102,103,105,107,108,110
%N A018825 Numbers that are not the sum of 2 nonzero squares.
%H A018825 T. D. Noe, <a href="/A018825/b018825.txt">Table of n, a(n) for n = 1..10000</a>
%H A018825 <a href="/index/Su#ssq">Index entries for sequences related to sums of squares</a>
%F A018825 A025426(a(n)) = 0; A063725(a(n)) = 0. - _Reinhard Zumkeller_, Aug 16 2011
%p A018825 isA000404 := proc(n)
%p A018825     local x,y ;
%p A018825     for x from 1 do
%p A018825         if x^2> n then
%p A018825             return false;
%p A018825         end if;
%p A018825         for y from 1 do
%p A018825             if x^2+y^2 > n then
%p A018825                 break;
%p A018825             elif x^2+y^2 = n then
%p A018825                 return true;
%p A018825             end if;
%p A018825         end do:
%p A018825     end do:
%p A018825 end proc:
%p A018825 A018825 := proc(n)
%p A018825     if n = 1 then
%p A018825         1;
%p A018825     else
%p A018825         for a from procname(n-1)+1 do
%p A018825             if not isA000404(a) then
%p A018825                 return a;
%p A018825             end if;
%p A018825         end do:
%p A018825     end if;
%p A018825 end proc:
%p A018825 seq(A018825(n),n=1..30) ; # _R. J. Mathar_, Jul 28 2014
%t A018825 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 *)
%o A018825 (Haskell)
%o A018825 import Data.List (elemIndices)
%o A018825 a018825 n = a018825_list !! (n-1)
%o A018825 a018825_list = tail $ elemIndices 0 a025426_list
%o A018825 -- _Reinhard Zumkeller_, Aug 16 2011
%o A018825 (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
%Y A018825 Cf. A022544, A081324, A000404 (complement), A004431.
%K A018825 nonn
%O A018825 1,2
%A A018825 _David W. Wilson_