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

A297330 Total variation of base-10 digits of n; see Comments.

Original entry on oeis.org

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
Offset: 1

Views

Author

Clark Kimberling, Jan 17 2018

Keywords

Comments

Suppose that a number n has base-b digits b(m), b(m-1), ..., b(0). The base-b down-variation of n is the sum DV(n,b) of all d(i)-d(i-1) for which d(i) > d(i-1); the base-b up-variation of n is the sum UV(n,b) of all d(k-1)-d(k) for which d(k) < d(k-1). The total base-b variation of n is the sum TV(n,b) = DV(n,b) + UV(n,b). Guide to related sequences and partitions of the natural numbers:
***
Base b {DV(n,b)} {UV(n,b)} {TV(n,b)}
For each b, let u = {n : UV(n,b) < DV(n,b)}, e = {n : UV(n,b) = DV(n,b)}, and d = {n : UV(n,b) > DV(n,b)}. The sets u,e,d partition the natural numbers. A guide to the matching sequences for u, e, d follows:
***
Base b Sequence u Sequence e Sequence d
2 A005843 A005408 (none)
Not a duplicate of A151950: e.g., a(100)=1 but A151950(100)=11. - Robert Israel, Feb 06 2018

Examples

			13684632 has DV = 8-4 + 6-3 + 3-2 = 8 and has UV = 3-1 + 6-3 + 8-6 + 6-4 = 9, so that a(13684632) = DV + UV = 17.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local L,i; L:= convert(n,base,10);
    add(abs(L[i+1]-L[i]),i=1..nops(L)-1) end proc:
    map(f, [$1..100]); # Robert Israel, Feb 04 2018
    # alternative
    A297330 := proc(n)
        A037860(n)+A037851(n) ;
    end proc: # R. J. Mathar, Sep 27 2021
  • Mathematica
    b = 10; z = 120; t = Table[Total@Flatten@Map[Abs@Differences@# &, Partition[ IntegerDigits[n, b], 2, 1]], {n, z}] (* after Michael De Vlieger, e.g. A037834 *)
  • Python
    def A297330(n):
        s = str(n)
        return sum(abs(int(s[i])-int(s[i+1])) for i in range(len(s)-1)) # Chai Wah Wu, May 31 2022

A297270 Numbers whose base-10 digits have greater down-variation than up-variation; see Comments.

Original entry on oeis.org

10, 20, 21, 30, 31, 32, 40, 41, 42, 43, 50, 51, 52, 53, 54, 60, 61, 62, 63, 64, 65, 70, 71, 72, 73, 74, 75, 76, 80, 81, 82, 83, 84, 85, 86, 87, 90, 91, 92, 93, 94, 95, 96, 97, 98, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 201, 210, 211, 220, 221
Offset: 1

Views

Author

Clark Kimberling, Jan 16 2018

Keywords

Comments

Suppose that n has base-b digits b(m), b(m-1), ..., b(0). The base-b down-variation of n is the sum DV(n,b) of all d(i)-d(i-1) for which d(i) > d(i-1); the base-b up-variation of n is the sum UV(n,b) of all d(k-1)-d(k) for which d(k) < d(k-1). The total base-b variation of n is the sum TV(n,b) = DV(n,b) + UV(n,b). See the guide at A297330.
Differs first from A071590 at 1101, which is in A071590, but not in here because UV(1101) = DV(1101). - R. J. Mathar, Jan 23 2018

Examples

			6151413121 in base-10:  6,1,5,1,4,1,3,1,2,1, having DV = 15, UV = 10, so that 6151413121 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    g[n_, b_] := Map[Total, GatherBy[Differences[IntegerDigits[n, b]], Sign]];
    x[n_, b_] := Select[g[n, b], # < 0 &]; y[n_, b_] := Select[g[n, b], # > 0 &];
    b = 10; z = 2000; p = Table[x[n, b], {n, 1, z}]; q = Table[y[n, b], {n, 1, z}];
    w = Sign[Flatten[p /. {} -> {0}] + Flatten[q /. {} -> {0}]];
    Take[Flatten[Position[w, -1]], 120]   (* A297270 *)
    Take[Flatten[Position[w, 0]], 120]    (* A297271 *)
    Take[Flatten[Position[w, 1]], 120]    (* A297272 *)

A297272 Numbers whose base-10 digits have greater up-variation than down-variation; see Comments.

Original entry on oeis.org

12, 13, 14, 15, 16, 17, 18, 19, 23, 24, 25, 26, 27, 28, 29, 34, 35, 36, 37, 38, 39, 45, 46, 47, 48, 49, 56, 57, 58, 59, 67, 68, 69, 78, 79, 89, 102, 103, 104, 105, 106, 107, 108, 109, 112, 113, 114, 115, 116, 117, 118, 119, 122, 123, 124, 125, 126, 127, 128
Offset: 1

Views

Author

Clark Kimberling, Jan 16 2018

Keywords

Comments

Suppose that n has base-b digits b(m), b(m-1), ..., b(0). The base-b down-variation of n is the sum DV(n,b) of all d(i)-d(i-1) for which d(i) > d(i-1); the base-b up-variation of n is the sum UV(n,b) of all d(k-1)-d(k) for which d(k) < d(k-1). The total base-b variation of n is the sum TV(n,b) = DV(n,b) + UV(n,b). See the guide at A297330.
Differs from A071589 first at 1011 which is in A071589 but not in here because UV(1011) = DV(1011)=1. - R. J. Mathar, Jan 23 2018

Examples

			198765 in base-10:  1,9,8,7,6,5, having DV = 4, UV = 8, so that 198765 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    g[n_, b_] := Map[Total, GatherBy[Differences[IntegerDigits[n, b]], Sign]];
    x[n_, b_] := Select[g[n, b], # < 0 &]; y[n_, b_] := Select[g[n, b], # > 0 &];
    b = 10; z = 2000; p = Table[x[n, b], {n, 1, z}]; q = Table[y[n, b], {n, 1, z}];
    w = Sign[Flatten[p /. {} -> {0}] + Flatten[q /. {} -> {0}]];
    Take[Flatten[Position[w, -1]], 120]   (* A297270 *)
    Take[Flatten[Position[w, 0]], 120]    (* A297271 *)
    Take[Flatten[Position[w, 1]], 120]    (* A297272 *)

A342826 Numbers k such that d(1)^0 + d(2)^1 + ... + d(p)^(p-1) = d(1)^(p-1) + d(2)^(p-2) + ... + d(p)^0, where d(i), i=1..p, are the digits of k.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 101, 111, 121, 131, 141, 151, 161, 171, 181, 191, 202, 212, 222, 232, 242, 252, 262, 272, 282, 292, 303, 313, 323, 333, 343, 353, 363, 373, 383, 393, 404, 414, 424, 434, 444, 454, 464
Offset: 1

Views

Author

Carole Dubois, Mar 23 2021

Keywords

Comments

This sequence starts off like other palindromic sequences such as A178354, A002113, A110751, and A227858 but it differs starting at the 110th term: 109th: 1001, 110th: 1011, 111th: 1101, ..., 119th: 1863, etc.
Differs from A297271 (which e.g. has 1021, 1031, 1041,.. 1091 which are absent here). - R. J. Mathar, Sep 27 2021
Contains the palindromes, and palindromes where pairs of digits have been substituted by d(i)=0, d(p-i)=1 or d(i)=1, d(p-1)=0, and "genuine" numbers like 1863, 2450, 2804, 2814, 3681, 4081, 4182, 103221, 113221, 122301, 122311, 142023,.. - R. J. Mathar, Sep 27 2021

Examples

			1863 is in this sequence because 1^0 + 8^1 + 6^2 + 3^3 = 1^3 + 8^2 + 6^1 + 3^0 = 72.
		

Crossrefs

Cf. A002113 (subset), A179309, A110751, A227858.

Programs

  • Maple
    isA342826 := proc(n)
        local dgs ;
        dgs := convert(n,base,10) ;
        if  add(op(i,dgs)^(i-1),i=1..nops(dgs)) = add(op(-i,dgs)^(i-1),i=1..nops(dgs)) then
            true;
        else
            false;
        end if;
    end proc:
    A342826 := proc(n)
        option remember ;
        if n =1 then
            1;
        else
            for a from procname(n-1)+ 1 do
                if isA342826(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc: # R. J. Mathar, Sep 27 2021
  • Mathematica
    Select[Range[500],Mod[#,10]!=0&&Total[IntegerDigits[#]^Range[0,IntegerLength[ #]-1]]==Total[IntegerDigits[#]^Range[IntegerLength[#]-1,0,-1]]&] (* Harvey P. Dale, Jan 18 2023 *)
  • Python
    def digpow(s): return sum(int(d)**i for i, d in enumerate(s))
    def aupto(limit):
      alst = []
      for k in range(1, limit+1):
        s = str(k)
        if digpow(s) == digpow(s[::-1]): alst.append(k)
      return alst
    print(aupto(464)) # Michael S. Branicky, Mar 23 2021
Showing 1-4 of 4 results.