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.

Previous Showing 11-20 of 53 results. Next

A318557 Number A(n,k) of n-member subsets of [k*n] whose elements sum to a multiple of k; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 2, 1, 0, 1, 1, 5, 10, 1, 0, 1, 1, 6, 30, 38, 1, 0, 1, 1, 9, 55, 165, 126, 1, 0, 1, 1, 10, 91, 460, 1001, 452, 1, 0, 1, 1, 13, 138, 969, 3876, 6198, 1716, 1, 0, 1, 1, 14, 190, 1782, 10630, 33594, 38760, 6470, 1, 0, 1, 1, 17, 253, 2925, 23751, 118755, 296010, 245157, 24310, 1, 0
Offset: 0

Views

Author

Alois P. Heinz, Aug 28 2018

Keywords

Comments

The sequence of row n satisfies a linear recurrence with constant coefficients of order A018804(n) for n>0.

Examples

			A(3,2) = 10: {1,2,3}, {1,2,5}, {1,3,4}, {1,3,6}, {1,4,5}, {1,5,6}, {2,3,5}, {2,4,6}, {3,4,5}, {3,5,6}.
A(2,3) = 5: {1,2}, {1,5}, {2,4}, {3,6}, {4,5}.
Square array A(n,k) begins:
  1, 1,    1,     1,      1,       1,       1,        1, ...
  0, 1,    1,     1,      1,       1,       1,        1, ...
  0, 1,    2,     5,      6,       9,      10,       13, ...
  0, 1,   10,    30,     55,      91,     138,      190, ...
  0, 1,   38,   165,    460,     969,    1782,     2925, ...
  0, 1,  126,  1001,   3876,   10630,   23751,    46376, ...
  0, 1,  452,  6198,  33594,  118755,  324516,   749398, ...
  0, 1, 1716, 38760, 296010, 1344904, 4496388, 12271518, ...
		

Crossrefs

Main diagonal gives A318477.

Programs

  • Mathematica
    nmax = 11; (* Program not suitable to compute a large number of terms. *)
    A[n_, k_] := A[n, k] = Count[Subsets[Range[k n], {n}], s_ /; Divisible[Total[s], k]]; A[0, _] = 1;
    Table[A[n - k, k], {n, 0, nmax}, {k, n, 0, -1}] // Flatten (* Jean-François Alcover, Oct 04 2019 *)

A014493 Odd triangular numbers.

Original entry on oeis.org

1, 3, 15, 21, 45, 55, 91, 105, 153, 171, 231, 253, 325, 351, 435, 465, 561, 595, 703, 741, 861, 903, 1035, 1081, 1225, 1275, 1431, 1485, 1653, 1711, 1891, 1953, 2145, 2211, 2415, 2485, 2701, 2775, 3003, 3081, 3321, 3403, 3655, 3741, 4005, 4095, 4371, 4465, 4753, 4851
Offset: 1

Views

Author

Keywords

Comments

Odd numbers of the form n*(n+1)/2.
For n such that n(n+1)/2 is odd see A042963 (congruent to 1 or 2 mod 4).
Even central polygonal numbers minus 1. - Omar E. Pol, Aug 17 2011
Odd generalized hexagonal numbers. - Omar E. Pol, Sep 24 2015

References

  • E. Deza and M. M. Deza, Figurate numbers, World Scientific Publishing (2012), page 68.

Crossrefs

