Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
Can't upvote that enough. Thanks jmeek
This comment is hidden because it contains spoiler information about the solution
The description is quite poorly worded. This might be an improvement:
A geometric sequence is one in which the (i+1)th term is found by multiplying the (i)th term by a fixed non-zero number, r.
For example, for r = 3:
s = 2, 6, 18, 54, ...
is a geometric sequence.
Your task is to write a function geometric_sequence_sum(a, r, n) that will return the SUM of the first n elements of a geometric sequence with the given constant r and first element a.
For example: geometric_sequence_sum(2, 3, 5) should return: 242 = 2 + 6 + 18 + 54 + 162
This threw me too (intended). Returning False and forgetting about the error might work, contrary to the instructions.
Fix grammar and wording in description, as follows:
Description:
According to wiki, a palindrome is a word, phrase, number, or other sequence of characters which reads the same backwards and forwards. Punctuation, capitalisation (upper-/lowercase), and word boundaries are ignored. Famous examples include "A man, a plan, a canal, Panama!", "Amor, Roma", "race car" and "No 'x' in Nixon".
If all requirements in the definition are met, return true. In case of null input, return false.