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.

A152595 a(n) = the number of integers i in [1,n] that can be expressed as the sum of two squares of positive integers.

This page as a plain text file.
%I A152595 #3 Mar 31 2012 23:01:06
%S A152595 0,1,1,1,2,2,2,3,3,4,4,4,5,5,5,5,5,6,7,8,8,8,8,8,9,9,9,9,9,9,9,10,12,
%T A152595 13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,15,18,19,19,19,19,19,
%U A152595 19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,21,24,25,25,25,25,25,25,25
%N A152595 a(n) = the number of integers i in [1,n] that can be expressed as the sum of two squares of positive integers.
%p A152595 # Use se(n) to find the first n terms of the sequence and te(n) to find the n-th term. se:=proc(n) local L,S,k,m,i,j: L:=[]:S:={}: for k from 1 to n do m:=ceil(sqrt(k/2)): for i from 1 to m do for j from 1 to m do if i^2+j^2<=k then S:={op(S),i^2+j^2}: fi:od:od: L:=[op(L),nops(S)]: od: end proc: te:=proc(n) local S,m,i,j: m:=ceil(sqrt(n/2)): S:={}: for i from 1 to m do for j from 1 to m do if i^2+j^2<=n then S:={op(S),i^2+j^2}: fi:od:od: return nops(S): end proc:
%K A152595 easy,nonn
%O A152595 1,5
%A A152595 _Nick Loughlin_, Dec 09 2008