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: ' ' +
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,
True if any of the first 10^6 terms are perfect squares:
|