Programs

  • GAP
    List([1..50], n -> (2*n-1)*(2*n-1-(-1)^n)/2); # G. C. Greubel, Feb 09 2019
    
  • Magma
    [(2*n-1)*(2*n-1-(-1)^n)/2: n in [1..50]]; // Vincenzo Librandi, Aug 18 2011
    
  • Maple
    [(2*n-1)*(2*n-1-(-1)^n)/2$n=1..50]; # Muniru A Asiru, Mar 10 2019
  • Mathematica
    Select[ Table[n(n + 1)/2, {n, 93}], OddQ[ # ] &] (* Robert G. Wilson v, Nov 05 2004 *)
    LinearRecurrence[{1,2,-2,-1,1},{1,3,15,21,45},50] (* Harvey P. Dale, Jun 19 2011 *)
  • PARI
    a(n)=(2*n-1)*(2*n-1-(-1)^n)/2 \\ Charles R Greathouse IV, Sep 24 2015
    
  • Python
    def A014493(n): return ((n<<1)-1)*(n-(n&1^1)) # Chai Wah Wu, Feb 12 2023
  • Sage
    [(2*n-1)*(2*n-1-(-1)^n)/2 for n in (1..50)] # G. C. Greubel, Feb 09 2019
    

Formula

From Ant King, Nov 17 2010: (Start)
a(n) = (2*n-1)*(2*n - 1 - (-1)^n)/2.
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5). (End)
G.f.: x*(1 + 2*x + 10*x^2 + 2*x^3 + x^4)/((1+x)^2*(1-x)^3). - Maksym Voznyy (voznyy(AT)mail.ru), Aug 10 2009
a(n) = A000217(A042963(n)). - Reinhard Zumkeller, Feb 14 2012, Oct 04 2004
a(n) = A193868(n) - 1. - Omar E. Pol, Aug 17 2011
Let S = Sum_{n>=0} x^n/a(n), then S = Q(0) where Q(k) = 1 + x*(4*k+1)/(4*k + 3 - x*(2*k+1)*(4*k+3)^2/(x*(2*k+1)*(4*k+3) + (4*k+5)*(2*k+3)/Q(k+1) )); (recursively defined continued fraction). - Sergei N. Gladkovskii, Feb 27 2013
E.g.f.: (2*x^2+x+1)*cosh(x)+x*(2*x-1)*sinh(x)-1. - Ilya Gutkovskiy, Apr 24 2016
Sum_{n>=1} 1/a(n) = Pi/2 (A019669). - Robert Bilinski, Jan 20 2021
Sum_{n>=1} (-1)^(n+1)/a(n) = log(2). - Amiram Eldar, Mar 06 2022

Extensions

More terms from Erich Friedman

A112060 Square array A(x,y) = y-th natural number k for which A112049(k)=x and 0 if no such k exists; read by antidiagonals A(1,1), A(2,1), A(1,2), A(3,1), A(2,2), ...

Original entry on oeis.org

1, 2, 3, 5, 4, 11, 6, 7, 12, 24, 9, 8, 23, 35, 60, 10, 15, 36, 59, 155, 84, 13, 16, 47, 95, 275, 239, 144, 14, 19, 48, 119, 335, 575, 779, 180, 17, 20, 71, 120, 359, 659, 1499, 2855, 264, 18, 27, 72, 179, 419, 839, 1535, 4199, 5279, 420, 21, 28, 83, 204, 504
Offset: 1

Views

Author

Antti Karttunen, Aug 27 2005

Keywords

Comments

This is a permutation of natural numbers provided that the sequence A112046 contains only prime values [which is true] and every prime occurs infinitely many times there.

Examples

			The top left corner of the array:
   1,  2,  5,  6,  9, 10, ...
   3,  4,  7,  8, 15, 16, ...
  11, 12, 23, 36, 47, ...
		

Crossrefs

A112070(x, y) = 2*A(X, Y)+1. Transpose: A112061. Column 1: A112051. Row 1: A042963, Row 2: A112062, Row 3: A112063, Row 4: A112064, Row 5: A112065, Row 6: A112066, Row 7: A112067, Row 8: A112068, Row 9: A112069.
Cf. also A227196.

A289840 Complex cross sequence (see Comments lines for definition).

Original entry on oeis.org

0, 1, 3, 11, 19, 27, 35, 67, 83, 99, 115, 163, 179, 195, 211, 275, 323, 355, 387, 467, 483, 499, 515, 579, 627, 675, 707, 787, 803, 819, 835, 899, 947, 995, 1027, 1107, 1123, 1139, 1155, 1219, 1267, 1315, 1347, 1427, 1443, 1459, 1475, 1539, 1587, 1635, 1667, 1747, 1763, 1779, 1795, 1859, 1907, 1955, 1987, 2067
Offset: 0

Views

Author

Omar E. Pol, Jul 14 2017

Keywords

Comments

The sequence arises from a "hybrid" cellular automaton on the infinite square grid, which consist of two successive generations using toothpicks of length 2 (cf. A139250) followed by two successive generations using the rules of the D-toothpick sequence A220500.
In other words (and more precisely) we have that:
1) If n is congruent to 1 or 2 mod 4 (cf. A042963), for example: 1, 2, 5, 6, 9, 10, ..., the elements added to the structure at n-th stage must be toothpicks of length 2. These toothpicks are connected to the structure by their midpoints.
2) If n is a positive integer of the form 4*k-1 (cf. A004767), for example: 3, 7, 11, 15, ..., the elements added to the structure at n-th stage must be D-toothpicks of length sqrt(2) and eventually D-toothpicks of length sqrt(2)/2, in both cases the D-toothpicks are connected to the structure by their endpoints, in the same way as in the even-indexed stages of A220500.
3) If n is a positive multiple of 4 (cf. A008586) the elements added to the structure at n-th stage must be toothpicks of length 1 connected by their endpoints, in the same way as in the odd-indexed stages of A220500.
a(n) is the total number of elements in the structure after n generations.
A289841 (the first differences) gives the number of elements added at n-th stage.
Note that after 19 generations the structure is a 72-gon which essentially looks like a diamond (as a square that has been rotated 45 degrees).
The surprising fact is that from n = 20 up to 27 the structure is gradually transformed into a square cross.
The diamond mentioned above can be interpreted as the center of the cross. The diamond has an area equal to 384 and it contains 222 polygonal regions (or enclosures) of 11 distinct shapes. Missing two heptagonal shapes which are in the arms of the square cross only.
In total the complex cross contains 13 distinct shapes of polygonal regions. There are ten polygonal shapes that have an infinite number of copies. On the other hand, three of these polygonal shapes have a finite number of copies because they are in the center of the cross only. For example: there are only four copies of the concave 14-gon, which is also the largest polygon in the structure.
For n => 27 the shape of the square cross remains forever because its four arms grow indefinitely.
Every arm has a minimum width equal to 8, and a maximum width equal to 12.
Every arm also has a periodic structure which can be dissected in infinitely many clusters of area equal to 64. Every cluster is a 30-gon that contains 40 polygonal regions of nine distinct shapes.
If n is a number of the form 8*k-3 (cf. A017101) and greater than 19, for example: 27, 35, 43, 51, ..., then at n-th stage a new cluster is finished in every arm of the cross.
The behavior is similar to A290220 and A294020 in the sense that these three cellular automata have the property of self-limiting their growth only in some directions of the square grid. - Omar E. Pol, Oct 29 2017

