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-5 of 5 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

A297249 Numbers whose base-3 digits have greater down-variation than up-variation; see Comments.

Original entry on oeis.org

3, 6, 7, 9, 12, 15, 18, 19, 21, 22, 24, 25, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 55, 57, 58, 60, 61, 63, 64, 66, 67, 69, 70, 72, 73, 75, 76, 78, 79, 81, 84, 87, 90, 93, 96, 99, 102, 105, 108, 111, 114, 117, 120, 123, 126, 129, 132, 135, 138, 141, 144, 147
Offset: 1

Views

Author

Clark Kimberling, Jan 15 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.

Examples

			147 in base-3:  1,3,1,1,0, having DV = 3, UV = 2, so that 147 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 = 3; 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]   (* A297249 *)
    Take[Flatten[Position[w, 0]], 120]    (* A297250 *)
    Take[Flatten[Position[w, 1]], 120]    (* A297251 *)

A297251 Numbers whose base-3 digits have greater up-variation than down-variation; see Comments.

Original entry on oeis.org

5, 11, 14, 17, 29, 32, 35, 38, 41, 44, 47, 50, 53, 83, 86, 89, 92, 95, 98, 101, 104, 107, 110, 113, 116, 119, 122, 125, 128, 131, 134, 137, 140, 143, 146, 149, 152, 155, 158, 161, 245, 248, 251, 254, 257, 260, 263, 266, 269, 272, 275, 278, 281, 284, 287, 290
Offset: 1

Views

Author

Clark Kimberling, Apr 10 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.

Examples

			290 in base-3:  1,0,1,2,0,2, having DV = 3, UV = 4, so that 147 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 = 3; 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]   (* A297249 *)
    Take[Flatten[Position[w, 0]], 120]    (* A297250 *)
    Take[Flatten[Position[w, 1]], 120]    (* A297251 *)

A361818 For any number k >= 0, let T_k be the triangle whose base corresponds to the ternary expansion of k (without leading zeros) and other values, say t above u and v, satisfy t = (-u-v) mod 3; this sequence lists the numbers k such that T_k has 3-fold rotational symmetry.

Original entry on oeis.org

0, 1, 2, 4, 8, 13, 26, 34, 40, 46, 59, 65, 80, 112, 121, 130, 224, 233, 242, 304, 364, 424, 518, 578, 728, 772, 862, 925, 1003, 1093, 1183, 1261, 1324, 1414, 1535, 1598, 1688, 1766, 1856, 1919, 2006, 2096, 2186, 2257, 2509, 2734, 3028, 3280, 3532, 3826, 4051
Offset: 1

Views

Author

Rémy Sigrist, Mar 25 2023

Keywords

Comments

We can devise a similar sequence for any fixed base b >= 2; the present sequence corresponds to b = 3, and A334556 corresponds to b = 2.
This sequence is infinite as it contains A048328.
If k belongs to the sequence, then A004488(k) and A030102(k) belong to the sequence.
Empirically, there are 2*3^floor((w-1)/3) positive terms with w ternary digits.
For any k, if t appears above u and v in T_k, then t + u + v = 0 (mod 3) and #{t, u, v} = 1 or 3 (the three values are either equal or all distinct); each value is uniquely determined by the two others in the same way: t = (-u-v) mod 3, u = (-t-v) mod 3, v = (-t-u) mod 3; this means that we can reconstruct T_k from any of its three sides.
If some row of T_k, say r, has w values and corresponds to the ternary expansion of m, then the row above r corresponds to the w-1 rightmost digits of the ternary expansion of A060587(m).
All positive terms belong to A297250 (their most significant digit equals their least significant digit in base 3).

Examples

			The ternary expansion of 304 is "102021", and the corresponding triangle is:
             1
            0 2
           2 1 0
          0 1 1 2
         2 1 1 1 0
        1 0 2 0 2 1
As this triangle has 3-fold rotational symmetry, 304 belongs to the sequence.
		

Crossrefs

Programs

  • PARI
    See Links section.

A361827 For any number k >= 0, let T_k be the triangle whose base corresponds to the ternary expansion of k (without leading zeros) and other values, say t above u and v, satisfy t = (-u-v) mod 3; this sequence lists the numbers k such that the configurations of 0's, 1's and 2's in T_k are the same up to rotation.

Original entry on oeis.org

3, 5, 6, 7, 11, 15, 19, 21, 84, 93, 102, 140, 149, 158, 168, 177, 186, 196, 205, 214, 308, 318, 351, 377, 410, 420, 528, 532, 574, 588, 702, 715, 2271, 2396, 2523, 2621, 2775, 2873, 2933, 3150, 3185, 3375, 3410, 3627, 3687, 3785, 3939, 4037, 4164, 4289, 4519
Offset: 1

Views

Author

Rémy Sigrist, Mar 26 2023

Keywords

Comments

This sequence is a variant of A361818.
If k belongs to the sequence, then A004488(k) belongs to the sequence.
The ternary lengths of terms belong to A007494 (as the number of values in triangles must be divisible by 3).
This sequence is infinite as it contains the numbers whose ternary digits match the regular expression "(210)+".
Empirically, there are 4*3^floor((w-1)/2) terms with w ternary digits.
No term belongs to A297250.

Examples

			The ternary expansion of 149 is "12112", and the corresponding triangle is:
            0
           1 2
          0 2 2
         0 0 1 0
        1 2 1 1 2
The configurations of 0's, 1's and 2's are the same up to rotation, so 149 belongs to this sequence:
            0            .            .
           . .          1 .          . 2
          0 . .        . . .        . 2 2
         0 0 . 0      . . 1 .      . . . .
        . . . . .    1 . 1 1 .    . 2 . . 2
		

Crossrefs

Programs

  • PARI
    See Links section.
Showing 1-5 of 5 results.