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.

Previous Showing 11-20 of 55 results. Next

A065206 Numbers which need one 'Reverse and Add' step to reach a palindrome.

Original entry on oeis.org

10, 12, 13, 14, 15, 16, 17, 18, 20, 21, 23, 24, 25, 26, 27, 29, 30, 31, 32, 34, 35, 36, 38, 40, 41, 42, 43, 45, 47, 50, 51, 52, 53, 54, 56, 60, 61, 62, 63, 65, 70, 71, 72, 74, 80, 81, 83, 90, 92, 100, 102, 103, 104, 105, 106, 107, 108, 110, 112, 113, 114, 115, 116, 117
Offset: 1

Views

Author

Klaus Brockhaus, Oct 21 2001

Keywords

Comments

The number of steps starts at 0, so palindromes (A002113) are excluded.
Numbers k such that A033665(k) = 1. - Andrew Howroyd, Dec 05 2024

Crossrefs

Programs

  • ARIBAS
    function revadd_steps(k,stop: integer); var c,n,m,steps,rev: integer; begin n := 0; c := 0; while c < stop do m := n; rev := int_reverse(m); steps := 0; while steps < k and m <> rev do m := m + rev; rev := int_reverse(m); inc(steps); end; if steps = k and m = rev then write(n," "); inc(c); end; inc(n); end; end; revadd_steps(1,66).
    
  • Haskell
    a065206 n = a065206_list !! (n-1)
    a065206_list = filter ((== 1) . a136522 . a056964) a029742_list
    -- Reinhard Zumkeller, Oct 14 2011
    
  • Mathematica
    Select[Range[10,120],!PalindromeQ[#]&&PalindromeQ[#+IntegerReverse[#]]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 14 2017 *)
  • PARI
    isok(n,s=1)={for(k=0, s, my(r=fromdigits(Vecrev(digits(n)))); if(r==n, return(k==s)); n += r); 0} \\ Andrew Howroyd, Dec 05 2024

Extensions

Offset corrected by Harry J. Smith, Oct 13 2009

A319453 Number T(n,k) of partitions of n into exactly k nonzero decimal palindromes; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 2, 1, 1, 0, 1, 2, 2, 1, 1, 0, 1, 3, 3, 2, 1, 1, 0, 1, 3, 4, 3, 2, 1, 1, 0, 1, 4, 5, 5, 3, 2, 1, 1, 0, 1, 4, 7, 6, 5, 3, 2, 1, 1, 0, 0, 5, 8, 9, 7, 5, 3, 2, 1, 1, 0, 1, 4, 10, 11, 10, 7, 5, 3, 2, 1, 1, 0, 0, 5, 11, 15, 13, 11, 7, 5, 3, 2, 1, 1
Offset: 0

Views

Author

Alois P. Heinz, Sep 19 2018

Keywords

Comments

Differs from A008284 and from A072233 first at T(10,1) = 0.

Examples

			Triangle T(n,k) begins:
  1;
  0, 1;
  0, 1, 1;
  0, 1, 1,  1;
  0, 1, 2,  1,  1;
  0, 1, 2,  2,  1,  1;
  0, 1, 3,  3,  2,  1,  1;
  0, 1, 3,  4,  3,  2,  1, 1;
  0, 1, 4,  5,  5,  3,  2, 1, 1;
  0, 1, 4,  7,  6,  5,  3, 2, 1, 1;
  0, 0, 5,  8,  9,  7,  5, 3, 2, 1, 1;
  0, 1, 4, 10, 11, 10,  7, 5, 3, 2, 1, 1;
  0, 0, 5, 11, 15, 13, 11, 7, 5, 3, 2, 1, 1;
  ...
		

Crossrefs

Columns k=0-10 give: A000007, A136522 (for n>0), A319468, A261131, A319469, A319470, A319471, A319472, A319473, A319474, A319475.
Row sums give A091580.
T(2n,n) gives A319454.

Programs

  • Maple
    p:= proc(n) option remember; local i, s; s:= ""||n;
          for i to iquo(length(s), 2) do if
            s[i]<>s[-i] then return false fi od; true
        end:
    h:= proc(n) option remember; `if`(n<1, 0,
         `if`(p(n), n, h(n-1)))
        end:
    b:= proc(n, i) option remember; `if`(n=0 or i=1, x^n,
          b(n, h(i-1))+expand(x*b(n-i, h(min(n-i, i)))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n, h(n))):
    seq(T(n), n=0..14);

Formula

T(n,k) = [x^n y^k] 1/Product_{j>=2} (1-y*x^A002113(j)).
Sum_{k=0..3} T(n,k) = A261132(n).

A046447 Apart from initial term, composite numbers with the property that the concatenation of their prime factors is a palindrome.

Original entry on oeis.org

1, 4, 8, 9, 16, 25, 27, 32, 39, 49, 64, 69, 81, 119, 121, 125, 128, 129, 159, 219, 243, 249, 256, 259, 329, 339, 343, 403, 429, 469, 507, 512, 625, 669, 679, 729, 795, 1024, 1207, 1309, 1329, 1331, 1533, 1547, 1587, 1589, 1703, 2023, 2048, 2097, 2187, 2319
Offset: 1

Views

Author

Patrick De Geest, Jul 15 1998

Keywords

Comments

Prime factors considered with multiplicity. - Harvey P. Dale, Apr 20 2025

Examples

			81 is a term because 81 = 3 * 3 * 3 * 3 -> 3333 is palindromic.
		

Crossrefs

Programs

  • Haskell
    a046447 n = a046447_list !! (n-1)
    a046447_list = 1 : filter f [1..] where
       f x = length ps > 1 && ps' == reverse ps'
             where ps' = concatMap show ps; ps = a027746_row x
    -- Reinhard Zumkeller, May 02 2014
    
  • Mathematica
    concat[n_]:=Flatten[Table[IntegerDigits[First[n]],{Last[n]}]]; palQ[n_]:= Module[{x=Flatten[concat/@FactorInteger[n]]},x==Reverse[x]&&!PrimeQ[n]]; Select[Range[2500],palQ] (* Harvey P. Dale, May 24 2011 *)
    cpfpQ[n_]:=PalindromeQ[FromDigits[Flatten[IntegerDigits/@Flatten[PadRight[{},#[[2]],#[[1]]]&/@FactorInteger[n]]]]]; Join[{1},Select[Range[2500],CompositeQ[ #]&&cpfpQ[#]&]] (* Harvey P. Dale, Apr 20 2025 *)
  • Python
    from sympy import factorint, isprime
    A046447_list = [1]
    for n in range(4, 10**6):
        if not isprime(n):
            s = ''.join([str(p)*e for p, e in sorted(factorint(n).items())])
            if s == s[::-1]:
                A046447_list.append(n) # Chai Wah Wu, Jan 03 2015

Extensions

Definition slightly modified by Harvey P. Dale, Apr 20 2025

A260254 Number of ways to write n as sum of two palindromes in decimal representation.

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 4, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 21 2015

Keywords

Comments

a(A035137(n)) = 0; a(A260255(n)) > 0.

Examples

			.   n | a(n) |                                n | a(n) |
. ----+------+--------------------------    ----+------+--------------
.   0 |    1 |  0                            21 |    0 |  ./.
.   1 |    1 |  1                            22 |    2 |  22, 11+11
.   2 |    2 |  2, 1+1                       23 |    1 |  22+1
.   3 |    2 |  3, 2+1                       24 |    1 |  22+2
.   4 |    3 |  4, 3+1, 2+2                  25 |    1 |  22+3
.   5 |    3 |  5, 4+1, 3+2                  26 |    1 |  22+4
.   6 |    4 |  6, 5+1, 4+2, 3+3             27 |    1 |  22+5
.   7 |    4 |  7, 6+1, 5+2, 4+3             28 |    1 |  22+6
.   8 |    5 |  8, 7+1, 6+2, 5+3, 4+4        29 |    1 |  22+7
.   9 |    5 |  9, 8+1, 7+2, 6+3, 5+4        30 |    1 |  22+8
.  10 |    5 |  9+1, 8+2, 7+3, 6+4, 5+5      31 |    1 |  22+9
.  11 |    5 |  11, 9+2, 8+3, 7+4, 6+5       32 |    0 |  ./.
.  12 |    5 |  11+1, 9+3, 8+4, 7+5, 6+6     33 |    2 |  33, 22+11
.  13 |    4 |  11+2, 9+4, 8+5, 7+6          34 |    1 |  33+1
.  14 |    4 |  11+3, 9+5, 8+6, 7+7          35 |    1 |  33+2
.  15 |    3 |  11+4, 9+6, 8+7               36 |    1 |  33+3
.  16 |    3 |  11+5, 9+7, 8+8               37 |    1 |  33+4
.  17 |    2 |  11+6, 9+8                    38 |    1 |  33+5
.  18 |    2 |  11+7, 9+9                    39 |    1 |  33+6
.  19 |    1 |  11+8                         40 |    1 |  33+7
.  20 |    1 |  11+9                         41 |    1 |  33+8  .
		

Crossrefs

Programs

  • Haskell
    a260254 n = sum $ map (a136522 . (n -)) $
                   takeWhile (<= n `div` 2) a002113_list

Formula

a(n) = sum{A136522(n - A002113(k)): k = 1..floor(n/2)}.

A064834 If n (in base 10) is d_1 d_2 ... d_k then a(n) = Sum_{i = 1..[k/2] } |d_i - d_{k-i+1}|.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Oct 25 2001

Keywords

Comments

Might be called the Palindromic Deviation (or PD(n)) of n, since it measures how far n is from being a palindrome. - W. W. Kokko, Mar 13 2013
a(A002113(n)) = 0; a(A029742(n)) > 0; A136522(n) = A000007(a(n)). - Reinhard Zumkeller, Sep 18 2013

Examples

			a(456) = | 4 - 6 | = 2, a(4567) = | 4 - 7 | + | 5 - 6 | = 4.
		

Crossrefs

Programs

  • Haskell
    a064834 n = sum $ take (length nds `div` 2) $
                      map abs $ zipWith (-) nds $ reverse nds
       where nds = a031298_row n
    -- Reinhard Zumkeller, Sep 18 2013
    
  • Maple
    f:=proc(n)
    local t1,t2,i;
    t1:=convert(n,base,10);
    t2:=nops(t1);
    add( abs(t1[i]-t1[t2+1-i]),i=1..floor(t2/2) );
    end;
    [seq(f(n),n=0..120)]; # N. J. A. Sloane, Mar 24 2013
  • Mathematica
    f[n_] := (k = IntegerDigits[n]; l = Length[k]; Sum[ Abs[ k[[i]] - k[[l - i + 1]]], {i, 1, Floor[l/2] } ] ); Table[ f[n], {n, 0, 100} ]
  • Python
    from sympy import floor, ceiling
    def A064834(n):
        x, y = str(n), 0
        lx2 = len(x)/2
        for a,b in zip(x[:floor(lx2)],x[:ceiling(lx2)-1:-1]):
            y += abs(int(a)-int(b))
        return y
    # Chai Wah Wu, Aug 09 2014

Extensions

More terms from Vladeta Jovovic, Matthew Conroy and Robert G. Wilson v, Oct 26 2001

A341155 Number of partitions of n into 2 distinct nonzero decimal palindromes.

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Feb 06 2021

Keywords

Crossrefs

A341156 Number of partitions of n into 3 distinct nonzero decimal palindromes.

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Feb 06 2021

Keywords

Crossrefs

A341157 Number of partitions of n into 4 distinct nonzero decimal palindromes.

Original entry on oeis.org

1, 1, 2, 3, 5, 6, 8, 10, 12, 13, 15, 15, 16, 16, 15, 14, 13, 11, 10, 9, 8, 7, 7, 7, 8, 8, 9, 9, 10, 10, 11, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 11, 11, 11, 12, 12, 13, 13, 14, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 16, 15, 15, 15, 15, 16
Offset: 10

Views

Author

Ilya Gutkovskiy, Feb 06 2021

Keywords

Crossrefs

A341158 Number of partitions of n into 5 distinct nonzero decimal palindromes.

Original entry on oeis.org

1, 1, 2, 3, 5, 6, 9, 10, 13, 14, 17, 17, 19, 18, 19, 17, 17, 15, 14, 12, 12, 11, 11, 11, 12, 13, 14, 15, 16, 17, 18, 18, 19, 19, 19, 19, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 21, 21, 22, 23, 24, 26, 26, 28, 28, 29, 29, 31, 29, 30, 30, 30, 30, 30, 30, 30, 30, 31
Offset: 15

Views

Author

Ilya Gutkovskiy, Feb 06 2021

Keywords

Crossrefs

A341159 Number of partitions of n into 6 distinct nonzero decimal palindromes.

Original entry on oeis.org

1, 1, 2, 3, 4, 6, 8, 9, 11, 13, 14, 15, 16, 16, 15, 15, 14, 13, 12, 11, 11, 11, 12, 12, 14, 15, 17, 18, 20, 20, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 22, 23, 23, 23, 24, 24, 25, 26, 28, 29, 31, 32, 35, 36, 38, 39, 40, 41, 41, 42, 42, 42, 41, 43, 42, 42, 43, 43, 44, 45, 47
Offset: 21

Views

Author

Ilya Gutkovskiy, Feb 06 2021

Keywords

Crossrefs

Programs

Previous Showing 11-20 of 55 results. Next