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 21-30 of 30 results.

A062033 Binary expansion of n does not contain 1-bits at even positions. Integers whose base 4 representation consists of only 0's and 2s.

Original entry on oeis.org

0, 10, 1000, 1010, 100000, 100010, 101000, 101010, 10000000, 10000010, 10001000, 10001010, 10100000, 10100010, 10101000, 10101010, 1000000000, 1000000010, 1000001000, 1000001010, 1000100000, 1000100010, 1000101000, 1000101010, 1010000000, 1010000010, 1010001000
Offset: 0

Views

Author

Antti Karttunen, Jun 26 2001

Keywords

Crossrefs

Decimal representation is given in A062880.
Cf. A063010.

Programs

  • Python
    def A062033(n): return int(bin(int(bin(n)[2:],4))[2:])*10 # Chai Wah Wu, Aug 21 2023

Extensions

More terms from Chai Wah Wu, Aug 22 2023

A342217 The n-th and a(n)-th points of the Hilbert's Hamiltonian walk (A059252, A059253) are symmetrical with respect to the line X=Y.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Mar 05 2021

Keywords

Comments

In other words, a(n) is the unique k such that A059252(n) = A059253(k) and A059253(n) = A059252(k).
This sequence is a self-inverse permutation of the nonnegative integers.

Examples

			The Hilbert's Hamiltonian walk (A059252, A059253) begins as follows:
     +     +-----+-----+
     |15   |12    11   |10
     |     |           |
     +-----+     +-----+
      14    13   |8     9
                 |
     +-----+     +-----+
     |1    |2     7    |6
     |     |           |
     +     +-----+-----+
      0     3     4     5
- so a(0) = 0,
     a(1) = 3,
     a(2) = 2,
     a(4) = 14,
     a(5) = 15,
     a(7) = 13,
     a(8) = 8,
     a(9) = 11,
     a(10) = 10.
		

Crossrefs

See A342218 and A342224 for similar sequences.

Programs

  • PARI
    See Links section.

Formula

a(n) = n iff n belongs to A062880.
a(n) < 16^k for any n < 16^k.

A345290 a(n) is obtained by replacing 2^k in binary expansion of n with Fibonacci(-k-2).

Original entry on oeis.org

0, -1, 2, 1, -3, -4, -1, -2, 5, 4, 7, 6, 2, 1, 4, 3, -8, -9, -6, -7, -11, -12, -9, -10, -3, -4, -1, -2, -6, -7, -4, -5, 13, 12, 15, 14, 10, 9, 12, 11, 18, 17, 20, 19, 15, 14, 17, 16, 5, 4, 7, 6, 2, 1, 4, 3, 10, 9, 12, 11, 7, 6, 9, 8, -21, -22, -19, -20, -24
Offset: 0

Views

Author

Rémy Sigrist, Jun 13 2021

Keywords

Comments

This sequence is a variant of A022290; here we consider Fibonacci numbers with negative indices (A039834), there Fibonacci numbers with positive indices (A000045).
After the initial 0, the sequence alternates runs of positive terms and runs of negative terms, the k-th run having 2^(k-1) terms.

Examples

			For n = 3:
- 3 = 2^1 + 2^0,
- so a(3) = A039834(2+1) + A039834(2+0) = 2 - 1 = 1.
		

Crossrefs

Programs

  • PARI
    a(n) = { my (v=0, e); while (n, n-=2^e=valuation(n, 2); v+=fibonacci(-2-e)); v }

Formula

a(n) = A022290(A063695(n)) - A022290(A063694(n)).
a(n) = A022290(n) iff n belongs to A062880.
a(n) = -A022290(n) iff n belongs to A000695.
a(n) = 0 iff n = 0.
a(n) = 1 iff n belongs to A072197.
a(n) = 2 iff n belongs to A080675.
a(n) = -1 iff n belongs to A020989.
a(n) = -2 iff n belongs to A136412.

A147568 a(n) = 2*A000695(n)+3.

Original entry on oeis.org

3, 5, 11, 13, 35, 37, 43, 45, 131, 133, 139, 141, 163, 165, 171, 173, 515, 517, 523, 525, 547, 549, 555, 557, 643, 645, 651, 653, 675, 677, 683, 685, 2051, 2053, 2059, 2061, 2083, 2085, 2091, 2093, 2179, 2181, 2187, 2189, 2211, 2213, 2219, 2221, 2563, 2565, 2571
Offset: 0

