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

A102370 "Sloping binary numbers": write numbers in binary under each other (right-justified), read diagonals in upward direction, convert to decimal.

Original entry on oeis.org

0, 3, 6, 5, 4, 15, 10, 9, 8, 11, 14, 13, 28, 23, 18, 17, 16, 19, 22, 21, 20, 31, 26, 25, 24, 27, 30, 61, 44, 39, 34, 33, 32, 35, 38, 37, 36, 47, 42, 41, 40, 43, 46, 45, 60, 55, 50, 49, 48, 51, 54, 53, 52, 63, 58, 57, 56, 59, 126, 93, 76, 71, 66, 65, 64, 67, 70, 69
Offset: 0

Views

Author

Philippe Deléham, Feb 13 2005

Keywords

Comments

All terms are distinct, but certain terms (see A102371) are missing. But see A103122.
Trajectory of 1 is 1, 3, 5, 15, 17, 19, 21, 31, 33, ..., see A103192.

Examples

			........0
........1
.......10
.......11
......100
......101
......110
......111
.....1000
.........
The upward-sloping diagonals are:
0
11
110
101
100
1111
1010
.......
giving 0, 3, 6, 5, 4, 15, 10, ...
The sequence has a natural decomposition into blocks (see the paper): 0; 3; 6, 5, 4; 15, 10, 9, 8, 11, 14, 13; 28, 23, 18, 17, 16, 19, 22, 21, 20, 31, 26, 25, 24, 27, 30; 61, ...
Reading the array of binary numbers along diagonals with slope 1 gives this sequence, slope 2 gives A105085, slope 0 gives A001477 and slope -1 gives A105033.
		

Crossrefs

Related sequences (1): A103542 (binary version), A102371 (complement), A103185, A103528, A103529, A103530, A103318, A034797, A103543, A103581, A103582, A103583.
Related sequences (2): A103584, A103585, A103586, A103587, A103127, A103192 (trajectory of 1), A103122, A103588, A103589, A103202 (sorted), A103205 (base 10 version).
Related sequences (3): A103747 (trajectory of 2), A103621, A103745, A103615, A103842, A103863, A104234, A104235, A103813, A105023, A105024, A105025, A105026, A105027, A105028.
Related sequences (4): A105029, A105030, A105031, A105032, A105033, A105034, A105035, A105108.

Programs

  • Haskell
    a102370 n = a102370_list !! n
    a102370_list = 0 : map (a105027 . toInteger) a062289_list
    -- Reinhard Zumkeller, Jul 21 2012
    
  • Maple
    A102370:=proc(n) local t1,l; t1:=n; for l from 1 to n do if n+l mod 2^l = 0 then t1:=t1+2^l; fi; od: t1; end;
  • Mathematica
    f[n_] := Block[{k = 1, s = 0, l = Max[2, Floor[Log[2, n + 1] + 2]]}, While[k < l, If[ Mod[n + k, 2^k] == 0, s = s + 2^k]; k++ ]; s]; Table[ f[n] + n, {n, 0, 71}] (* Robert G. Wilson v, Mar 21 2005 *)
  • PARI
    A102370(n)=n-1+sum(k=0,ceil(log(n+1)/log(2)),if((n+k)%2^k,0,2^k)) \\ Benoit Cloitre, Mar 20 2005
    
  • PARI
    {a(n) = if( n<1, 0, sum( k=0, length( binary( n)), bitand( n + k, 2^k)))} /* Michael Somos, Mar 26 2012 */
    
  • Python
    def a(n): return 0 if n<1 else sum([(n + k)&(2**k) for k in range(len(bin(n)[2:]) + 1)]) # Indranil Ghosh, May 03 2017

Formula

a(n) = n + Sum_{ k >= 1 such that n + k == 0 mod 2^k } 2^k. (Cf. A103185.) In particular, a(n) >= n. - N. J. A. Sloane, Mar 18 2005
a(n) = A105027(A062289(n)) for n > 0. - Reinhard Zumkeller, Jul 21 2012

Extensions

More terms from Benoit Cloitre, Mar 20 2005

A109681 "Sloping ternary numbers": write numbers in ternary under each other (right-justified), read diagonals in upward direction, convert to decimal.

Original entry on oeis.org

0, 1, 5, 3, 4, 8, 6, 16, 11, 9, 10, 14, 12, 13, 17, 15, 25, 20, 18, 19, 23, 21, 22, 26, 51, 34, 29, 27, 28, 32, 30, 31, 35, 33, 43, 38, 36, 37, 41, 39, 40, 44, 42, 52, 47, 45, 46, 50, 48, 49, 53, 78, 61, 56, 54, 55, 59, 57, 58, 62, 60, 70, 65, 63, 64, 68, 66
Offset: 0

