Number of palindromes made of n digits

  • Context: High School 
  • Thread starter Thread starter archaic
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around the formulation of the number of palindromes that can be created with a specified number of digits, n. Participants explore the implications of the proposed formulas for both even and odd values of n, as well as the treatment of single-digit numbers.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested

Main Points Raised

  • One participant proposes a formula for the number of palindromes based on whether n is even or odd, suggesting P = 9 * 10^((n-2)/2) for even n and P = 9 * 10^((n-1)/2) for odd n greater than 1.
  • Another participant questions the applicability of the formula for n=1 and n=2, prompting further clarification.
  • A participant confirms that the formula works for n=2, providing an example with the count of two-digit palindromes.
  • There is a discussion about the treatment of n=1, with one participant asserting that all one-digit numbers are palindromes and that the formula gives 9, while another raises a definitional question about whether 0 counts as a one-digit palindrome.
  • Participants discuss the implications of definitions regarding palindromes and the inclusion of 0 in the context of single-digit numbers.

Areas of Agreement / Disagreement

Participants express differing views on the treatment of n=1 and the definition of palindromes, particularly regarding the inclusion of 0. There is no consensus reached on these points, and the discussion remains unresolved.

Contextual Notes

The discussion highlights potential limitations in the definitions used for palindromes, particularly concerning single-digit numbers and the role of 0. The applicability of the proposed formulas is also contingent on these definitions.

archaic
Messages
688
Reaction score
214
Hello! A while I tried to find a formula that allows finding the number of palindromes and I actually came up with something :
So let's say P is the number of palindromes made of n digits,
if n is even then P = 9 * 10^\frac{n-2}{2}
else if n is odd and =/= 1 then P = 9 * 10^\frac{n-1}{2}
This probably exists somewhere on the internet, but who knows ..
See ya!
 
Last edited:
Mathematics news on Phys.org
does it work for n=1 and n=2?
 
phinds said:
does it work for n=1 and n=2?
Thanks for your answer, I didn't consider n = 1 ..
It works for n = 2 though, 9 * 100 = 9 (11,22,33,44,55,66,77,88,99).
 
Last edited:
  • Like
Likes   Reactions: Janosh89
Where is the problem with n=1? All 1-digit numbers are trivial palindromes, and the formula gives 9.

There are 9 options for the firs digit (no 0) and 10 options for each following digit up to the center of the number. For even n this means a total of n/2 numbers you are free to choose, for odd n it is (n+1)/2. Taking out the first one, we have (n-2)/2 and (n-1)/2 digits with 10 choices and 1 digit with 9 choices. The rest of the number follows from these choices. And that leads to the formulas in the first post.
Nice observation!
 
mfb said:
Where is the problem with n=1? All 1-digit numbers are trivial palindromes, and the formula gives 9.

There are 9 options for the firs digit (no 0) and 10 options for each following digit up to the center of the number. For even n this means a total of n/2 numbers you are free to choose, for odd n it is (n+1)/2. Taking out the first one, we have (n-2)/2 and (n-1)/2 digits with 10 choices and 1 digit with 9 choices. The rest of the number follows from these choices. And that leads to the formulas in the first post.
Nice observation!
Thank you!
I went to check and actually it states here that 0 is considered a palindrome.
 
  • Like
Likes   Reactions: scottdave
It is a palindrome, but is it a 1-digit number?
A matter of definition I guess.
 
  • Like
Likes   Reactions: Janosh89 and archaic

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
946
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K