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.

A261675 Minimal number of palindromes in base 10 that add to n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 1, 2, 2, 2, 2
Offset: 0

Views

Author

N. J. A. Sloane, Sep 02 2015

Keywords

Comments

This sequence coincides with A088601 for n <= 301, but differs at n=302.
Although A088601 and this sequence agree for a large number of terms, because of their importance they warrant separate entries.
Cilleruelo and Luca prove that a(n) <= 3 (in fact they prove this for any fixed base g>=5). - Danny Rorabaugh, Feb 26 2016

Crossrefs

Programs

  • PARI
    ispal(n)=my(d=digits(n)); d==Vecrev(d);
    a(n)=my(L=n\2,d,e); if(ispal(n), return(1)); d=[1]; while((e=fromdigits(d))<=L, if(ispal(n-e), return(2)); my(k=#d,i=(k+1)\2); while(i&&d[i]==9, d[i]=0; d[k+1-i]=0; i--); if(i, d[i]++; d[k+1-i]=d[i], d=vector(#d+1); d[1]=d[#d]=1)); 3; \\ Charles R Greathouse IV, Nov 12 2018