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-3 of 3 results.

A135987 Records in A064844.

Original entry on oeis.org

0, 1, 6, 7, 25, 32, 33, 35, 36, 62, 89, 184, 464, 519, 1047, 1050, 1339, 2144, 2311, 6799, 12270, 19963, 19964, 22768, 80843, 80846, 93174, 150556, 162347, 656233, 688140, 1004475, 1622633
Offset: 1

Views

Author

Klaus Brockhaus, Dec 09 2007, corrected Dec 13 2007

Keywords

Crossrefs

Cf. A064834, A064844, A135988 (where records occur).

Extensions

a(27)-a(33) from Donovan Johnson, Sep 05 2012

A135988 Indices of records in A064844.

Original entry on oeis.org

1, 10, 12, 18, 102, 1002, 1004, 1098, 1208, 1272, 1406, 10654, 13007, 23963, 100002, 100004, 148892, 160509, 250584, 1028298, 1498882, 1618607, 1618609, 2509584, 10000002, 10000004, 14998465, 16198509, 25198584, 101088834, 152088316, 161998509, 251998584
Offset: 1

Views

Author

Klaus Brockhaus, Dec 09 2007, corrected Dec 13 2007

Keywords

Crossrefs

Cf. A064834, A064844, A135987 (record values).

Extensions

a(27)-a(33) from Donovan Johnson, Sep 05 2012
a(1) corrected by Georg Fischer, Sep 10 2023

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
Showing 1-3 of 3 results.