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

A340718 a(n) is the least k such that A340717(k) = n.

Original entry on oeis.org

0, 1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, 27, 31, 33, 35, 37, 39, 43, 45, 47, 51, 55, 63, 65, 67, 69, 71, 73, 75, 77, 79, 83, 85, 87, 91, 93, 95, 99, 103, 107, 111, 119, 127, 129, 131, 133, 135, 137, 139, 141, 143, 147, 149, 151, 153, 155, 157, 159, 163, 165
Offset: 0

Views

Author

Rémy Sigrist, Jan 17 2021

Keywords

Comments

These are also the numbers k such that k <= A030101(k).
All terms, except a(0) = 0, are odd.
For any k > 0, there are A005418(k) terms with k+1 binary digits.
A000225 and A006995 are subsequences.

Examples

			k          | 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, ...
A340717(k) | 0,  1,  1,  2,  1,  3,  2,  4,  1,  5,  3,  6,  2,  6,  4,  7, ...
n          | 0,  1,      2,      3,      4,      5,      6,              7, ...
a(n)       | 0,  1,      3,      5,      7,      9,     11,             15, ...
		

Crossrefs

Programs

  • PARI
    is(n) = n <= fromdigits(Vecrev(binary(n)), 2)

A340716 Lexicographically earliest sequence of positive integers with as many distinct values as possible such that for any n > 0, a(n + pi(n)) = a(n) (where pi(n) = A000720(n) corresponds to the number of prime numbers <= n).

Original entry on oeis.org

1, 2, 2, 3, 2, 3, 4, 2, 3, 5, 4, 2, 3, 5, 6, 4, 2, 7, 3, 5, 6, 4, 8, 2, 7, 9, 3, 5, 6, 4, 10, 8, 2, 7, 9, 3, 5, 11, 6, 4, 12, 10, 8, 2, 7, 9, 3, 13, 5, 11, 6, 4, 14, 12, 10, 15, 8, 2, 7, 9, 16, 3, 13, 5, 11, 6, 4, 17, 14, 12, 10, 15, 8, 2, 18, 7, 9, 19, 16, 3
Offset: 1

Views

Author

Rémy Sigrist, Jan 17 2021

Keywords

Comments

The condition "with as many distinct values as possible" means here that for any distinct m and n, provided the orbits of m and n under the map x -> x + pi(x) do not merge, then a(m) <> a(n).
This sequence has similarities with A003602 (A003602(2*n) = A003602(n)) and with A163491 (A163491(n+ceiling(n/2)) = A163491(n)).

Examples

			The first terms, alongside n + pi(n), are:
  n   a(n)  n + pi(n)
  --  ----  ---------
   1     1          1
   2     2          3
   3     2          5
   4     3          6
   5     2          8
   6     3          9
   7     4         11
   8     2         12
   9     3         13
  10     5         14
  11     4         16
  12     2         17
		

Crossrefs

See A003602, A163491 and A340717 for similar sequences.

Programs

  • PARI
    u=0; for (n=1, #a=vector(80), if (a[n]==0, a[n]=u++); print1 (a[n]", "); m=n+primepi(n); if (m<=#a, a[m]=a[n]))

Formula

a(n) = 2 iff n belongs to A061535.
a(A095116(n)) = n + 1.
Showing 1-2 of 2 results.