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-10 of 829 results. Next

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

Original entry on oeis.org

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, 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, 7, 7, 7, 7, 7, 5, 11, 8, 8, 8, 8, 8, 8, 8, 8, 8, 5, 12, 8, 8, 8
Offset: 0

Views

Author

Giovanni Resta, Aug 10 2015

Keywords

Comments

It is known that a(n) > 0 for every n, i.e., every number can be written as the sum of 3 palindromes.
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

Examples

			a(0)=1 because 0 = 0+0+0;
a(1)=1 because 1 = 0+0+1;
a(2)=2 because 2 = 0+1+1 = 0+0+2;
a(3)=3 because 3 = 1+1+1 = 0+1+2 = 0+0+3.
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.
		

Crossrefs

See A261422 for another version.

Programs

  • Maple
    A261132 := proc(n)
        local xi,yi,x,y,z,a ;
        a := 0 ;
        for xi from 1 do
            x := A002113(xi) ;
            if 3*x > n then
                return a;
            end if;
            for yi from xi do
                y := A002113(yi) ;
                if x+2*y > n then
                    break;
                else
                    z := n-x-y ;
                    if z >= y and isA002113(z) then
                        a := a+1 ;
                    end if;
                end if;
            end do:
        end do:
        return a;
    end proc:
    seq(A261132(n),n=0..80) ; # R. J. Mathar, Sep 09 2015
  • Mathematica
    pal=Select[Range[0, 1000], (d = IntegerDigits@ #; d == Reverse@ d)&]; a[n_] := Length@ IntegerPartitions[n, {3}, pal]; a /@ Range[0, 1000]
  • 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

Formula

a(n) = Sum_{k=0..3} A319453(n,k). - Alois P. Heinz, Sep 19 2018

Extensions

Examples revised and plots for large n added by Hugo Pfoertner, Aug 11 2015

A046489 Sum of the first n palindromes (A002113).

Original entry on oeis.org

1, 3, 6, 10, 15, 21, 28, 36, 45, 56, 78, 111, 155, 210, 276, 353, 441, 540, 641, 752, 873, 1004, 1145, 1296, 1457, 1628, 1809, 2000, 2202, 2414, 2636, 2868, 3110, 3362, 3624, 3896, 4178, 4470, 4773, 5086, 5409, 5742, 6085, 6438, 6801, 7174, 7557, 7950, 8354
Offset: 0

Views

Author

Patrick De Geest, Sep 15 1998

Keywords

Crossrefs

Programs

  • Mathematica
    palQ[n_] := Reverse[x = IntegerDigits[n]] == x; Accumulate[Select[Range[410], palQ]] (* Jayanta Basu, Jun 26 2013 *)

A118031 Decimal expansion of the sum of the reciprocals of the palindromic numbers A002113.

Original entry on oeis.org

3, 3, 7, 0, 2, 8, 3, 2, 5, 9, 4, 9, 7, 3, 7, 3, 3, 2, 0, 4, 9, 2, 1, 5, 7, 2, 9, 8, 5, 0, 5, 5, 3, 1, 1, 2, 3, 0, 7, 1, 4, 5, 7, 7, 7, 9, 4, 5, 2, 7, 7, 8, 4, 9, 1, 3, 3, 5, 0, 6, 8, 9, 2, 5, 9, 8, 2, 5, 1, 9, 7, 6, 0, 3, 4, 9, 4, 7, 6, 7, 5, 8, 9, 7, 0, 3, 0, 1
Offset: 1

Views

Author

Martin Renner, May 11 2006

Keywords

Comments

The sum using all palindromic numbers < 10^8 is 3.37000183240... Extrapolating using Wynn's epsilon method gives a value near 3.37018... - Eric W. Weisstein, May 14 2006

Examples

			3.3702832594973733204921572985...
		

Crossrefs

Cf. A002113.
Similar sequences: A118064, A194097, A244162.

Programs

  • Mathematica
    NextPalindrome[n_] := Block[{l = Floor[ Log[10, n] + 1], idn = IntegerDigits@ n}, If[ Union@ idn == {9}, Return[n + 2], If[l < 2, Return[n + 1], If[ FromDigits[ Reverse[ Take[ idn, Ceiling[l/2]]]] > FromDigits[ Take[idn, -Ceiling[l/2]]], FromDigits[Join[Take[idn, Ceiling[l/2]], Reverse[Take[idn, Floor[l/2]]]]], idfhn = FromDigits[Take[idn, Ceiling[l/2]]] + 1; idp = FromDigits[ Join[ IntegerDigits@ idfhn, Drop[ Reverse[ IntegerDigits@ idfhn], Mod[l, 2]]]]]]]]; pal = 1; sm = 0; Do[ While[pal < 10^n + 1, sm = N[sm + 1/pal, 128]; pal = NextPalindrome@ pal]; Print[{n, sm}], {n, 0, 17}] (* Robert G. Wilson v, Oct 20 2010 *)

Formula

a(n) = Sum_{palindromes p>0} 1/p.
a(n) = Sum_{n>=2} 1/A002113(n).

Extensions

Corrected by Eric W. Weisstein, May 14 2006
Corrected and extended by Robert G. Wilson v, Oct 20 2010
Corrected and extended by Joseph Myers, Jun 26 2014

A264406 Smallest palindrome of each distinct decimal type (A002113) in increasing order.

Original entry on oeis.org

1, 11, 101, 111, 1001, 1111, 10001, 10101, 10201, 11011, 11111, 100001, 101101, 102201, 110011, 111111, 1000001, 1001001, 1002001, 1010101, 1011101, 1012101, 1020201, 1021201, 1022201, 1023201, 1100011, 1101011, 1102011, 1110111, 1111111, 10000001, 10011001, 10022001, 10100101, 10111101, 10122101, 10200201, 10211201, 10222201, 10233201, 11000011, 11011011, 11022011, 11100111, 11111111
Offset: 1

Views

Author

Vladimir Shevelev, Dec 10 2015

Keywords

Comments

Only positive palindromes are considered.
The numbers N(n) of distinct types of n-digit palindromes, for n=1,2,..., are 1,1,2,2,5,5,15,15,... (A164904, n>=1). It is easy to see that N(2*n-1)=N(2*n), n>=1.

Examples

			The type corresponding to the term 1021201 has the form XYZXZYX, where X,Y,Z are distinct decimal digits, X>0.
		

Crossrefs

Extensions

Two missed terms were found by Peter J. C. Moses, Jan 07 2016

A261570 Concatenation of the palindromic numbers (A002113) in increasing order up to the n-th term and then in decreasing order.

Original entry on oeis.org

1, 121, 12321, 1234321, 123454321, 12345654321, 1234567654321, 123456787654321, 12345678987654321, 12345678911987654321, 123456789112211987654321, 1234567891122332211987654321, 12345678911223344332211987654321, 123456789112233445544332211987654321
Offset: 1

Views

Author

Robert G. Wilson v, Aug 24 2015

Keywords

Comments

By definition, all terms are palindromes. Inspired by A261493.
There are no primes in this sequence up to a(1100).
The least prime factors of a(n), n>=1, are: 1, 11, 3, 11, 41, 3, 239, 11, 3, 11, 11, 3, 11, 11, 3, 11, 11, 3, 71, 21557, 19, 17, 31, 181, 17, 353, 19, 31, 19, 29, 17, 29, 11616377, 214141, 19, 5471, 17, 13883, 3, 7, ..., . See A261411.
The first (probable) prime in this sequence was found by David Broadhurst on Aug 25 2015: this is a(2007), a 21233-digit probable prime with central term 1008001. - N. J. A. Sloane, Aug 24 2015

Examples

			a(4) is the concatenation of 1, 2, 3 and 4, and then 3, 2 and 1 which results in 1234321.
		

Crossrefs

Programs

  • Mathematica
    palQ[n_] := Reverse[idn = IntegerDigits@ n] == idn; s = Select[ Range @111, palQ]; f[n_] := FromDigits@ Flatten[ IntegerDigits@# & /@ Join[Take[s, n], Reverse@ Take[s, n - 1]]]; a = Array[f, 14]
  • PARI
    A002113(n)=if(n>9,(n-=9)*10+if(n>9,n\10,n),n)/* This "poor man's" version is valid only for n<109 */
    A261570(n,S=A002113(n))={while(n--,S=Str(A002113(n),S,A002113(n)));eval(S)} \\ M. F. Hasler, Aug 29 2015

A265641 Palindromes in base 10 (A002113) which are also prime factorization palindromes (A265640).

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 11, 44, 99, 101, 121, 131, 151, 171, 181, 191, 212, 242, 252, 272, 292, 313, 333, 343, 353, 363, 373, 383, 404, 464, 484, 575, 656, 676, 727, 747, 757, 787, 797, 828, 848, 909, 919, 929, 1331, 5445, 6336, 8228
Offset: 1

Views

Author

Vladimir Shevelev, Dec 11 2015

Keywords

Comments

Composite numbers in the sequence have two forms of symmetry.

Examples

			5445 = 3*11*5*11*3, so it is a term.
		

Crossrefs

Intersection of A002113 and A265640.

Programs

  • PARI
    isok(n) = (Vecrev(m=digits(n))==m) && (isprime(core(n)) || issquare(n)); \\ Michel Marcus, Jan 15 2019
    
  • PARI
    \\ See Corneth link \\ David A. Corneth, Jan 22 2019

Extensions

Missing term 8 inserted by Martin Schlegel, Jan 15 2019

A282584 Number of compositions (ordered partitions) of n into decimal palindromes (A002113).

Original entry on oeis.org

1, 1, 2, 4, 8, 16, 32, 64, 128, 256, 511, 1022, 2042, 4081, 8156, 16300, 32576, 65104, 130112, 260032, 519681, 1038595, 2075660, 4148259, 8290402, 16568581, 33112734, 66176648, 132255728, 264316464, 528243231, 1055707644, 2109858797, 4216606912, 8426997041, 16841569684, 33658308890, 67266993433
Offset: 0

Views

Author

Ilya Gutkovskiy, Feb 19 2017

Keywords

Examples

			a(4) = 8 because we have [4], [3, 1], [2, 2], [2, 1, 1], [1, 3], [1, 2, 1], [1, 1, 2] and [1, 1, 1, 1].
		

Crossrefs

Programs

  • Mathematica
    nmax = 37; CoefficientList[Series[1/(1 - Sum[Boole[PalindromeQ[k]] x^k, {k, 1, nmax}]), {x, 0, nmax}], x]

Formula

G.f.: 1/(1 - Sum_{k>=2} x^A002113(k)).

A084019 a(n) = 9's complement of n-th palindrome (A002113).

Original entry on oeis.org

9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 88, 77, 66, 55, 44, 33, 22, 11, 0, 898, 888, 878, 868, 858, 848, 838, 828, 818, 808, 797, 787, 777, 767, 757, 747, 737, 727, 717, 707, 696, 686, 676, 666, 656, 646, 636, 626, 616
Offset: 1

Views

Author

Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), May 23 2003

Keywords

Comments

Leading zeros in the 9's complement are omitted.
For palindromes of the form 10^k-1 the corresponding entry is zero. Apart from this the entries are distinct.

Examples

			The 20th palindromic number A002113(20) is 101 having 9's complement 898 (999 - 101 = 898). So a(20) = 898. - _Indranil Ghosh_, Jan 30 2017
		

Crossrefs

Programs

  • Python
    # Program for generating the b-file
    def a(n):
        return 10**len(str(n))-n-1
    i=0
    j=1
    while j<=250:
        if i==int(str(i)[::-1]):
            print(str(j)+" "+str(a(i)))
            j+=1
        i+=1 # Indranil Ghosh, Jan 30 2017
    
  • Python
    def A084019(n):
        if n == 1: return 9
        y = 10*(x:=10**(len(str(n>>1))-1))
        if nChai Wah Wu, Jun 13 2024

A110786 To obtain a(n), take the n-th palindrome P = A002113(n) and concatenate it with the smallest palindrome Q such that PQ is a prime.

Original entry on oeis.org

11, 23, 31, 41, 53, 61, 71, 83, 97, 113, 223, 331, 443, 557, 661, 773, 881, 991, 1013, 1117, 1213, 1319, 14177, 1511, 1613, 171131, 1811, 1913, 2027, 2129, 2221, 232171, 2423, 2521, 2621, 2729, 28211, 2927, 3037, 3137, 32377, 3331, 3433, 3533
Offset: 1

Views

Author

Amarnath Murthy, Aug 12 2005

Keywords

Examples

			The palindrome 171 gives a prime 171131 when concatenated with 131 and no palindrome less than 131 gives a prime on concatenation: 1711,1713,1717,1719,17111, etc. up to 171121 are all composite.
		

Crossrefs

Programs

  • Python
    from itertools import count
    from sympy import isprime
    def A110786(n):
        s = str((c:=n+1-x)*x+int(str(c)[-2::-1] or 0) if n+1<(x:=10**(len(str(n+1>>1))-1))+(y:=10*x) else (c:=n+1-y)*y+int(str(c)[::-1] or 0))
        for k in count(2):
            if isprime(pq:=int(s+str((c:=k-x)*x+int(str(c)[-2::-1] or 0) if k<(x:=10**(len(str(k>>1))-1))+(y:=10*x) else (c:=k-y)*y+int(str(c)[::-1] or 0)))):
                return pq # Chai Wah Wu, Jul 10 2024

Extensions

More terms from Giovanni Resta, Feb 08 2006
Edited by N. J. A. Sloane, Jan 16 2009

A226486 First available increasing palindromes (A002113) found in the decimal expansion of Pi-3 (A000796).

Original entry on oeis.org

1, 4, 5, 9, 535, 979, 46264, 59195, 73637, 77477, 99999, 467764, 8683868, 23911932, 398989893, 559555955, 769646967, 972464279, 992868299, 21348884312, 49612121694, 450197791054, 9475082805749
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    pi = RealDigits[Pi-3, 10, 2500000][[1]]; palQ[n_] := n == Reverse[n]; mx = 0; k = 1; While[k < 1000, j = 1; While[j <= k, If[ palQ[ Take[ pi, {j, k}]], p = FromDigits[ Take[ pi, {j, k}]]; If[p > mx, mx = p; Print[p]; pi = Drop[pi, k]; k = 0; Break[]]]; j++]; k++]
Showing 1-10 of 829 results. Next