Crossrefs

Programs

  • PARI
    concat(0, Vec(x*(1 + 2*x + 8*x^2 + 8*x^3 + 8*x^4 + 8*x^5 + 32*x^6 + 16*x^7 + 15*x^8 + 14*x^9 + 40*x^10 + 8*x^11 + 8*x^12 + 8*x^13 + 32*x^14 + 32*x^15 + 16*x^16 + 16*x^17 + 32*x^18 + 16*x^24) / ((1 - x)^2*(1 + x)*(1 + x^2)*(1 + x^4))+ O(x^50))) \\ Colin Barker, Nov 12 2017

Formula

From Colin Barker, Nov 11 2017: (Start)
G.f.: x*(1 + 2*x + 8*x^2 + 8*x^3 + 8*x^4 + 8*x^5 + 32*x^6 + 16*x^7 + 15*x^8 + 14*x^9 + 40*x^10 + 8*x^11 + 8*x^12 + 8*x^13 + 32*x^14 + 32*x^15 + 16*x^16 + 16*x^17 + 32*x^18 + 16*x^24) / ((1 - x)^2*(1 + x)*(1 + x^2)*(1 + x^4)).
a(n) = a(n-1) + a(n-8) - a(n-9) for n>19.
(End)

A290220 Narrow cross sequence (see Comments lines for definition).

