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

A103192 Trajectory of 1 under repeated application of the function n -> A102370(n).

Original entry on oeis.org

1, 3, 5, 15, 17, 19, 21, 31, 33, 35, 37, 47, 49, 51, 53, 63, 65, 67, 69, 79, 81, 83, 85, 95, 97, 99, 101, 111, 113, 115, 117, 127, 129, 131, 133, 143, 145, 147, 149, 159, 161, 163, 165, 175, 177, 179, 181, 191, 193, 195, 197, 207, 209, 211, 213, 223, 225, 227, 229, 239, 241
Offset: 1

Views

Author

Keywords

Comments

Agrees with A103127 for the first 511 terms, but then diverges. If a(n) is the present sequence and b(n) is A103127 we have:
.n...a(n)..b(n)..difference
.....................
509, 2033, 2033, 0
510, 2035, 2035, 0
511, 2037, 2037, 0
512, 4095, 2047, 2048
513, 4097, 2049, 2048
514, 4099, 2051, 2048
515, 4101, 2053, 2048
516, 4111, 2063, 2048
.....................
The sequence may be computed as follows (from Philippe Deléham, May 08 2005).
Start with -1, 1. Then add powers of 2 whose exponent n is not in A034797: 1, 3, 11, 2059, 2^2059 + 2059, ... This gives
Step 0: -1, 1
Step 1: add 2^2 = 4, getting 3, 5 and thus -1, 1, 3, 5.
Step 2: add 2^4 = 16, getting 15, 17, 19, 21 and thus -1, 1, 3, 5, 15, 17, 19, 21
Step 3: add 2^5 = 32, getting 31, 33, 35, 37, 47, 49, 51, 53 and thus -1, 1, 3, 5, 15, 17, 19, 21, 31, 33, 35, 37, 47, 49, 51, 53, etc.
The jump 2037 --> 4095 for n = 510 -> 511 is explained by the fact that we pass directly from 2^10 to 2^12 since 11 belongs to A034797.
The trajectories of 2 (A103747) and 7 (A103621) may surely be obtained in a similar way.

Programs

  • Haskell
    a103192 n = a103192_list !! (n-1)
    a103192_list = iterate (fromInteger . a102370) 1
    -- Reinhard Zumkeller, Jul 21 2012

A103621 Trajectory of 7 under repeated application of the map n -> A102370(n).

Original entry on oeis.org

7, 9, 11, 13, 23, 25, 27, 61, 71, 73, 75, 77, 87, 89, 91, 125, 135, 137, 139, 141, 151, 153, 155, 189, 199, 201, 203, 205, 215, 217, 219, 253, 263, 265, 267, 269, 279, 281, 283, 317, 327, 329, 331, 333, 343, 345, 347, 381, 391, 393, 395, 397, 407, 409, 411, 445
Offset: 1

Views

Author

Philippe Deléham, Mar 31 2005

Keywords

Comments

Initially, first differences are 8-periodic: 2,2,2,10,2,2,34,10. [Unsigned comment made accurate by Peter Munn, Jan 13 2024]

Crossrefs

Cf. A102370.
Trajectories of other numbers A103192 (1), A103747 (2), A158953 (12), A159887 (29).

Programs

  • 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 + n]; NestList[f, 7, 55] (* Robert G. Wilson v, Mar 30 2005 *)

Formula

Conjectures from Chai Wah Wu, Feb 01 2018: (Start)
a(n) = a(n-1) + a(n-8) - a(n-9) for n > 9.
G.f.: x*(3*x^8 + 34*x^7 + 2*x^6 + 2*x^5 + 10*x^4 + 2*x^3 + 2*x^2 + 2*x + 7)/(x^9 - x^8 - x + 1). (End)
The above conjectures are incompatible with A102370(2^37-37) = 2^38-3. - Peter Munn, Jan 13 2024

Extensions

More terms from Robert G. Wilson v, Mar 30 2005

