Skip to content

Commit

Permalink
refactor: converts tetrahedral_square_pyramidal_number into a infinit…
Browse files Browse the repository at this point in the history
…e sequence
  • Loading branch information
edelveart committed Jul 17, 2024
1 parent 30c5c3d commit d9eee92
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/figurate_numbers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -903,9 +903,8 @@ def square_square_pyramidal_numbers

def tetrahedral_square_pyramidal_number
Enumerator.new do |y|
finite_set = [1]
(finite_set).each do |delta|
y << delta
(1..Float::INFINITY).each do
y << 1
end
end
end
Expand Down

0 comments on commit d9eee92

Please sign in to comment.