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

A256249 Partial sums of A006257 (Josephus problem).

Original entry on oeis.org

0, 1, 2, 5, 6, 9, 14, 21, 22, 25, 30, 37, 46, 57, 70, 85, 86, 89, 94, 101, 110, 121, 134, 149, 166, 185, 206, 229, 254, 281, 310, 341, 342, 345, 350, 357, 366, 377, 390, 405, 422, 441, 462, 485, 510, 537, 566, 597, 630, 665, 702, 741, 782, 825, 870, 917, 966, 1017, 1070, 1125, 1182, 1241, 1302, 1365, 1366, 1369, 1374
Offset: 0

Views

Author

Omar E. Pol, Mar 20 2015

Keywords

Comments

Also total number of ON states after n generations in one of the four wedges of the one-step rook version (or in one of the four quadrants of the one-step bishop version) of the cellular automaton of A256250.
A006257 gives the number of cells turned ON at n-th stage.
First differs from A255747 at a(11).
First differs from A169779 at a(10).
It appears that the odd terms (a bisection) give A256250.

Examples

			Written as an irregular triangle T(n,k), k >= 1, in which the row lengths are the terms of A011782 the sequence begins:
   0;
   1;
   2,  5;
   6,  9, 14, 21;
  22, 25, 30, 37, 46, 57, 70, 85;
  86, 89, 94,101,110,121,134,149,166,185,206,229,254,281,310,341;
  ...
Right border, a(2^m-1), gives A002450(m) for m >= 0.
a(2^m-2) = A203241(m) for m >= 2.
It appears that this triangle at least shares with the triangles from the following sequences; A151920, A255737, A255747, the positive elements of the columns k, if k is a power of 2.
From _Omar E. Pol_, Jan 03 2016: (Start)
Illustration of initial terms in the fourth quadrant of the square grid:
---------------------------------------------------------------------------
n    a(n)                 Compact diagram
---------------------------------------------------------------------------
0     0     _
1     1    |_|_ _
2     2      |_| |
3     5      |_ _|_ _ _ _
4     6          |_| | | |
5     9          |_ _| | |
6    14          |_ _ _| |
7    21          |_ _ _ _|_ _ _ _ _ _ _ _
8    22                  |_| | | | | | | |
9    25                  |_ _| | | | | | |
10   30                  |_ _ _| | | | | |
11   37                  |_ _ _ _| | | | |
12   46                  |_ _ _ _ _| | | |
13   57                  |_ _ _ _ _ _| | |
14   70                  |_ _ _ _ _ _ _| |
15   85                  |_ _ _ _ _ _ _ _|
.
a(n) is also the total number of cells in the first n regions of the diagram. A006257(n) gives the number of cells in the n-th region of the diagram.
(End)
		

Crossrefs

Programs

Formula

a(n) = (A256250(n+1) - 1)/4.

A266539 Terms of A006257 (Josephus problem) repeated.

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 3, 3, 1, 1, 3, 3, 5, 5, 7, 7, 1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 13, 13, 15, 15, 1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 13, 13, 15, 15, 17, 17, 19, 19, 21, 21, 23, 23, 25, 25, 27, 27, 29, 29, 31, 31, 1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 13, 13, 15, 15, 17, 17, 19, 19, 21, 21, 23, 23, 25, 25
Offset: 1

Views

Author

Omar E. Pol, Jan 02 2016

Keywords

Comments

First differs from both A266509 and A266529 at a(25), and shares with them infinitely many terms.

Examples

			Written as an irregular triangle in which the row lengths are twice the terms of A011782 the sequence begins:
   0, 0;
   1, 1;
   1, 1, 3, 3;
   1, 1, 3, 3, 5, 5, 7, 7;
   1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 13, 13, 15, 15;
   ...
Row sums give 0 together with A004171.
		

Crossrefs

Programs

  • Maple
    A006257[0]:=0: for n from 1 to 100 do A006257[n]:=(A006257[n-1]+1) mod n +1: end do:
    seq(A006257[i]$2,i=0..100); # Robert Israel, Jan 13 2016
  • Mathematica
    Join[{0, 0}, Table[SeriesCoefficient[(1 + x^2)/((-1 + x)^2 (1 + x)), {x, 0, m}], {n, 6}, {m, 0, 2^n - 1}]] // Flatten (* Michael De Vlieger, Jan 05 2016 *)