A158953 Trajectory of 12 under repeated application of the map n -> A102370(n).

Original entry on oeis.org

12, 28, 44, 60, 76, 92, 108, 124, 140, 156, 172, 188, 204, 220, 236, 252, 268, 284, 300, 316, 332, 348, 364, 380, 396, 412, 428, 444, 460, 476, 492, 508, 524, 540, 556, 572, 588, 604, 620, 636, 652, 668, 684, 700, 716, 732, 748, 764, 780, 796, 812, 828, 844
Offset: 1

Views

Author

Philippe Deléham, Apr 01 2009

Keywords

Comments

Coincides with A098502 for at least 1400 terms. - R. J. Mathar, Apr 16 2009
Agrees with A098502 for the first 65535 terms. A098502(65535) = a(65535) = 1048556 = 2^20 - 20. A098502(65536) = 1048572 = 2^20 - 4; a(65536) = 2097148 = 2^21 - 4. - Philippe Deléham, Jan 05 2023

Crossrefs

Trajectories of other numbers: A103192 (1), A103747 (2), A103621 (7), A159887 (29).

A159887 Trajectory of 29 under repeated application of the map n -> A102370(n).

Original entry on oeis.org

29, 39, 41, 43, 45, 55, 57, 59, 93, 103, 105, 107, 109, 119, 121, 251, 285, 295, 297, 299, 301, 311, 313, 315, 349, 359, 361, 363, 365, 375, 377, 507, 541, 551, 553, 555, 557, 567, 569, 571, 605, 615, 617, 619, 621, 631, 633, 763, 797, 807, 809, 811, 813, 823, 825
Offset: 1

Views

Author

Philippe Deléham, Apr 25 2009

Keywords

Comments

Not the same as A159888: see the comments in A159888.
The divergence from A159888 follows from Theorem 3.1 in the Applegate, Cloitre, Deléham and Sloane link: in general, the first differences of an A102370 trajectory cannot be a cycle. - Peter Munn, Jan 14 2024

Crossrefs

Trajectories of other numbers: A103192 (1), A103747 (2), A103621 (7), A158953 (12).

Extensions

Missing term 617 inserted by Georg Fischer, Nov 28 2023

A132417 a(16j+i) = 8(16j+i) + e_i, for j >= 0, 0 <= i <= 15, where e_0, ..., e_15 are 2, -2, -6, -10, -14, -18, -22, -26, -30, -34, -38, -42, -46, -50, -54, 6.

Original entry on oeis.org

2, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, 58, 126, 130, 134, 138, 142, 146, 150, 154, 158, 162, 166, 170, 174, 178, 182, 186, 254, 258, 262, 266, 270, 274, 278, 282, 286, 290, 294, 298, 302, 306, 310, 314, 382, 386, 390, 394, 398, 402, 406, 410, 414
Offset: 0

Views

Author

Philippe Deléham, Nov 13 2007, Mar 29 2009

Keywords

Comments

Certainly by term n = 8*(2^119 - 1) = 10^36.72..., this sequence and A103747 disagree.
The point of divergence is substantially earlier, described precisely by Charlie Neder in his Feb 2019 comment in A103747. - Peter Munn, Jan 14 2024

Crossrefs

Cf. A102370 (Sloping binary numbers), A103747 (trajectory of 2).

Formula

a(n) = a(n-1) + a(n-16) - a(n-17). - R. J. Mathar, Jul 21 2013
G.f.: (2 + 4*x + 4*x^2 + 4*x^3 + 4*x^4 + 4*x^5 + 4*x^6 + 4*x^7 + 4*x^8 + 4*x^9 + 4*x^10 + 4*x^11 + 4*x^12 + 4*x^13 + 4*x^14 + 68*x^15 + 2*x^16 ) / ( (1+x) *(x^2+1) *(x^4+1) *(x^8+1) *(x-1)^2 ). - R. J. Mathar, Jul 21 2013
Showing 1-6 of 6 results.