|
Home > Archive > Unix Programming > January 2004 > Re: Number sequences, programming, preparing for Programming Competition
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: Number sequences, programming, preparing for Programming Competition
|
|
| Dmitry Karasik 2004-01-23, 5:14 pm |
| Hi Måns!
On 16 Jan 04 at 22:45, "Måns" (Måns Rullgård) wrote:[QUOTE][color=darkred]
Måns> BTW, did you mean a sequence of squares, rather than powers of two?
Aren't these the same? Anyway, 2 is not a square of an integer.
perl -le '1 while ( $ARGV[0] -= length ( $_ = ++$x * $x)) > 0; print substr
$_, length($_)+$ARGV[0]-1, 1;'
--
Sincerely,
Dmitry
--- www.karasik.eu.org ---
He who dies with most the toys wins
| |
| Dmitry Karasik 2004-01-23, 5:23 pm |
| Hi Måns!
On 16 Jan 04 at 22:45, "Måns" (Måns Rullgård) wrote:[QUOTE][color=darkred]
Måns> BTW, did you mean a sequence of squares, rather than powers of two?
Aren't these the same? Anyway, 2 is not a square of an integer.
perl -le '1 while ( $ARGV[0] -= length ( $_ = ++$x * $x)) > 0; print substr
$_, length($_)+$ARGV[0]-1, 1;'
--
Sincerely,
Dmitry
--- www.karasik.eu.org ---
He who dies with most the toys wins
| |
| Dmitry Karasik 2004-01-23, 5:36 pm |
| Hi Måns!
On 16 Jan 04 at 22:45, "Måns" (Måns Rullgård) wrote:[QUOTE][color=darkred]
Måns> BTW, did you mean a sequence of squares, rather than powers of two?
Aren't these the same? Anyway, 2 is not a square of an integer.
perl -le '1 while ( $ARGV[0] -= length ( $_ = ++$x * $x)) > 0; print substr
$_, length($_)+$ARGV[0]-1, 1;'
--
Sincerely,
Dmitry
--- www.karasik.eu.org ---
He who dies with most the toys wins
|
|
|
|
|