Sequence of non-squares: Difference between revisions

m
→‎{{header|Python}}: Compacted list display
(→‎{{header|Python}}: Added a definition of A000037 as a non-finite series.)
m (→‎{{header|Python}}: Compacted list display)
Line 1,983:
fTable(main.__doc__)(
lambda f: '\n' + f.__doc__
)(lambda x: ' ' + reprshowList(x))(
lambda f: f()
)([first22, squareInFirstMillion])
Line 2,014:
'''True if n is a perfect square.'''
return sqrt(n).is_integer()
 
 
# showList :: [a] -> String
def showList(xs):
'''Compact stringification of any list value.'''
return '[' + ','.join(repr(x) for x in xs) + ']' if (
isinstance(xs, list)
) else repr(xs)
 
 
Line 2,031 ⟶ 2,039:
 
First 22 terms:
[2, 3, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27]
 
True if any of the first 10^6 terms are perfect squares:
9,655

edits