Views

Author

Vladimir Shevelev, Nov 07 2008

Keywords

Comments

Every odd number m>=9 is a unique sum of the form a(k)+2a(l); moreover this sequence is the unique one with such property. In connection with A103151, note that there is no subsequence T of primes such that every odd number m>=9 is expressible as a unique sum of the form m=p+2q, where p and q are in T. One can prove that if one replaces 9 by any integer x_o>9, the statement remains true (see the Shevelev link).

Crossrefs

Programs

  • Mathematica
    (* b = A000695 *) b[n_] := If[n==0, 0, If[EvenQ[n], 4 b[n/2] , b[n-1]+1]];
    a[n_] := 2 b[n] + 3; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Dec 14 2018 *)
  • PARI
    a000695(n) = fromdigits(binary(n), 4);
    a(n) = 2*a000695(n)+3; \\ Michel Marcus, Dec 13 2018

Extensions

More terms from Michel Marcus, Dec 13 2018

A341120 a(n) is the X-coordinate of the n-th point of the space filling curve C defined in Comments section; A341121 gives Y-coordinates.

Original entry on oeis.org

0, 0, 1, 2, 2, 3, 3, 3, 2, 3, 3, 3, 2, 2, 1, 0, 0, 1, 1, 1, 0, 0, 1, 2, 2, 2, 3, 4, 4, 3, 3, 3, 4, 5, 5, 5, 4, 4, 5, 6, 6, 6, 7, 8, 8, 7, 7, 7, 8, 8, 7, 6, 6, 5, 5, 5, 6, 5, 5, 5, 6, 6, 7, 8, 8, 9, 9, 9, 8, 8, 9, 10, 10, 10, 11, 12, 12, 11, 11, 11, 12, 12, 13
Offset: 0

Views

Author

Kevin Ryde and Rémy Sigrist, Feb 05 2021

Keywords

Comments

We define the family {C_k, k >= 0}, as follows:
- C_0 corresponds to the points (0, 0), (0, 1), (1, 1), (2, 1) and (2, 0), in that order:
+---+---+
| |
+ +
O
- for any k >= 0, C_{k+1} is obtained by arranging 4 copies of C_k as follows:
+ . . . + . . . +
. B . B .
+ . . . + . . .
. B . .A C.A C.
. . --> + . . . + . . . +
.A C. .C . A.
+ . . . + . B.B .
O .A . C.
+ . . . + . . . +
O
- the space filling curve C is the limit of C_{2*k} as k tends to infinity.
The even bisection of the curve M defined in A341018 is similar to C and vice versa.
The third quadrisection of C is similar to the Hilbert Hamiltonian walk H = A059252, A059253.
H is the number of points in the middle of each unit square in Hilbert's subdivisions, whereas here points are at the starting corner of each unit square. This start is either the bottom left or top right corner depending on how many 180-degree rotations have been applied. These rotations are digit 3's of n written in base 4, hence the formula below adding A283316.

Examples

			Points n and their locations X=a(n), Y=A341121(n) begin as follows. n=7 and n=9 are both at X=3,Y=2, and n=11,n=31 both at X=3,Y=4.
      |       |
    4 | 16---17   12--11,31
      |  |         |    |
    3 | 15---14---13   10
      |                 |
    2 |            8---7,9
      |                 |
    1 |  1----2----3    6
      |  |         |    |
  Y=0 |  0         4----5
      +--------------------
       X=0    1    2    3
		

Crossrefs

Cf. A341121 (Y coordinate), A059285 (projection Y-X), A062880 (n on X=Y diagonal).

Programs

  • PARI
    See Links section.

Formula

a(n) = A341121(n) - A059285(n).
a(n) = A341121(n) iff n belongs to A062880.
a(2*n) = A341018(n).
a(4*n) = 2*A341121(n).
a(16*n) = 4*a(n).
a(n) = A059252(n) + A283316(n+1).
A059253(n) = (a(4*n+2)-1)/2.

A045110 Numbers whose base-4 representation contains no 1's and exactly one 3.

Original entry on oeis.org

3, 11, 12, 14, 35, 43, 44, 46, 48, 50, 56, 58, 131, 139, 140, 142, 163, 171, 172, 174, 176, 178, 184, 186, 192, 194, 200, 202, 224, 226, 232, 234, 515, 523, 524, 526, 547, 555, 556, 558, 560, 562, 568, 570, 643, 651, 652, 654, 675
Offset: 1

