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.
Thanks!
n and p are not "infinite", they are limited in all languages but the limits can vary through languages (some languages have naturally bignum integer type, some don't).
Edit: it seems that you are new at CW so look at the top of the page: see that 1118 guys passed the kata (179 in Python) -> you can solve the problem.
p
andn
are limited (at least in javascript, I don't know if the limit is the same in every language or not). Check JohanWiltink's post below. Are you suggesting that limit should be stated in the description?My understanding is that Pascal's triangle is a recursively generated structure and thus infinite. Computers are finite, so there is no program that can calculate S(n, p), for all n, for all p. Thus, I don't think I can solve this problem.
Duly noted. I have updated the description.
According to Wikipedia, the sequence of increasing narcissistic numbers varies by the base used. In base two, the only narcissistic numbers are zero and 1. As another example, in base ten "six" is a narcissistic number, but in base five, "six" is not a narcissistic number. I didn't see a base specified in the posing of this question. Consequently, I find the question ill-posed.
"Read again CAREFULLY the description"
The description asks for the sum of the lowest positive numbers in the array. But, what is a lowest positive number in an array? I know the minimum of such numbers, but there exist many different ways to order numbers, and thus 'lowest' is not clear.
So, does this kata have a solution if the phrase "lowest positive number" is ambiguous?