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

A048730 Differences between A008589 (multiples of 7) and A048727, a(n) = ((n*7)-Xmult(n,7)).

Original entry on oeis.org

0, 0, 0, 12, 0, 8, 24, 28, 0, 0, 16, 28, 48, 56, 56, 60, 0, 0, 0, 12, 32, 40, 56, 60, 96, 96, 112, 124, 112, 120, 120, 124, 0, 0, 0, 12, 0, 8, 24, 28, 64, 64, 80, 92, 112, 120, 120, 124, 192, 192, 192, 204, 224, 232, 248
Offset: 0

Views

Author

Antti Karttunen, Apr 26 1999

Keywords

Comments

For n = binary n[k],n[k-1],...,n[0], bits a(n) = binary b[k+1],b[k],...,b[0] are b[i] = 1 when n[i-1] + n[i-2] + n[i-3] >= 2, so the majority bit 0 or 1 among the 3 bits of n below position i (with 0 bits below the radix point of n as necessary). This is since 7*n = 4*n + 2*n + n is n[i-1] + n[i-2] + n[i-3] at position i-1, and 4*n XOR 2*n XOR n is the same but no carry, so b[i] is the carry only. - Kevin Ryde, Mar 26 2021

Crossrefs

Positions of zeros are given by A048715. Cf. A048733, A342697.
Diagonal 7 of A061858.

Programs

A342698 For any number n with binary expansion (b(1), b(2), ..., b(k)), the binary expansion of a(n) is (floor((b(k)+b(1)+b(2))/2), floor((b(1)+b(2)+b(3))/2), ..., floor((b(k-1)+b(k)+b(1))/2)).

Original entry on oeis.org

0, 1, 1, 3, 0, 7, 7, 7, 0, 9, 5, 15, 12, 15, 15, 15, 0, 17, 1, 19, 8, 27, 15, 31, 24, 25, 29, 31, 28, 31, 31, 31, 0, 33, 1, 35, 0, 35, 7, 39, 16, 49, 21, 55, 28, 63, 31, 63, 48, 49, 49, 51, 56, 59, 63, 63, 56, 57, 61, 63, 60, 63, 63, 63, 0, 65, 1, 67, 0, 67, 7
Offset: 0

Views

Author

Rémy Sigrist, Mar 18 2021

Keywords

Comments

This sequence is a variant of A342697; here we deal with bit triples in a "cyclic" binary representation of n.

Examples

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

Crossrefs

Cf. A003817, A342697, A342699 (fixed points), A342700.

Programs

  • PARI
    a(n) = my (w=#binary(n)); sum(k=0, w-1, ((bittest(n, (k-1)%w)+bittest(n, k%w)+bittest(n, (k+1)%w))>=2) * 2^k)

Formula

a(n) + A342700(n) = A003817(n).
a(n) = n iff n belongs to A342699.

A343049 The k-th binary digit of a(n) is the most frequent digit among the first k binary digits of n (in case of a tie, take the k-th binary digit of n).

Original entry on oeis.org

0, 1, 2, 7, 0, 5, 6, 31, 0, 9, 10, 31, 8, 29, 30, 127, 0, 1, 2, 23, 0, 21, 22, 127, 0, 25, 26, 127, 24, 125, 126, 511, 0, 1, 2, 39, 0, 37, 38, 127, 0, 41, 42, 127, 40, 125, 126, 511, 0, 33, 34, 119, 32, 117, 118, 511, 32, 121, 122, 511, 120, 509, 510, 2047, 0
Offset: 0

Views

Author

Rémy Sigrist, Apr 09 2021

Keywords

Comments

Leading zeros are taken into account up to the point the number of zeros exceeds the total number of ones.
We scan the binary representation of a number starting from the least significant digit. See A343271 for the other way.

Examples

			The first terms, in decimal and in binary, are:
  n   a(n)  bin(n)  bin(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     1       1          1
   2     2      10         10
   3     7      11        111
   4     0     100          0
   5     5     101        101
   6     6     110        110
   7    31     111      11111
   8     0    1000          0
   9     9    1001       1001
  10    10    1010       1010
  11    31    1011      11111
  12     8    1100       1000
  13    29    1101      11101
  14    30    1110      11110
  15   127    1111    1111111
		

Crossrefs

Programs

  • PARI
    a(n, base=2) = { my (d=digits(n, base), t, f=vector(base)); d=concat(vector(#d), d); forstep (k=#d, 1, -1, f[1+d[k]]++; if (vecmax(f)==f[1+d[k]], t=d[k];); d[k]=t); fromdigits(d, base) }

Formula

a(n) = 0 iff n belongs to A036993.
a(n) = n iff n = 0 or n belongs to A032925.
a(2^k-1) = 2^(2*k-1)-1 for any k > 1.
A070939(a(n)) < 2*A070939(n).
Showing 1-3 of 3 results.