In ShantiParva of Mahabharata, Bhishma told to Yudhishthira that once King Janadeva Janaka asked a philosophical question on salvation to the hundred acharyas in his court but none of them could satisfactorily answer his questions about salvation. Then a sage named as Panchashikha came to the court by chance advised the king about the means to attain salvation. The king got satisfied and impressed with the answer of the sage Panchashikha, then the king appointed the sage Panchashikha as his teacher. The sage Panchashikha taughtBrahman Vidya and Shamkhya philosophy to the king. It is said that once Mahavishnu in the guise of a Brahmin came to the King for testing, then being pleased with the king gave him some boons.