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.

A082272 Smallest palindrome m such that n + m (m>0) is also a palindrome, or 0 if no such number exists.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 11, 99, 9, 8, 7, 6, 5, 4, 3, 2, 1, 11, 88, 9, 8, 7, 6, 5, 4, 3, 2, 1, 11, 77, 9, 8, 7, 6, 5, 4, 3, 2, 1, 11, 66, 9, 8, 7, 6, 5, 4, 3, 2, 1, 11, 55, 9, 8, 7, 6, 5, 4, 3, 2, 1, 11, 44, 9, 8, 7, 6, 5, 4, 3, 2, 1, 11, 33, 9, 8, 7, 6, 5, 4, 3, 2, 1, 11, 22, 9, 8, 7, 6, 5, 4, 3
Offset: 1

Views

Author

Amarnath Murthy, Apr 13 2003

Keywords

Comments

The first occurrence of 0 happens at n = 919.

Examples

			a(11) = 11, 11 + 11 = 22; a(12) = 99, 99 + 12 = 111; etc.
		

Crossrefs

Programs

  • PARI
    ispal(n) = eval(concat(Vecrev(Str(n)))) == n;
    nextpal(k) = k++; while(! ispal(k), k++); k;
    a(n) = {m = 1; while (! ispal(n+m), m = nextpal(m)); m;} \\ Michel Marcus, Jul 24 2014

Extensions

Edited by Patrick De Geest, Jun 08 2003