Views

Author

Keywords

Comments

From Robert Israel, Apr 10 2018: (Start)
If k is in the sequence, then so are 4*k and 4*k+2.
All even terms of the sequence are obtained in this way.
The odd terms of the sequence are 4*k+3 for k in A062880. (End)

Crossrefs

Programs

  • Maple
    f:= proc(i,x,d) local j,X, nX;
         X:= convert(x,base,2); nX:= nops(X);
         3*4^i+add(X[j]*2*4^`if`(j<=i,j-1,j),j=1..nX)
    end proc:
    sort([seq(seq(seq(f(i,x,d),x=`if`(i=d-1,0,2^(d-2))..2^(d-1)-1),i=0..d-1),d=0..6)]); # Robert Israel, Apr 10 2018
  • Mathematica
    Select[Range[700],DigitCount[#,4,1]==0&&DigitCount[#,4,3]==1&] (* Harvey P. Dale, Jul 23 2018 *)

A165274 Table read by antidiagonals: T(n, k) is the k-th number with n-1 even-power summands in its base 2 representation.

Original entry on oeis.org

2, 8, 1, 10, 3, 5, 32, 4, 7, 21, 34, 6, 13, 23, 85, 40, 9, 15, 29, 87, 341, 42, 11, 17, 31, 93, 343, 1365, 128, 12, 19, 53, 95, 349, 1367, 5461, 130, 14, 20, 55, 117, 351, 1373, 5463, 21845, 136, 16, 22, 61, 119, 373, 1375, 5469, 21847, 87381, 138, 18, 25, 63
Offset: 1

Views

Author

Clark Kimberling, Sep 12 2009

Keywords

Comments

For n>=0, row n is the ordered sequence of positive integers m such that the number of even powers of 2 in the base 2 representation of m is n.
Every positive integer occurs exactly once in the array, so that as a sequence it is a permutation of the positive integers.
For odd powers, see A165275.
For the number of even powers of 2 in the base 2 representation of n, see A139351; for odd, see A139352.
Essentially, (Row 0)=A062880, (Row 1)=A158705, (Column 1)=A002450, also possibly (Column 2)=A163832.

Examples

			Northwest corner:
2....8...10...32...34...40...42...129
1....3....4....6....9...11...12...14
5....7...13...15...17...19...20...22
21..23...29...31...53...55...61...63
Examples:
40 = 32 + 8 = 2^5 + 2^3, so that 40 is in row 0.
13 = 8 + 4 + 1 = 2^3 + 2^2 + 2^0, so that 13 is in row 2.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Total[(Reverse@IntegerDigits[n, 2])[[1 ;; -1 ;; 2]]]; T = GatherBy[ SortBy[Range[10^5], f], f]; Table[Table[T[[n - k + 1, k]], {k, n, 1, -1}], {n, 1, Length[T]}] // Flatten (* Amiram Eldar, Feb 04 2020*)

Extensions

More terms from Amiram Eldar, Feb 04 2020

A331961 a(n) is the greatest square number k such that n AND k = k (where AND denotes the bitwise AND operator).

Original entry on oeis.org

0, 1, 0, 1, 4, 4, 4, 4, 0, 9, 0, 9, 4, 9, 4, 9, 16, 16, 16, 16, 16, 16, 16, 16, 16, 25, 16, 25, 16, 25, 16, 25, 0, 1, 0, 1, 36, 36, 36, 36, 0, 9, 0, 9, 36, 36, 36, 36, 16, 49, 16, 49, 36, 49, 36, 49, 16, 49, 16, 49, 36, 49, 36, 49, 64, 64, 64, 64, 64, 64, 64
Offset: 0

Views

Author

Rémy Sigrist, Feb 02 2020

Keywords

Examples

			The first terms, alongside the binary representations of n and of a(n), are:
  n   a(n)  bin(n)  bin(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     1       1          1
   2     0      10          0
   3     1      11          1
   4     4     100        100
   5     4     101        100
   6     4     110        100
   7     4     111        100
   8     0    1000          0
   9     9    1001       1001
  10     0    1010          0
  11     9    1011       1001
  12     4    1100        100
  13     9    1101       1001
  14     4    1110        100
  15     9    1111       1001
  16    16   10000      10000
		

Crossrefs

Programs

  • PARI
    a(n) = forstep (m=sqrtint(n), 0, -1, if (bitand(n, m^2)==m^2, return (m^2)))
    
  • Python
    from math import isqrt
    def A331961(n): return next(m for m in (k**2 for k in range(isqrt(n),-1,-1)) if n&m==m) # Chai Wah Wu, Aug 22 2023

Formula

a(n) = 0 iff n belongs to A062880.
a(n^2) = n^2.

A176237 Binary expansion of n contains at least one 1-bit at even position and one 1-bit at odd position.

Original entry on oeis.org

3, 6, 7, 9, 11, 12, 13, 14, 15, 18, 19, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 66, 67, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 82, 83, 86, 87, 88, 89, 90, 91, 92, 93
Offset: 1

Views

Author

Rémy Sigrist, Apr 12 2010

Keywords

Comments

Also numbers neither in A000695 nor in A062880.

Examples

			The binary expansion of 6 is "110", and has one 1-bit at (odd) position 1 and one 1-bit at (even) position 2; thus 6 appears in the sequence.
		

Crossrefs

Programs

  • Mathematica
    ok[n_] := With[{p = Position[IntegerDigits[n, 2], 1]}, AnyTrue[p, OddQ[#[[1]]]&] && AnyTrue[p, EvenQ[#[[1]]]&]]; Select[Range[100], ok] (* Jean-François Alcover, Mar 31 2017 *)

A370049 Square array A(n, k), n, k >= 0, read by antidiagonals; for any n and k >= 0 with respective binary expansions Sum_{i > 0} b_i*2^(i-1) and Sum_{i > 0} c_i*2^(i-1), the binary expansion of A(n, k) is Sum_{i > 0} d_i*2^(i-1) with d_i = (Sum_{k divides i} b_k*c_{i/k}) mod 2 for any i > 0.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 2, 2, 0, 0, 3, 8, 3, 0, 0, 4, 10, 10, 4, 0, 0, 5, 32, 9, 32, 5, 0, 0, 6, 34, 36, 36, 34, 6, 0, 0, 7, 40, 39, 256, 39, 40, 7, 0, 0, 8, 42, 46, 260, 260, 46, 42, 8, 0, 0, 9, 128, 45, 288, 257, 288, 45, 128, 9, 0, 0, 10, 130, 136, 292, 294, 294, 292, 136, 130, 10, 0
Offset: 0

Views

Author

Rémy Sigrist, Apr 30 2024

Keywords

Comments

The set of nonnegative integers equipped with A form a commutative monoid.

Examples

			Array A(n, k) begins:
  n\k | 0   1    2    3     4     5     6     7      8      9     10
  ----+-------------------------------------------------------------
    0 | 0   0    0    0     0     0     0     0      0      0      0
    1 | 0   1    2    3     4     5     6     7      8      9     10
    2 | 0   2    8   10    32    34    40    42    128    130    136
    3 | 0   3   10    9    36    39    46    45    136    139    130
    4 | 0   4   32   36   256   260   288   292   2048   2052   2080
    5 | 0   5   34   39   260   257   294   291   2056   2061   2090
    6 | 0   6   40   46   288   294   264   270   2176   2182   2216
    7 | 0   7   42   45   292   291   270   265   2184   2191   2210
    8 | 0   8  128  136  2048  2056  2176  2184  32768  32776  32896
    9 | 0   9  130  139  2052  2061  2182  2191  32776  32769  32906
   10 | 0  10  136  130  2080  2090  2216  2210  32896  32906  32776
		

Crossrefs

Programs

  • PARI
    bits(n) = { my (b=vector(hammingweight(n))); for (k=1, #b, n-=2^b[k]=valuation(n,2)); return (b); }
    A(n, k) = { my (bn = bits(2*n), bk = bits(2*k), v = 0, e); for (i = 1, #bn, for (j = 1, #bk, e = bn[i] * bk[j] - 1; v = bitxor(v, 2^e););); return (v); }

Formula

A(n, k) = A(k, n).
A(m, A(n, k)) = A(A(m, n), k).
A(m XOR n, k) = A(m, k) XOR A(n, k) (where XOR denotes the bitwise XOR operator).
A000120(A(n, 2^k)) = A000120(n).
A(n, 0) = 0.
A(n, 1) = n.
A(n, 2) = A062880(n).
Previous Showing 21-30 of 30 results.