Tap here to switch tabs
Problem
Submissions

Problem: Sum of k-Mirror Numbers

Sum of k-Mirror Numbers asks you to find the sum of the n smallest positive integers that are palindromes in both base ten and a given base k.

Statement

A k-mirror number is a positive integer without leading zeros that is a palindrome in both base-1010 and base-k.

Given an integer k representing the base and an integer n, return the sum of the n smallest k-mirror numbers.

Note: A palindrome is a number that reads the same both forward and backward.

Constraints:

  • 2≤2 \leq k ≤9\leq 9

  • 1≤1 \leq n ≤30\leq 30

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Sum of k-Mirror Numbers

Sum of k-Mirror Numbers asks you to find the sum of the n smallest positive integers that are palindromes in both base ten and a given base k.

Statement

A k-mirror number is a positive integer without leading zeros that is a palindrome in both base-1010 and base-k.

Given an integer k representing the base and an integer n, return the sum of the n smallest k-mirror numbers.

Note: A palindrome is a number that reads the same both forward and backward.

Constraints:

  • 2≤2 \leq k ≤9\leq 9

  • 1≤1 \leq n ≤30\leq 30