7 kyu

Geometric Progression Sequence

1,431 of 3,448baaart

Description:

In your class, you have started lessons about geometric progression. Since you are also a programmer, you have decided to write a function that will print first n elements of the sequence with the given constant r and first element a.

Result should be separated by comma and space.

Example

geometric_sequence_elements(2, 3, 5) == '2, 6, 18, 54, 162'
geometric_sequence_elements(2, 3, 5) == '2, 6, 18, 54, 162'
geometricSequenceElements(2, 3, 5) == '2, 6, 18, 54, 162'
geometric_sequence_elements(2, 3, 5); // => '2, 6, 18, 54, 162'
Kata.GeometricSequenceElements(2, 3, 5); // => "2, 6, 18, 54, 162"
Kata.geometric_sequence_elements(2, 3, 5) == "2, 6, 18, 54, 162"
geometricSequenceElements(2, 3, 5) == "2, 6, 18, 54, 162"

More info: https://en.wikipedia.org/wiki/Geometric_progression

Fundamentals

Stats:

CreatedAug 12, 2015
PublishedAug 12, 2015
Warriors Trained4783
Total Skips172
Total Code Submissions7948
Total Times Completed3448
Python Completions1431
JavaScript Completions1186
PHP Completions225
C# Completions279
Ruby Completions109
F# Completions37
Elixir Completions32
Kotlin Completions292
Total Stars28
% of votes with a positive feedback rating92% of 571
Total "Very Satisfied" Votes497
Total "Somewhat Satisfied" Votes60
Total "Not Satisfied" Votes14
Total Rank Assessments41
Average Assessed Rank
7 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • baaart Avatar
  • ZozoFouchtra Avatar
  • Unnamed Avatar
  • anter69 Avatar
  • donaldsebleung Avatar
  • aweleshetu Avatar
  • docgunthrop Avatar
  • Voile Avatar
  • hobovsky Avatar
  • testfirstcoder Avatar
  • gumarkamole Avatar
  • dfhwze Avatar
  • Just4FunCoder Avatar
  • yLaWy Avatar
Ad