Sequence of non-squares: Difference between revisions

Sequence of non-squares en BASIC256
(Added AppleScript.)
(Sequence of non-squares en BASIC256)
Line 277:
NEXT i
IF found=0 THEN PRINT "No squares found"</lang>
 
=={{header|BASIC256}}==
<lang freebasic># Display first 22 values
print "The first 22 numbers generated by the sequence are : "
for i = 1 to 22
print nonSquare(i); " ";
next i
print
 
# Check for squares up to one million
found = false
for i = 1 to 1e6
j = sqrt(nonSquare(i))
if j = int(j) then
found = true
print i, " square numbers found"
exit for
end if
next i
if not found then print "No squares found"
end
 
function nonSquare (n)
return n + int(0.5 + sqrt(n))
end function</lang>
 
 
=={{header|BBC BASIC}}==
2,130

edits