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.

A261132 Number of ways to write n as the sum u+v+w of three palindromes (from A002113) with 0 <= u <= v <= w.

This page as a plain text file.
%I A261132 #55 Aug 13 2020 14:02:28
%S A261132 1,1,2,3,4,5,7,8,10,12,13,15,16,17,17,18,17,17,16,15,13,12,11,10,9,8,
%T A261132 7,7,6,6,6,6,5,7,6,6,6,6,6,6,6,6,6,5,8,7,7,7,7,7,7,7,7,7,5,9,7,7,7,7,
%U A261132 7,7,7,7,7,5,11,8,8,8,8,8,8,8,8,8,5,12,8,8,8
%N A261132 Number of ways to write n as the sum u+v+w of three palindromes (from A002113) with 0 <= u <= v <= w.
%C A261132 It is known that a(n) > 0 for every n, i.e., every number can be written as the sum of 3 palindromes.
%C A261132 The graph has a kind of self-similarity: looking at the first 100 values, there is a Gaussian-shaped peak centered at the first local maximum a(15) = 18. Looking at the first 10000 values, one sees just one Gaussian-shaped peak centered around the record and local maximum a(1453) = 766, but to both sides of this value there are smaller peaks, roughly at distances which are multiples of 10. In the range [1..10^6], one sees a Gaussian-shaped peak centered around the record a(164445) = 57714. In the range [1..3*10^7], there is a similar peak of height ~ 4.3*10^6 at 1.65*10^7, with smaller neighbor peaks at distances which are multiples of 10^6, etc. - _M. F. Hasler_, Sep 09 2018
%H A261132 Giovanni Resta, <a href="/A261132/b261132.txt">Table of n, a(n) for n = 0..10000</a>
%H A261132 Javier Cilleruelo and Florian Luca, <a href="http://arxiv.org/abs/1602.06208">Every positive integer is a sum of three palindromes</a>, arXiv: 1602.06208 [math.NT], 2016-2017.
%H A261132 Erich Friedman, <a href="https://erich-friedman.github.io/mathmagic/0699.html">Problem of the Month (June 1999)</a>
%H A261132 James Grime and Brady Haran, <a href="https://www.youtube.com/watch?v=OKhacWQ2fCs">Every Number is the Sum of Three Palindromes</a>, Numberphile video (2018)
%H A261132 Hugo Pfoertner, <a href="/A261132/a261132.png">Plot of first 10^6 terms</a>
%H A261132 Hugo Pfoertner, <a href="/A261132/a261132_1.png">Plot of first 3*10^7 terms</a>
%H A261132 Hugo Pfoertner, <a href="/A261132/a261132_2.png">Plot of low values in range 7*10^6 ... 10^7 </a>
%F A261132 a(n) = Sum_{k=0..3} A319453(n,k). - _Alois P. Heinz_, Sep 19 2018
%e A261132 a(0)=1 because 0 = 0+0+0;
%e A261132 a(1)=1 because 1 = 0+0+1;
%e A261132 a(2)=2 because 2 = 0+1+1 = 0+0+2;
%e A261132 a(3)=3 because 3 = 1+1+1 = 0+1+2 = 0+0+3.
%e A261132 a(28) = 6 since 28 can be expressed in 6 ways as the sum of 3 palindromes, namely, 28 = 0+6+22 = 1+5+22 = 2+4+22 = 3+3+22 = 6+11+11 = 8+9+11.
%p A261132 A261132 := proc(n)
%p A261132     local xi,yi,x,y,z,a ;
%p A261132     a := 0 ;
%p A261132     for xi from 1 do
%p A261132         x := A002113(xi) ;
%p A261132         if 3*x > n then
%p A261132             return a;
%p A261132         end if;
%p A261132         for yi from xi do
%p A261132             y := A002113(yi) ;
%p A261132             if x+2*y > n then
%p A261132                 break;
%p A261132             else
%p A261132                 z := n-x-y ;
%p A261132                 if z >= y and isA002113(z) then
%p A261132                     a := a+1 ;
%p A261132                 end if;
%p A261132             end if;
%p A261132         end do:
%p A261132     end do:
%p A261132     return a;
%p A261132 end proc:
%p A261132 seq(A261132(n),n=0..80) ; # _R. J. Mathar_, Sep 09 2015
%t A261132 pal=Select[Range[0, 1000], (d = IntegerDigits@ #; d == Reverse@ d)&]; a[n_] := Length@ IntegerPartitions[n, {3}, pal]; a /@ Range[0, 1000]
%o A261132 (PARI) A261132(n)=n||return(1); my(c=0, i=inv_A002113(n)); A2113[i] > n && i--; until( A2113[i--]*3 < n, j = inv_A002113(D = n-A2113[i]); if( j>i, j=i, A2113[j] > D && j--); while( j >= k = inv_A002113(D - A2113[j]), A2113[k] == D - A2113[j] && c++; j--||break));c \\ For efficiency, this uses an array A2113 precomputed at least up to n. - _M. F. Hasler_, Sep 10 2018
%Y A261132 Cf. A002113, A035137, A260254, A261131, A319453.
%Y A261132 See A261422 for another version.
%K A261132 nonn,base,look
%O A261132 0,3
%A A261132 _Giovanni Resta_, Aug 10 2015
%E A261132 Examples revised and plots for large n added by _Hugo Pfoertner_, Aug 11 2015