Original entry on oeis.org

0, 2, 6, 10, 18, 26, 34, 42, 58, 70, 78, 94, 106, 114, 130, 142, 150, 166, 178, 186, 202, 214, 222, 238, 250, 258, 274, 286, 294, 310, 322, 330, 346, 358, 366, 382, 394, 402, 418, 430, 438, 454, 466, 474, 490, 502, 510, 526, 538, 546, 562, 574, 582, 598, 610, 618, 634, 646, 654, 670, 682, 690, 706, 718, 726, 742, 754
Offset: 0

Views

Author

Omar E. Pol, Jul 24 2017

Keywords

Comments

The sequence arises from a "hybrid" cellular automaton, which consist essentially in two successive generations using the rules of the D-toothpick sequence A194270 followed by one generation using toothpicks of length 2.
On the infinite square grid we start at stage 0 with no toothpicks, so a(0) = 0.
For the next stages we have the following rules:
1) At stage 1 we place two D-toothpicks connected by their endpoints on the same diagonal.
2) If n is a number of the form 3*k + 2 (cf. A016789), for example: 2, 5, 8, 11, 14, ..., the elements added to the structure at n-th stage must be toothpicks of length 1 connected by their endpoints, in the same way as in the even-indexed stages of A194270.
3) If n is a positive multiple of 3 (cf. A008585) the elements added to the structure at n-th stage must be toothpicks of length 2. These toothpicks are connected to the structure by their midpoints.
4) If n is a number of the form 3*k + 1 (cf. A016777) and > 1, for example: 4, 7, 10, 13, ..., the elements added to the structure at n-th stage must be D-toothpicks of length sqrt(2) connected to the structure by their endpoints, in the same way as in the odd-indexed stages of A194270.
a(n) is the total number of elements in the structure after n generations.
A290221 (the first differences) gives the number of elements added at n-th stage.
The surprising fact is that from n = 7 up to 9 the structure is gradually transformed into a square cross.
For n => 9 the shape of the square cross remains forever because its four arms grow indefinitely in the directions North, East, West and South.
Every arm has a width equal to 4.
Every arm also has a periodic structure which can be dissected in infinitely many clusters.
In total, the narrow cross contains five distinct shapes of polygonal regions. There are three polygonal shapes that have an infinite number of copies. On the other hand, two polygonal shapes have a finite number of copies because they are in the center of the cross only. they are the heptagon and the hexagon of area 5.
The structure looks like a square cross but it's simpler than the structure of the complex cross described in A289840.
The behavior is similar to A289840 and A294020 in the sense that these three cellular automata have the property of self-limiting their growth only in some directions of the square grid. - Omar E. Pol, Oct 29 2017

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1, 0, 1, -1}, {0, 2, 6, 10, 18, 26, 34, 42, 58, 70}, 100] (* Paolo Xausa, Aug 27 2024 *)
  • PARI
    concat(0, Vec(2*x*(1 + 2*x + 2*x^2 + 3*x^3 + 2*x^4 + 2*x^5 + 4*x^7 + 2*x^8) / ((1 - x)^2*(1 + x + x^2)) + O(x^60))) \\ Colin Barker, Nov 12 2017

Formula

