4 kyu
Last digits of N^2 == N
57 of 630Ivana
Description:
This is a very simply formulated task. Let's call an integer number N
'green' if N²
ends with all of the digits of N
. Some examples:
5
is green, because 5² = 25
and 25
ends with 5
.
11
is not green, because 11² = 121
and 121
does not end with 11
.
376
is green, because 376² = 141376
and 141376
ends with 376
.
Your task is to write a function green
that returns the n
th green number, starting with 1
- green (1) == 1
Input range
n <= 4000
Algorithms
Similar Kata:
Stats:
Created | Dec 12, 2016 |
Published | Dec 12, 2016 |
Warriors Trained | 7187 |
Total Skips | 1546 |
Total Code Submissions | 8843 |
Total Times Completed | 630 |
Haskell Completions | 57 |
Python Completions | 303 |
JavaScript Completions | 66 |
Java Completions | 194 |
C# Completions | 42 |
Total Stars | 307 |
% of votes with a positive feedback rating | 88% of 160 |
Total "Very Satisfied" Votes | 129 |
Total "Somewhat Satisfied" Votes | 23 |
Total "Not Satisfied" Votes | 8 |
Total Rank Assessments | 9 |
Average Assessed Rank | 4 kyu |
Highest Assessed Rank | 3 kyu |
Lowest Assessed Rank | 6 kyu |