VOOZH about

URL: https://oeis.org/A152595

⇱ A152595 - OEIS


login
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
OFFSET
1,5
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