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

A371459 For any positive integer with binary digits (b_1, ..., b_w) (where b_1 = 1), the binary digits of a(n), possibly with leading zeros, are (b_2, b_4, ..., b_{floor(w/2) * 2}); a(0) = 0.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 2, 3, 2, 3, 0, 0, 1, 1, 0, 0, 1, 1, 2, 2, 3, 3, 2, 2, 3, 3, 0, 1, 0, 1, 2, 3, 2, 3, 0, 1, 0, 1, 2, 3, 2, 3, 4, 5, 4, 5, 6, 7, 6, 7, 4, 5, 4, 5, 6, 7, 6, 7, 0, 0, 1, 1, 0, 0, 1, 1, 2, 2, 3, 3, 2, 2, 3, 3, 0, 0, 1, 1, 0, 0, 1
Offset: 0

Views

Author

Rémy Sigrist, Mar 24 2024

Keywords

Comments

In other words, we keep even-indexed bits.
Every integer appears infinitely many times in the sequence.

Examples

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

Crossrefs

See A371442 for the sequence related to odd-indexed bits.
See A059906 and A063695 for similar sequences.

Programs

  • Mathematica
    A371459[n_] := FromDigits[IntegerDigits[n, 2][[2;;-1;;2]], 2];
    Array[A371459, 100, 0] (* Paolo Xausa, Mar 28 2024 *)
  • PARI
    a(n) = { my (b = binary(n)); fromdigits(vector(#b\2, k, b[2*k]), 2); }
    
  • Python
    def A371459(n): return int(bin(n)[3::2],2) if n>1 else 0 # Chai Wah Wu, Mar 27 2024

Formula

a(n) = 0 iff n belongs to A126684.
a(A000695(n)) = 0.
a(A001196(n)) = n.

A193258 Sprimes: A sparse prime-like set of numbers that are constructed recursively to satisfy a Goldbach-type conjecture.

Original entry on oeis.org

1, 3, 7, 11, 13, 27, 31, 35, 49, 61, 77, 79, 93, 101, 115, 117, 133, 163, 183, 187, 193, 235, 245, 257, 271, 279, 323, 335, 343, 381, 399, 439, 481, 497, 507, 535, 549, 569, 619, 669, 681, 693, 713, 739, 815, 833, 863, 905, 941, 973, 1033, 1053, 1089, 1119
Offset: 1

Views

Author

Ian R Harris, Aug 26 2011

Keywords

Comments

Closely related to A123509, and the concept of a "basis". A key difference is that the set described here can only generate even numbers, and 0 is not allowed in the set.

Examples

			a(1)=1.
Note that S1={1}, so A={1}.
Now m=min{N\A}=2.
Thus C1={3} (amongst the natural numbers only 3 can be added to 1 to give 4).
Since 3 is the only candidate, a(2)=3.
To get a(3), we repeat steps 2) to 6).
So, S2={1,3}, A={1,2,3}, m=min{N\A}=4.
Thus the candidate set is C2={5,7} (we can add 5 to 3 to get 8, or 7 to 1 to get 8).
Then w5=|({(5+1)/2, (5+3)/2} union{5}) intersect {4,5,6,7,8,9,10,...}|=|{4,5}|=2.
And w7=|({(7+1)/2, (7+3)/2} union {7}) intersect {4,5,6,7,8,9,10,11,12,13,14,...}|=|{4,5,7}|=3.
Since of the two candidates, 7 has the higher worth, then a(3)=7.
		

Crossrefs

Programs

  • Sage
    @cached_function
    def A193258(n):
        if n == 1: return 1
        S = set(A193258(i) for i in [1..n-1])
        A = set((i+j)/2 for i, j in cartesian_product([S, S]))
        m = next(i for i in PositiveIntegers() if i not in A)
        C = set(2*m-i for i in S if 2*m-i > A193258(n-1))
        worthfn = lambda c: len(set((c+i)/2 for i in S).difference(A))
        wc = sorted(list((worthfn(c), c) for c in C)) # sort by worth and by c
        return wc[-1][1]
    # D. S. McNeil, Aug 29 2011

Formula

The set of numbers S is chosen to satisfy the Goldbach conjecture. That is any even positive number must be able to be written as the sum of exactly two members of S (typically there are multiple ways to do this). The members of the set are generated by a deterministic recursive algorithm as follows (N is the set of positive integers):
1) a(1)=1
2) Given Sk={a(1),...,a(k)}, form the set A={n in N | exists a(i), a(j) in Sk, (a(i)+a(j))=2n}.
3) Let m=min{N\A}. (Then 2m is the smallest positive even number which cannot be formed from sums of the current finite list of sprimes.)
4) Define candidate set Ck={n in \N| n > a(k), exists a(i) in Sk such that a(i)+n=2m}. (This is a set of possible choices for a(k+1).)
5) To each member of Ck, assign "worth" wi=|({(i+a(j))/2| a(j) in Sk} union {i}) intersect {N\A}|. (This assigns to each candidate a worth equal to the number of new values that will be added to set A if the candidate is added to Sk.)
6) a(k+1)=max{i in Ck | wi=maximum (over {j in Ck}) (wj)}.
Repeat steps 2) to 6).

A377415 a(n) = n - A377414(n).

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 2, 2, 0, 1, 0, 1, 4, 5, 4, 5, 0, 0, 2, 2, 0, 0, 2, 2, 8, 8, 10, 10, 8, 8, 10, 10, 0, 1, 0, 1, 4, 5, 4, 5, 0, 1, 0, 1, 4, 5, 4, 5, 16, 17, 16, 17, 20, 21, 20, 21, 16, 17, 16, 17, 20, 21, 20, 21, 0, 0, 2, 2, 0, 0, 2, 2, 8, 8, 10, 10, 8, 8, 10
Offset: 0

Views

Author

Rémy Sigrist, Oct 27 2024

Keywords

Comments

For any n > 0 with binary expansion (b_1 = 1, b_2, ..., b_k), the binary expansion of a(n) is (c_1, ..., c_k) where c_i = b_i when i is even, c_i = 0 when i is odd.

Examples

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

Crossrefs

See A063694, A063695 and A374355 for similar sequences.

Programs

  • PARI
    a(n) = { my (v = 0, x = exponent(n), y); while (n, n -= 2^y = exponent(n); if (x%2 != y%2, v += 2^y;);); return (v); }

Formula

a(n) = 0 iff n belongs to A126684.
a(a(n)) = 0.
a(2*n) = 2*a(n).
Previous Showing 11-13 of 13 results.