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 90 results. Next

A354212 Numbers k such that A297330(k)*k and k have the same digits but in a different order.

Original entry on oeis.org

11688, 116688, 126888, 1166688, 1266888, 11666688, 12446778, 12666888, 116666688, 123456789, 124466778, 126666888
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, May 19 2022

Keywords

Comments

Contains all numbers of the forms 116...688, 12446...6778, and 126...6888 (with at least one 6).
All terms are divisible by 3.

Examples

			a(1) = 11688 is a term because A297330(11688) = 7 and 7*11688 = 81816 has the same digits as 11688 in a different order.
		

Crossrefs

Cf. A297330.

Programs

  • Maple
    filter:= proc(n) local L,m;
      L:= convert(n,base,10);
      m:= convert(map(abs,L[2..-1]-L[1..-2]),`+`);
      if m = 1 then return false fi;
      sort(L) = sort(convert(m*n,base,10))
    end proc:
    select(filter, [seq(i,i=3..10^7,3)]);
  • PARI
    f(n) = my(d=digits(n)); sum(i=2, #d, if (d[i]d[i-1], d[i]-d[i-1])); \\ A297330
    isok(k) = my(d=digits(k), dd = digits(k*f(k))); (d != dd) && vecsort(d) == vecsort(dd); \\ Michel Marcus, May 19 2022
    
  • Python
    from itertools import count, islice
    def A354212_gen(startvalue=1): # generator of terms >= startvalue
        for n in count(max(startvalue,1)):
            s = str(n)
            t = str(n*sum(abs(int(s[i])-int(s[i+1])) for i in range(len(s)-1)))
            if s != t and sorted(s) == sorted(t):
                yield n
    A354212_list = list(islice(A354212_gen(),5)) # Chai Wah Wu, May 31 2022

A033264 Number of blocks of {1,0} in the binary expansion of n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Number of i such that d(i) < d(i-1), where Sum_{d(i)*2^i: i=0,1,....,m} is base 2 representation of n.
This is the base-2 down-variation sequence; see A297330. - Clark Kimberling, Jan 18 2017

Crossrefs

a(n) = A005811(n) - ceiling(A005811(n)/2) = A005811(n) - A069010(n).
Equals (A072219(n+1)-1)/2.
Cf. also A175047, A030308.
Essentially the same as A087116.

Programs

  • Haskell
    a033264 = f 0 . a030308_row where
       f c [] = c
       f c (0 : 1 : bs) = f (c + 1) bs
       f c (_ : bs) = f c bs
    -- Reinhard Zumkeller, Feb 20 2014, Jun 17 2012
    
  • Maple
    f:= proc(n) option remember; local k;
    k:= n mod 4;
    if k = 2 then procname((n-2)/4) + 1
    elif k = 3 then procname((n-3)/4)
    else procname((n-k)/2)
    fi
    end proc:
    f(1):= 0: f(0):= q:
    seq(f(i),i=1..100); # Robert Israel, Aug 31 2015
  • Mathematica
    Table[Count[Partition[IntegerDigits[n, 2], 2, 1], {1, 0}], {n, 102}] (* Michael De Vlieger, Aug 31 2015, after Robert G. Wilson v at A014081 *)
    Table[SequenceCount[IntegerDigits[n,2],{1,0}],{n,110}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jan 26 2017 *)
  • PARI
    a(n) = { hammingweight(bitand(n>>1, bitneg(n))) }; \\ Gheorghe Coserea, Aug 30 2015
    
  • Python
    def A033264(n): return ((n>>1)&~n).bit_count() # Chai Wah Wu, Jun 25 2025

Formula

G.f.: 1/(1-x) * Sum_(k>=0, t^2/(1+t)/(1+t^2), t=x^2^k). - Ralf Stephan, Sep 10 2003
a(n) = A069010(n) - (n mod 2). - Ralf Stephan, Sep 10 2003
a(4n) = a(4n+1) = a(2n), a(4n+2) = a(n)+1, a(4n+3) = a(n). - Ralf Stephan, Aug 20 2003
a(n) = A087116(n) for n > 0, since strings of 0's alternate with strings of 1's, which end in (1,0). - Jonathan Sondow, Jan 17 2016
Sum_{n>=1} a(n)/(n*(n+1)) = Pi/4 - log(2)/2 (A196521) (Allouche and Shallit, 1990). - Amiram Eldar, Jun 01 2021

A037800 Number of occurrences of 01 in the binary expansion of n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Number of i such that d(i)>d(i-1), where Sum{d(i)*2^i: i=0,1,...,m} is base 2 representation of n.
This is the base-2 up-variation sequence; see A297330. - Clark Kimberling, Jan 18 2017

Crossrefs

Programs

  • Haskell
    a037800 = f 0 . a030308_row where
       f c [_]          = c
       f c (1 : 0 : bs) = f (c + 1) bs
       f c (_ : bs)     = f c bs
    -- Reinhard Zumkeller, Feb 20 2014
    
  • Mathematica
    Table[SequenceCount[IntegerDigits[n,2],{0,1}],{n,0,120}] (* Harvey P. Dale, Aug 10 2023 *)
  • PARI
    a(n) = { if(n == 0, 0, -1 + hammingweight(bitnegimply(n, n>>1))) };  \\ Gheorghe Coserea, Aug 31 2015

Formula

a(2n) = a(n), a(2n+1) = a(n) + [n is even]. - Ralf Stephan, Aug 21 2003
G.f.: 1/(1-x) * Sum_{k>=0} t^5/(1+t)/(1+t^2) where t=x^2^k. - Ralf Stephan, Sep 10 2003
a(n) = A069010(n) - 1, n>0. - Ralf Stephan, Sep 10 2003
Sum_{n>=1} a(n)/(n*(n+1)) = log(2)/2 + Pi/4 - 1 = A231902 - 1 (Allouche and Shallit, 1990). - Amiram Eldar, Jun 01 2021

A297250 Numbers whose base-3 digits having equal up-variation and down-variation; see Comments.

Original entry on oeis.org

1, 2, 4, 8, 10, 13, 16, 20, 23, 26, 28, 31, 34, 37, 40, 43, 46, 49, 52, 56, 59, 62, 65, 68, 71, 74, 77, 80, 82, 85, 88, 91, 94, 97, 100, 103, 106, 109, 112, 115, 118, 121, 124, 127, 130, 133, 136, 139, 142, 145, 148, 151, 154, 157, 160, 164, 167, 170, 173
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

			173 in base-3:  2,0,1,0,2, having DV = 3, UV = 3, so that 173 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 *)

