cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A062388 Smallest palindrome with digit sum = n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 55, 191, 66, 292, 77, 393, 88, 494, 99, 595, 686, 696, 787, 797, 888, 898, 989, 999, 5995, 19991, 6996, 29992, 7997, 39993, 8998, 49994, 9999, 59995, 69896, 69996, 79897, 79997, 89898, 89998, 99899, 99999, 599995, 1999991
Offset: 0

Views

Author

Amarnath Murthy, Jun 27 2001

Keywords

Examples

			191 is the smallest palindrome to have digits sum to 11.
a(28) = 5995 and no palindrome less than 5995 has digit sum 28.
		

Crossrefs

Programs

  • Mathematica
    With[{p={#,Total[IntegerDigits[#]]}&/@Select[Range[0,3*10^6],PalindromeQ]},Table[SelectFirst[p,#[[2]]==n&],{n,0,50}]][[;;,1]] (* Harvey P. Dale, Aug 13 2025 *)
  • PARI
    ispal(n) = my(d=digits(n)); Vecrev(d)==d;
    a(n) = {k = 0; while ((sumdigits(k) != n) || !ispal(k), k++); k;} \\ Michel Marcus, Aug 20 2015

Extensions

More terms from Erich Friedman, Jul 04 2001
More terms from David Wasserman, Jun 27 2002

A113168 a(n) is the sum of digits of the first n palindromes.

Original entry on oeis.org

0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 47, 51, 57, 65, 75, 87, 101, 117, 135, 137, 140, 144, 149, 155, 162, 170, 179, 189, 200, 204, 209, 215, 222, 230, 239, 249, 260, 272, 285, 291, 298, 306, 315, 325, 336, 348, 361, 375, 390, 398, 407, 417, 428, 440, 453, 467, 482, 498
Offset: 1

Views

Author

Giovanni Teofilatto, Jan 06 2006

Keywords

Examples

			First twelve base 10 palindromes are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22. Sum of their digits is 0+1+2+3+4+5+6+7+8+9+1+1+2+2 = 51, hence a(12) = 51.
		

Crossrefs

Partial sums of A043269.

Programs

  • Mathematica
    With[{pals=Select[Range[0,500],#==IntegerReverse[#]&]},Table[ Total[ Flatten[ IntegerDigits/@ Take[ pals, n]]],{n,Length[pals]}]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 14 2016 *)

Extensions

Edited and extended by Klaus Brockhaus, Jan 06 2006
Showing 1-2 of 2 results.