Views

Author

Philippe Deléham, Aug 08 2005

Keywords

Comments

All terms are distinct, but certain terms (see A109682) are missing.
For the terms 3^k-1 (all 2's in ternary), the diagonal is not started at the leading 2, but at the leading 1 of the following term. - Georg Fischer, Mar 13 2020

Examples

			number diagonal decimal
    0      0     0
    1      1     1
    2     12     5
   10     10     3
   11     11     4
   12     22     8
   20     20     6
   21    121    16
   22    102    11
  100    100     9
  101    101    10
  102    112    14
  110    110    12
  11.    ...   ...
  1.
  .
		

Crossrefs

Cf. A109682 (complement), A109683 (ternary version), A109684.
Cf. A102370 (base 2), A325644 (base 4), A325645 (base 5), A325692 (base 6), A325693 (base 7), A325805 (base 8), A325829 (base 9), A103205 (base 10).
Cf. A030341.

Programs

  • Haskell
    a109681 n = a109681_list !! n
    a109681_list = map (foldr (\d v -> 3 * v + d) 0) $ f a030341_tabf where
       f vss = (g 0 vss) : f (tail vss)
       g k (ws:wss) = if k < length ws then ws !! k : g (k + 1) wss else []
    -- Reinhard Zumkeller, Nov 19 2013
    
  • Maple
    t:= (n, i)-> (d-> `if`(i=0, d, t(m, i-1)))(irem(n, 3, 'm')):
    b:= (n, i)-> `if`(3^i>n, 0, t(n,i) +3*b(n+1, i+1)):
    a:= n-> b(n, 0):
    seq(a(n), n=0..100);  # Alois P. Heinz, Mar 13 2020
  • Perl
    Cf. link.

Extensions

Conjectured g.f. and recurrence removed by Georg Fischer, Mar 13 2020

A325644 "Sloping quaternary numbers": write numbers in quaternary under each other (right-justified), read diagonals in upward direction, convert to decimal.

Original entry on oeis.org

0, 1, 2, 7, 4, 5, 6, 11, 8, 9, 10, 15, 12, 13, 30, 19, 16, 17, 18, 23, 20, 21, 22, 27, 24, 25, 26, 31, 28, 29, 46, 35, 32, 33, 34, 39, 36, 37, 38, 43, 40, 41, 42, 47, 44, 45, 62, 51, 48, 49, 50, 55, 52, 53, 54, 59, 56, 57, 58, 63, 60, 125, 78, 67, 64, 65, 66, 71, 68, 69, 70
Offset: 0

Views

Author

Seiichi Manyama, Sep 07 2019

Keywords

Examples

			    0
    1
    2
    3
   10
   11
   12
   13
   20
   21
   22
   23
   30
   31
   32
   33
  100
...
The upward-sloping diagonals are:
0
1
2
13
10
11
12
23
20
21
22
33
30
31
132
103
100
...
giving 0, 1, 2, "7", 4, 5, 6, "11", 8, 9, 10, "15", 12, 13, "30", "19", 16, ...
		

Crossrefs

Cf. A102370 (base 2), A109681 (base3), this sequence (base 4), A325645 (base 5), A325692 (base 6), A325693 (base 7), A325805 (base 8), A325829 (base 9), A103205 (base 10).

Programs

  • Ruby
    def A(m, n)
      ary = [0]
      n.times{|i|
        (m ** i - i..m ** (i + 1) - i - 2).each{|j|
          ary << (0..i).inject(0){|s, k| s + (j + k).to_s(m)[-1 - k].to_i * m ** k}
        }
      }
      ary
    end
    p A(4, 4)

A325645 "Sloping quinary numbers": write numbers in quinary under each other (right-justified), read diagonals in upward direction, convert to decimal.

Original entry on oeis.org

0, 1, 2, 3, 9, 5, 6, 7, 8, 14, 10, 11, 12, 13, 19, 15, 16, 17, 18, 24, 20, 21, 22, 48, 29, 25, 26, 27, 28, 34, 30, 31, 32, 33, 39, 35, 36, 37, 38, 44, 40, 41, 42, 43, 49, 45, 46, 47, 73, 54, 50, 51, 52, 53, 59, 55, 56, 57, 58, 64, 60, 61, 62, 63, 69, 65, 66, 67, 68, 74, 70, 71
Offset: 0

Views

Author

Seiichi Manyama, Sep 07 2019

Keywords

Crossrefs

Cf. A102370 (base 2), A109681 (base3), A325644 (base 4), this sequence (base 5), A325692 (base 6), A325693 (base 7), A325805 (base 8), A325829 (base 9), A103205 (base 10).

Programs

  • Ruby
    def A(m, n)
      ary = [0]
      n.times{|i|
        (m ** i - i..m ** (i + 1) - i - 2).each{|j|
          ary << (0..i).inject(0){|s, k| s + (j + k).to_s(m)[-1 - k].to_i * m ** k}
        }
      }
      ary
    end
    p A(5, 3)

A325692 "Sloping senary numbers": write numbers in senary (that is, base 6) under each other (right-justified), read diagonals in upward direction, convert to decimal.

Original entry on oeis.org

0, 1, 2, 3, 4, 11, 6, 7, 8, 9, 10, 17, 12, 13, 14, 15, 16, 23, 18, 19, 20, 21, 22, 29, 24, 25, 26, 27, 28, 35, 30, 31, 32, 33, 70, 41, 36, 37, 38, 39, 40, 47, 42, 43, 44, 45, 46, 53, 48, 49, 50, 51, 52, 59, 54, 55, 56, 57, 58, 65, 60, 61, 62, 63, 64, 71, 66, 67, 68, 69, 106, 77, 72
Offset: 0

Views

Author

Seiichi Manyama, Sep 07 2019

Keywords

Crossrefs

Cf. A102370 (base 2), A109681 (base 3), A325644 (base 4), A325645 (base 5), this sequence (base 6), A325693 (base 7), A325805 (base 8), A325829 (base 9), A103205 (base 10).

A325693 "Sloping septenary numbers": write numbers in septenary under each other (right-justified), read diagonals in upward direction, convert to decimal.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 13, 7, 8, 9, 10, 11, 12, 20, 14, 15, 16, 17, 18, 19, 27, 21, 22, 23, 24, 25, 26, 34, 28, 29, 30, 31, 32, 33, 41, 35, 36, 37, 38, 39, 40, 48, 42, 43, 44, 45, 46, 96, 55, 49, 50, 51, 52, 53, 54, 62, 56, 57, 58, 59, 60, 61, 69, 63, 64, 65, 66, 67, 68, 76, 70, 71
Offset: 0

Views

Author

Seiichi Manyama, Sep 07 2019

Keywords

Crossrefs

Cf. A102370 (base 2), A109681 (base 3), A325644 (base 4), A325645 (base 5), A325692 (base 6), this sequence (base 7), A325805 (base 8), A325829 (base 9), A103205 (base 10).

A325805 "Sloping octal numbers": write numbers in octal under each other (right-justified), read diagonals in upward direction, convert to decimal.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 15, 8, 9, 10, 11, 12, 13, 14, 23, 16, 17, 18, 19, 20, 21, 22, 31, 24, 25, 26, 27, 28, 29, 30, 39, 32, 33, 34, 35, 36, 37, 38, 47, 40, 41, 42, 43, 44, 45, 46, 55, 48, 49, 50, 51, 52, 53, 54, 63, 56, 57, 58, 59, 60, 61, 126, 71, 64, 65, 66, 67, 68, 69, 70, 79
Offset: 0

Views

Author

Seiichi Manyama, Sep 07 2019

Keywords

Crossrefs

Cf. A102370 (base 2), A109681 (base 3), A325644 (base 4), A325645 (base 5), A325692 (base 6), A325693 (base 7), this sequence (base 8), A325829 (base 9), A103205 (base 10).

A325829 "Sloping nonary numbers": write numbers in nonary under each other (right-justified), read diagonals in upward direction, convert to decimal.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 17, 9, 10, 11, 12, 13, 14, 15, 16, 26, 18, 19, 20, 21, 22, 23, 24, 25, 35, 27, 28, 29, 30, 31, 32, 33, 34, 44, 36, 37, 38, 39, 40, 41, 42, 43, 53, 45, 46, 47, 48, 49, 50, 51, 52, 62, 54, 55, 56, 57, 58, 59, 60, 61, 71, 63, 64, 65, 66, 67, 68, 69, 70
Offset: 0

Views

Author

Seiichi Manyama, Sep 07 2019

Keywords

Crossrefs

Cf. A102370 (base 2), A109681 (base 3), A325644 (base 4), A325645 (base 5), A325692 (base 6), A325693 (base 7), A325805 (base 8), this sequence (base 9), A103205 (base 10).
Showing 1-8 of 8 results.