Category Archives: Algorithms

Check if a Number is Pentacontagon

Given an integer N, the task is to check if it is a pentacontagon number or not. Pentacontagon number is class of figurate number. It has 50 – sided polygon called pentacontagon. The N-th pentacontagon number count’s the 50 number of dots and all others dots are surrounding with a common sharing corner and make a pattern. The… Read More »

Check if a Number is Triacontakaidigon

Given an integer N, the task is to check if it is a Triacontakaidigon number or not. Triacontakaidigon number is class of figurate number. It has 32 – sided polygon called Triacontakaidigon. The N-th triacontakaidigon number count’s the 32 number of dots and all others dots are surrounding with a common sharing corner and make a pattern. The… Read More »

Check if a Number is Hexacontagon

Given an integer N, the task is to check if it is a hexacontagon number or not. Hexacontagon number is class of figurate number. It has 60 – sided polygon called hexacontagon. The N-th hexacontagon number count’s the 60 number of dots and all others dots are surrounding with a common sharing corner and make a pattern. The… Read More »

Length of largest subarray of Fibonacci Numbers

Given an array arr[] of integer elements, the task is to find the length of the largest sub-array of arr[] such that all the elements of the sub-array are Fibonacci numbers. Examples: Input: arr[] = { 4, 2, 3, 4, 5, 8, 11 } Output: 2 Explanation: Maximum length sub-array with all elements as Fibonacci number is {2,… Read More »