A037851 a(n)=Sum{d(i-1)-d(i): d(i)

Original entry on oeis.org

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

Views

Author

Keywords

Comments

This is the base-10 up-variation sequence; see A297330.

Crossrefs

Programs

  • Maple
    A037851 := proc(n)
        a := 0 ;
        dgs := convert(n,base,10);
        for i from 2 to nops(dgs) do
            if op(i,dgs)R. J. Mathar, Oct 19 2015
  • Mathematica
    g[n_, b_] := Differences[IntegerDigits[n, b]]; b = 10; z = 120;
    Table[-Total[Select[g[n, b], # < 0 &]], {n, 1, z}];  (*A037860*)
    Table[Total[Select[g[n, b], # > 0 &]], {n, 1, z}];   (*A037851*)

Extensions

Definition swapped with A037860. - R. J. Mathar, Oct 19 2015
Updated by Clark Kimberling, Jan 19 2018

A297271 Numbers whose base-10 digits have equal down-variation and up-variation; see Comments.

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, 474, 484
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 after the zero from A002113 first at 1011, which is not a palindrome but has DV(1011,10) = UV(1011,10) =1. - R. J. Mathar, Jan 23 2018
Apart from 0, the initial terms coincide with those of A266140, but the two sequences are different. First disagreement: a(109) = 1001 and A266140(110) = 1111. - Georg Fischer, Oct 09 2018

Examples

			13601 in base-10:  1,3,6,0,1, having DV = 6, UV = 6, so that 13601 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 *)

Formula

{k: A037851(k) = A037860(k)}. - R. J. Mathar, Sep 27 2021

A037846 a(n)=Sum{d(i-1)-d(i): d(i)

Original entry on oeis.org

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

Views

Author

Keywords

Comments

This is the base-5 up-variation sequence; see A297330. - Clark Kimberling, Jan 19 2017

Crossrefs

Cf. A297330.

Programs

  • Maple
    A037846 := proc(n)
        a := 0 ;
        dgs := convert(n,base,5);
        for i from 2 to nops(dgs) do
            if op(i,dgs)R. J. Mathar, Oct 19 2015
  • Mathematica
    g[n_, b_] := Differences[IntegerDigits[n, b]]; b = 5; z = 120;
    Table[-Total[Select[g[n, b], # < 0 &]], {n, 1, z}];  (*A037855*)
    Table[Total[Select[g[n, b], # > 0 &]], {n, 1, z}];   (*A037846*)

Extensions

Definition swapped with A037855. - R. J. Mathar, Oct 19 2015
Updated by Clark Kimberling, Jan 19 2018

A037847 a(n)=Sum{d(i-1)-d(i): d(i)

Original entry on oeis.org

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

Views

Author

Keywords

Comments

This is the base-6 up-variation sequence; see A297330. - Clark Kimberling, Jan 18 2017

Crossrefs

Cf. A297330.

Programs

  • Maple
    A037847 := proc(n)
        a := 0 ;
        dgs := convert(n,base,6);
        for i from 2 to nops(dgs) do
            if op(i,dgs)R. J. Mathar, Oct 19 2015
  • Mathematica
    g[n_, b_] := Differences[IntegerDigits[n, b]]; b = 6; z = 120;
    Table[-Total[Select[g[n, b], # < 0 &]], {n, 1, z}];  (*A037856*)
    Table[Total[Select[g[n, b], # > 0 &]], {n, 1, z}];   (*A037847*)

Extensions

Definition swapped with A037856. - R. J. Mathar, Oct 19 2015
Updated by Clark Kimberling, Jan 19 2018

A037857 Sum{d(i)-d(i-1): d(i)>d(i-1), i=1,...,m}, where Sum{d(i)*7^i: i=0,1,...,m} is base 7 representation of n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

This is the base-7 down-variation sequence; see A297330. - Clark Kimberling, Jan 18 2017

Programs

  • Maple
    A037857 := proc(n)
        a := 0 ;
        dgs := convert(n,base,7);
        for i from 2 to nops(dgs) do
            if op(i,dgs)>op(i-1,dgs) then
                a := a+op(i,dgs)-op(i-1,dgs) ;
            end if;
        end do:
        a ;
    end proc: # R. J. Mathar, Oct 19 2015
  • Mathematica
    g[n_, b_] := Differences[IntegerDigits[n, b]]; b = 7; z = 120;
    Table[-Total[Select[g[n, b], # < 0 &]], {n, 1, z}];  (*A037857*)
    Table[Total[Select[g[n, b], # > 0 &]], {n, 1, z}];   (*A037848*)

Extensions

Definition swapped with A037848. - R. J. Mathar, Oct 19 2015
Updated by Clark Kimberling, Jan 19 2018

A037860 Sum{d(i)-d(i-1): d(i)>d(i-1), i=1,...,m}, where Sum{d(i)*10^i: i=0,1,...,m} is base 10 representation of n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

This is the base-10 down-variation sequence; see A297330.

Crossrefs

Programs

  • Maple
    A037860 := proc(n)
        a := 0 ;
        dgs := convert(n,base,10);
        for i from 2 to nops(dgs) do
            if op(i,dgs)>op(i-1,dgs) then
                a := a+op(i,dgs)-op(i-1,dgs) ;
            end if;
        end do:
        a ;
    end proc: # R. J. Mathar, Oct 19 2015
  • Mathematica
    g[n_, b_] := Differences[IntegerDigits[n, b]]; b = 10; z = 120;
    Table[-Total[Select[g[n, b], # < 0 &]], {n, 1, z}];  (*A037860*)
    Table[Total[Select[g[n, b], # > 0 &]], {n, 1, z}];   (*A037851*)

Extensions

Definition swapped with A037851. - R. J. Mathar, Oct 19 2015
Updated by Clark Kimberling, Jan 19 2018
Showing 1-10 of 90 results. Next