From Colin Barker, Nov 11 2017: (Start)
G.f.: 2*x*(1 + 2*x + 2*x^2 + 3*x^3 + 2*x^4 + 2*x^5 + 4*x^7 + 2*x^8) / ((1 - x)^2*(1 + x + x^2)).
a(n) = a(n-1) + a(n-3) - a(n-4) for n>9. [Corrected by Paolo Xausa, Aug 27 2024]
(End)

A145768 a(n) = the bitwise XOR of squares of first n natural numbers.

Original entry on oeis.org

0, 1, 5, 12, 28, 5, 33, 16, 80, 1, 101, 28, 140, 37, 225, 0, 256, 33, 357, 12, 412, 37, 449, 976, 400, 993, 325, 924, 140, 965, 65, 896, 1920, 961, 1861, 908, 1692, 965, 1633, 912, 1488, 833, 1445, 668, 1292, 741, 2721, 512, 2816, 609, 2981, 396, 2844, 485
Offset: 0

Views

Author

Vladimir Reshetnikov, Oct 18 2008

Keywords

Comments

Up to n=10^8, a(15) is the only zero term and a(1)=a(9) are the only terms for which a(n)=1. Can it be proved that any number can only appear a finite number of times in this sequence? [M. F. Hasler, Oct 20 2008]
Even terms occur at A014601, odd terms at A042963; A010873(a(n))=A021913(n+1). - Reinhard Zumkeller, Jun 05 2012
If squares occur, they must be at indexes != 2 or 5 (mod 8). - Roderick MacPhee, Jul 17 2017

Crossrefs

