6 kyu

pipi Numbers!

36 of 203Jomopipi

Description:

Hello. Today our job is to find the Nth Pipi number.

Let us define Pn such that the following expression:

P0+P1+P2+...Pn1+PnP_{0}+\sqrt{P_{1}+\sqrt{P{_2}+\sqrt{...\sqrt{P_{n-1}+\sqrt{P_n}}}}}

is equal to n, if P0 = 0.


Examples:

pipi(0) == 0

because

0=00 = 0

pipi(1) == 1

because

0+1=10 + \sqrt { 1 } = 1

pipi(2) == 9 

because

0+1+9=20 + \sqrt { 1 + \sqrt { 9 } } = 2

pipi(3) == 3025

because

0+1+9+3025=30 + \sqrt { 1 + \sqrt { 9 + \sqrt { 3025 } } } = 3

Number N range:

From 0 to 22.

(Check out my other kata!)

Matrix Diagonal Sort OMG

String -> N iterations -> String

String -> X iterations -> String

ANTISTRING

Array - squareUp b!

Matrix - squareUp b!

Infinitely Nested Radical Expressions

pipi Numbers!

Mathematics
Algorithms
Performance

Stats:

CreatedMay 9, 2018
PublishedMay 9, 2018
Warriors Trained1088
Total Skips21
Total Code Submissions1109
Total Times Completed203
Java Completions36
C# Completions36
Python Completions121
Haskell Completions21
JavaScript Completions23
Total Stars37
% of votes with a positive feedback rating93% of 67
Total "Very Satisfied" Votes60
Total "Somewhat Satisfied" Votes5
Total "Not Satisfied" Votes2
Total Rank Assessments5
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • Jomopipi Avatar
  • JohanWiltink Avatar
  • FArekkusu Avatar
  • hobovsky Avatar
  • dfhwze Avatar
  • Yushi.py Avatar
Ad