Formula

G.f.: (x^2 + x^4)/(1 - x - x^2 + x^3) - (1 - x)^(-1)*Sum_{k>=1} 2^k*x^(2^(k+1)). - Robert Israel, Jan 13 2016

Extensions

Offset changed to 1 by Ivan Neretin, Feb 09 2017

A273105 a(n) = A038572(n) + A006257(n), sum of the two numbers obtained by rotating the binary representation of n by one place to the right and to the left.

Original entry on oeis.org

0, 2, 2, 6, 3, 9, 8, 14, 5, 15, 10, 20, 15, 25, 20, 30, 9, 27, 14, 32, 19, 37, 24, 42, 29, 47, 34, 52, 39, 57, 44, 62, 17, 51, 22, 56, 27, 61, 32, 66, 37, 71, 42, 76, 47, 81, 52, 86, 57, 91, 62, 96, 67, 101, 72, 106, 77, 111, 82, 116, 87, 121, 92, 126, 33, 99
Offset: 0

Views

Author

Alex Ratushnyak, May 15 2016

Keywords

Crossrefs

Programs

  • Mathematica
    Table[FromDigits[RotateRight@ #, 2] + FromDigits[RotateLeft@ #, 2] &@ IntegerDigits[n, 2], {n, 0, 65}] (* Michael De Vlieger, May 17 2016 *)
  • Python
    print('0', end=',')
    for n in range(1,1000):
        BL = len(bin(n))-2
        x = (n>>1) + ((n&1) << (BL-1))   # A038572(n)
        x+= (n*2) - (1<A006257(n)  for n>0
        print(str(x), end=',')

A266538 Twice the partial sums of A006257 (Josephus problem).

Original entry on oeis.org

0, 2, 4, 10, 12, 18, 28, 42, 44, 50, 60, 74, 92, 114, 140, 170, 172, 178, 188, 202, 220, 242, 268, 298, 332, 370, 412, 458, 508, 562, 620, 682, 684, 690, 700, 714, 732, 754, 780, 810, 844, 882, 924, 970, 1020, 1074, 1132, 1194, 1260, 1330, 1404, 1482, 1564, 1650, 1740, 1834, 1932, 2034, 2140, 2250, 2364, 2482, 2604
Offset: 0

Views

Author

Omar E. Pol, Jan 12 2016

Keywords

Crossrefs

Bisection of A266540.

Programs

  • Mathematica
    2*Accumulate[Flatten[{0, Table[Range[1, 2^n - 1, 2], {n, 0, 7}]}]] (* Jake L Lande, Aug 05 2024 *)

Formula

a(n) = 2 * A256249(n).

A273106 Numbers representable as ror(k)+rol(k), where ror(k)=A038572(k) is k rotated one binary place to the right, rol(k)=A006257(k) is k rotated one binary place to the left.

Original entry on oeis.org

0, 2, 3, 5, 6, 8, 9, 10, 14, 15, 17, 19, 20, 22, 24, 25, 27, 29, 30, 32, 33, 34, 37, 38, 39, 42, 43, 44, 47, 48, 51, 52, 53, 56, 57, 58, 61, 62, 63, 65, 66, 67, 68, 70, 71, 72, 73, 75, 76, 77, 78, 80, 81, 82, 83, 85, 86, 87, 88, 90, 91, 92, 93, 95, 96, 98
Offset: 0

Views

Author

Alex Ratushnyak, May 15 2016

Keywords

Crossrefs

Programs

  • Mathematica
    Take[#, 66] &@ Union@ Table[FromDigits[RotateRight@ #, 2] + FromDigits[RotateLeft@ #, 2] &@ IntegerDigits[n, 2], {n, 0, 10^3}] (* Michael De Vlieger, May 17 2016 *)
  • Python
    def ROR(n):                # returns A038572(n)
        BL = len(bin(n))-2
        return (n>>1) + ((n&1) << (BL-1))
    def ROL(n):                # returns A006257(n) for n>0
        BL = len(bin(n))-2
        return (n*2) - (1<
    				

A273180 Numbers n such that ror(n) + rol(n) is a power of 2, where ror(n)=A038572(n) is n rotated one binary place to the right, rol(n)=A006257(n) is n rotated one binary place to the left.

Original entry on oeis.org

1, 2, 6, 19, 38, 102, 307, 614, 1638, 4915, 9830, 26214, 78643, 157286, 419430, 1258291, 2516582, 6710886, 20132659, 40265318, 107374182, 322122547, 644245094, 1717986918, 5153960755, 10307921510, 27487790694, 82463372083, 164926744166, 439804651110
Offset: 1

Views

Author

Alex Ratushnyak, May 17 2016

Keywords

Crossrefs

Programs

  • C
    #include 
    int main(int argc, char** argv)
    {
      unsigned long long x, n, BL=0;
      for (n=1; n>0; ++n) {
        if ((n & (n-1))==0)  ++BL;
        x = (n>>1) + ((n&1) << (BL-1));   // A038572(n)
        x+= (n*2) - (1ull<A006257(n)  for n>0
        if ((x & (x-1))==0)  printf("%lld, ", n);
      }
    }
    
  • Mathematica
    Select[Range[10^6], IntegerQ@ Log2[FromDigits[RotateRight@ #, 2] + FromDigits[RotateLeft@ #, 2]] &@ IntegerDigits[#, 2] &] (* or *)
    Rest@ CoefficientList[Series[x (1 + 2 x + 6 x^2 + 2 x^3 + 4 x^4)/((1 - x) (1 + x + x^2) (1 - 16 x^3)), {x, 0, 30}], x] (* Michael De Vlieger, May 19 2016 *)
  • PARI
    Vec(x*(1+2*x+6*x^2+2*x^3+4*x^4)/((1-x)*(1+x+x^2)*(1-16*x^3)) + O(x^50)) \\ Colin Barker, May 19 2016

Formula

From Colin Barker, May 19 2016: (Start)
a(n) = 17*a(n-3) - 16*a(n-6) for n>6.
G.f.: x*(1+2*x+6*x^2+2*x^3+4*x^4) / ((1-x)*(1+x+x^2)*(1-16*x^3)).
(End)

A274524 Numbers n such that both ror(n) and rol(n) are squares, where ror(x)=A038572(x) is x rotated one binary place to the right, rol(x)=A006257(x) is x rotated one binary place to the left.

Original entry on oeis.org

1, 2, 8, 32, 128, 512, 1568, 2048, 2312, 2592, 2888, 8192, 16928, 32768, 131072, 139392, 250632, 524288, 549152, 566048, 672800, 924800, 963272, 1318688, 2097152, 8388608, 8520192, 8769672, 9005768, 12261152, 13582472, 15635232, 33554432, 134217728, 136059008, 136587392
Offset: 1

Views

Author

Alex Ratushnyak, Jun 27 2016

Keywords

Comments

A004171 and A081294 are subsequences.
From Robert Israel, Jul 13 2016: (Start)
All terms except 1 are even.
Even terms are the numbers of the form n = (a+b)^2/8 such that for some d >= 1,
2^d <= n < 2^(d+1) and 2^(d+1)-1 = a*b. (End)

Crossrefs

Programs

  • Maple
    F:= proc(d) local v,R,X;
          v:= 2^(d+1)-1;
          R:= select(t-> t^2 < v,numtheory:-divisors(v));
          op(select(t -> t >= (v+1)/2 and t < v+1, map(t -> (t+ v/t)^2/8, R)));
    end proc:
    sort(convert({1,seq(F(i),i=1..50)},list)); # Robert Israel, Jul 13 2016
  • Mathematica
    Select[Range[10^6], Times @ Boole@ {IntegerQ@ Sqrt@ FromDigits[RotateRight@ #, 2], IntegerQ@ Sqrt@ FromDigits[RotateLeft@ #, 2]} &@ IntegerDigits[#, 2] == 1 &] (* Michael De Vlieger, Jun 29 2016 *)

A273050 Numbers k such that ror(k) XOR rol(k) = k, where ror(x)=A038572(x) is x rotated one binary place to the right, rol(x)=A006257(x) is x rotated one binary place to the left, and XOR is the binary exclusive-or operator.

Original entry on oeis.org

0, 5, 6, 45, 54, 365, 438, 2925, 3510, 23405, 28086, 187245, 224694, 1497965, 1797558, 11983725, 14380470, 95869805, 115043766, 766958445, 920350134, 6135667565, 7362801078, 49085340525, 58902408630, 392682724205, 471219269046
Offset: 1

Views

Author

Alex Ratushnyak, May 13 2016

Keywords

Crossrefs

Cf. A006257, A038572, A088163, A125836 (bisection?), A125837 (bisection?).
Cf. A020988 (numbers k such that ror(k) + rol(k) = k).

Programs

  • Mathematica
    ok[n_] := Block[{x = IntegerDigits[n, 2]}, x == BitXor @@@ Transpose@ {RotateLeft@ x, RotateRight@ x}]; Select[ Range[0, 10^5], ok] (* Giovanni Resta, May 14 2016 *)
    ok[n_] := Block[{x = IntegerDigits[n, 2]}, x == BitXor @@@ Transpose[ {RotateLeft[x], RotateRight[x]}]]; Select[LinearRecurrence[{0, 9, 0, -8}, {0, 5, 6, 45}, 100], ok] (* Jean-François Alcover, May 22 2016, after Giovanni Resta *)
  • Python
    def ROR(n):                # returns A038572(n)
        BL = len(bin(n))-2
        return (n>>1) + ((n&1) << (BL-1))
    def ROL(n):                # returns A006257(n) for n>0
        BL = len(bin(n))-2
        return (n*2) - (1<
    				

Formula

Conjectures from Colin Barker, May 22 2016: (Start)
a(n) = (-11+(-1)^n+2^(-1/2+(3*n)/2)*(3-3*(-1)^n+5*sqrt(2)+5*(-1)^n*sqrt(2)))/14.
a(n) = 5*(2^(3*n/2)-1)/7 for n even.
a(n) = 3*(2^((3*n)/2-1/2)-2)/7 for n odd.
a(n) = 9*a(n-2)-8*a(n-4) for n>4.
G.f.: x^2*(5+6*x) / ((1-x)*(1+x)*(1-8*x^2)).
(End)

Extensions

a(19)-a(27) from Giovanni Resta, May 14 2016

A274133 Numbers representable as ror(x)+rol(x) in two or more ways, where ror(x)=A038572(x) is x rotated one binary place to the right, rol(x)=A006257(x) is x rotated one binary place to the left.

Original entry on oeis.org

2, 9, 14, 15, 20, 27, 32, 37, 42, 47, 52, 57, 62, 129, 134, 139, 144, 149, 154, 159, 164, 169, 174, 179, 184, 189, 194, 195, 199, 200, 204, 205, 209, 210, 214, 215, 219, 220, 224, 225, 229, 230, 234, 235, 239, 240, 244, 245, 249, 250, 254, 255, 260, 265, 270, 275
Offset: 1

Views

Author

Alex Ratushnyak, Jun 10 2016

Keywords

Comments

These are the duplicates in A273105.

Examples

			ror(5) + rol(5) = 6 + 3 = 9, and also ror(16) + rol(16) = 8 + 1 = 9, therefore 9 is in the sequence.
		

Crossrefs

A274134 Primes p such that both ror(p) and rol(p) are also primes, where ror(x)=A038572(x) is x rotated one binary place to the right, rol(x)=A006257(x) is x rotated one binary place to the left.

Original entry on oeis.org

3, 7, 11, 31, 43, 67, 79, 127, 131, 139, 167, 191, 211, 223, 227, 307, 331, 367, 487, 523, 631, 691, 743, 751, 883, 971, 1039, 1087, 1399, 2063, 2083, 2143, 2179, 2239, 2267, 2287, 2347, 2411, 2423, 2503, 2531, 2543, 2591, 2687, 2731, 2803, 2819, 2927, 2939, 2963
Offset: 1

Views

Author

Alex Ratushnyak, Jun 10 2016

Keywords

Comments

a(n) mod 4 = 3.

Crossrefs

Programs

  • Mathematica
    Select[Prime@ Range@ 430, And[PrimeQ@ FromDigits[RotateLeft@ #, 2], PrimeQ@ FromDigits[RotateRight@ #, 2]] &@ IntegerDigits[#, 2] &] (* Michael De Vlieger, Jun 22 2016 *)
  • Python
    from sympy import isprime
    for n in range(3, 10000, 2):
        if not isprime(n): continue
        BL = len(bin(n))-2
        x = (n>>1) + ((n&1) << (BL-1))   # A038572(n)
        if not isprime(x): continue
        y = (n*2) - (1<A006257(n)  for n>0
        if not isprime(y): continue
        print(str(n), end=', ')
Showing 1-10 of 137 results. Next