Programs

  • Haskell
    import Data.Bits (xor)
    a145768 n = a145768_list !! n
    a145768_list = scanl1 xor a000290_list  -- Reinhard Zumkeller, Jun 05 2012
    
  • Maple
    A[0]:= 0:
    for n from 1 to 100 do A[n]:= Bits:-Xor(A[n-1],n^2) od:
    seq(A[i],i=0..100); # Robert Israel, Dec 08 2019
  • Mathematica
    Rest@ FoldList[BitXor, 0, Array[#^2 &, 50]]
  • PARI
    an=0; for( i=1,50, print1(an=bitxor(an,i^2),",")) \\ M. F. Hasler, Oct 20 2008
    
  • PARI
    al(n)=local(m);vector(n,k,m=bitxor(m,k^2))
    
  • Python
    from functools import reduce
    from operator import xor
    def A145768(n):
        return reduce(xor, [x**2 for x in range(n+1)]) # Chai Wah Wu, Aug 08 2014

Formula

a(n)=1^2 xor 2^2 xor ... xor n^2.

A290221 Number of elements added at n-th stage to the structure of the narrow cross described in A290220.

Original entry on oeis.org

0, 2, 4, 4, 8, 8, 8, 8, 16, 12, 8, 16, 12, 8, 16, 12, 8, 16, 12, 8, 16, 12, 8, 16, 12, 8, 16, 12, 8, 16, 12, 8, 16, 12, 8, 16, 12, 8, 16, 12, 8, 16, 12, 8, 16, 12, 8, 16, 12, 8, 16, 12, 8, 16, 12, 8, 16, 12, 8, 16, 12, 8, 16, 12, 8, 16, 12, 8, 16, 12, 8, 16, 12, 8, 16, 12, 8, 16, 12, 8, 16, 12, 8, 16, 12, 8, 16, 12
Offset: 0

Views

Author

Omar E. Pol, Jul 24 2017

Keywords

Comments

For n = 0..6 the sequence is similar to some toothpick sequences.
The surprising fact is that for n >= 7 the sequence has periodic tail. More precisely, it has period 3: repeat [8, 16, 12]. This tail is in accordance with the expansion of the four arms of the cross.
This is essentially the first differences of A290221. The behavior is similar to A289841 and A294021 in the sense that these three sequences from cellular automata have the property that after the initial terms the continuation is a periodic sequence. - Omar E. Pol, Oct 29 2017

Examples

			For n = 0..6 the sequence is: 0, 2, 4, 4, 8, 8, 8;
Terms 7 and beyond can be arranged in a rectangular array with three columns as shown below:
8, 16, 12;
8, 16, 12;
8, 16, 12;
8, 16, 12;
...
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{0,0,1},{0,2,4,4,8,8,8,8,16,12},90] (* Harvey P. Dale, Dec 31 2018 *)
  • PARI
    concat(0, Vec(2*x*(1 + 2*x + 2*x^2 + 3*x^3 + 2*x^4 + 2*x^5 + 4*x^7 + 2*x^8) / ((1 - x)*(1 + x + x^2)) + O(x^100))) \\ Colin Barker, Nov 12 2017

Formula

G.f.: 2*x*(1 + 2*x + 2*x^2 + 3*x^3 + 2*x^4 + 2*x^5 + 4*x^7 + 2*x^8) / ((1 - x)*(1 + x + x^2)). - Colin Barker, Nov 12 2017

A014848 a(n) = n^2 - floor( n/2 ).

Original entry on oeis.org

0, 1, 3, 8, 14, 23, 33, 46, 60, 77, 95, 116, 138, 163, 189, 218, 248, 281, 315, 352, 390, 431, 473, 518, 564, 613, 663, 716, 770, 827, 885, 946, 1008, 1073, 1139, 1208, 1278, 1351, 1425, 1502, 1580, 1661, 1743, 1828, 1914, 2003, 2093, 2186, 2280, 2377, 2475
Offset: 0

Views

Author

Keywords

Comments

Quasipolynomial of order 2. - Charles R Greathouse IV, Jan 19 2012
The binomial transform is 0, 1, 5, 20,... which is A084850 with offset 1. - R. J. Mathar, Nov 26 2014

Crossrefs

Cf. A033951, A033991, A042963 (first differences), A084850.

Programs

Formula

a(2*n) = A033991(n).
a(2*n+1) = A033951(n).
G.f.: x*(1+x+2*x^2)/((1-x)^2*(1-x^2)).
a(n) = (2*n*(2*n-1) + 1 - (-1)^n)/4. - Bruno Berselli, Feb 17 2011
a(n) = round(n/(exp(1/n) - 1)), n > 0. - Richard R. Forberg, Nov 14 2014
E.g.f.: (1/4)*((1 + 2*x + 4*x^2)*exp(x) - exp(-x)). - G. C. Greubel, Mar 14 2024

A047463 Numbers that are congruent to {2, 4} mod 8.

Original entry on oeis.org

2, 4, 10, 12, 18, 20, 26, 28, 34, 36, 42, 44, 50, 52, 58, 60, 66, 68, 74, 76, 82, 84, 90, 92, 98, 100, 106, 108, 114, 116, 122, 124, 130, 132, 138, 140, 146, 148, 154, 156, 162, 164, 170, 172, 178, 180, 186, 188, 194, 196, 202, 204, 210, 212, 218, 220, 226, 228, 234
Offset: 1

Views

Author

Keywords

Comments

First differences in A010696.

Crossrefs

Union of A017089 and A017113.
Cf. A014848.

Programs

  • Magma
    [ n: n in [2..234 by 2] | n mod 8 in [2,4] ];  // Bruno Berselli, May 11 2011
  • Mathematica
    Select[Range[250], MemberQ[{2, 4}, Mod[#, 8]] &] (* Amiram Eldar, Dec 18 2021 *)

Formula

a(n) = 8*n - a(n-1) - 10, with a(1)=2. - Vincenzo Librandi, Aug 06 2010
From Bruno Berselli, May 11 2011: (Start)
G.f.: 2*x*(1+x+2*x^2)/((1+x)*(1-x)^2).
a(n) = 4*n-(-1)^n-3.
Sum_{i=1..n} a(i) = 2*A014848(n).
a(n) = 2*A042963(n-1). (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/16 + log(2)/8. - Amiram Eldar, Dec 18 2021

Extensions

More terms from Vincenzo Librandi, Aug 06 2010

A163575 Remove all trailing bits equal to (n mod 2) in binary representation of n.

Original entry on oeis.org

0, 1, 0, 1, 2, 3, 0, 1, 4, 5, 2, 3, 6, 7, 0, 1, 8, 9, 4, 5, 10, 11, 2, 3, 12, 13, 6, 7, 14, 15, 0, 1, 16, 17, 8, 9, 18, 19, 4, 5, 20, 21, 10, 11, 22, 23, 2, 3, 24, 25, 12, 13, 26, 27, 6, 7, 28, 29, 14, 15, 30, 31, 0, 1, 32, 33, 16, 17, 34, 35, 8, 9, 36, 37, 18, 19, 38, 39, 4, 5, 40, 41, 20
Offset: 1

Views

Author

Helmut Kreindl (euler(AT)chello.at), Jul 31 2009

Keywords

Comments

The original name was: "The changepoint a(n) is the first predecessor from n in a binary tree with: a(n) mod 2 <> n mod 2."
In a binary tree (node(row,col)=2^(row-1)+(col-1))
_________________2__________________________________3________________
____8_______9_______10_______11_______12_______13_______14_______15__
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
any node has 2 successors and one predecessor. a(n) is the first predecessor from n (going back, step by step) with another last digit (in binary sight) as n.
The subsequences from a(2^k) to a(2^(k+1) - 1) are permutations from the natural numbers from 0 to 2^k-1.

Examples

			a(7) = a(111_2) = 0_2 = 0 (when the rightmost and only run of bits in 7's binary representation has been shifted off, only zero remains).
a(17) = a(10001_2) = 1000_2 = 8.
a(8) = a(1000_2) = 1_2 = 1.
		

Crossrefs

Bisections: A000265, A153733. Cf. also A227183.
Cf. A136480.

Programs

  • BASIC
    FUNCTION CHANGEPOINT
    INPUT n
    IF EVEN(n)
      WHILE EVEN(n)
        n = n/2
    ELSE
      WHILE NOT EVEN(n)
        n = (n-1)/2
    OUTPUT n
    
  • Haskell
    a163575 n = f n' where
       f 0 = 0
       f x = if b == parity then f x' else x  where (x', b) = divMod x 2
       (n', parity) = divMod n 2
    -- Reinhard Zumkeller, Jul 22 2014
  • Mathematica
    f[n_] := Block[{idn = IntegerDigits[n, 2], m = Mod[n, 2]}, While[ idn[[-1]] == m, idn = Most@ idn]; FromDigits[ idn, 2]]; Array[f, 83] (* or *)
    f[n_] := Block[{m = n}, If[ OddQ@ m, While[OddQ@m, m--; m /= 2], While[ EvenQ@ m, m /= 2]]; m]; Array[f, 83] (* Robert G. Wilson v, Jul 04 2015 *)
  • PARI
    a(n) = {odd = n%2; while (n%2 == odd, n \= 2); return(n);} \\ Michel Marcus, Jun 20 2013
    
  • PARI
    a(n)=if(n%2,(n+1)>>valuation(n+1,2)-1,n>>valuation(n,2)) \\ Charles R Greathouse IV, Jul 05 2013
    (MIT/GNU Scheme) (define (A163575 n) (floor->exact (/ n (expt 2 (A136480 n))))) ;; Antti Karttunen, Jul 05 2013
    

Formula

a(A042963(n)) = n - 1. - Reinhard Zumkeller, Jul 22 2014
a(2^n -1) = 0 and a(2^n) = 1. a(2n-1) is 2x and a(2n) is 2x+1. - Robert G. Wilson v, Jul 04 2015
a(n) = floor(n/(2^A136480(n))). - Antti Karttunen, Jul 05 2013

Extensions

Name changed and b-file computed by Antti Karttunen, Jul 05 2013
Previous Showing 11-20 of 53 results. Next