login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A152595 a(n) = the number of integers i in [1,n] that can be expressed as the sum of two squares of positive integers. 0
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, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 24, 25, 25, 25, 25, 25, 25, 25 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,5
LINKS
MAPLE
# 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:
CROSSREFS
Sequence in context: A227145 A039730 A257807 * A176844 A085182 A211339
KEYWORD
easy,nonn
AUTHOR
Nick Loughlin, Dec 09 2008
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 3 08:32 EDT 2024. Contains 372207 sequences. (Running on oeis4.)