login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Largest n-digit palindrome with a digit sum of n.
3

%I #9 Dec 10 2024 17:24:49

%S 1,11,111,2002,20102,300003,3001003,40000004,400010004,5000000005,

%T 50000100005,600000000006,6000001000006,70000000000007,

%U 700000010000007,8000000000000008,80000000100000008,900000000000000009,9000000001000000009,91000000000000000019,910000000010000000019

%N Largest n-digit palindrome with a digit sum of n.

%H Andrew Howroyd, <a href="/A083441/b083441.txt">Table of n, a(n) for n = 1..1000</a>

%o (PARI) a(n)=my(h=n\2, w=h\9+1, q=10^w-10+h%9); if(n%2, 10^h) + q*10^(n-w) + fromdigits(Vecrev(digits(q))) \\ _Andrew Howroyd_, Dec 10 2024

%Y Cf. A083440.

%K base,easy,nonn,changed

%O 1,2

%A _Amarnath Murthy_ and Meenakshi Srikanth (menakan_s(AT)yahoo.com), May 01 2003

%E a(19) onwards from _Andrew Howroyd_, Dec 10 2024