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.

A385114 a(n) is the least k with k > a(n-1) such that A000120(k) = A002487(n), with a(0) = 0.

Original entry on oeis.org

0, 1, 2, 3, 4, 7, 9, 11, 16, 23, 25, 31, 33, 47, 49, 51, 64, 79, 83, 127, 131, 255, 271, 319, 320, 351, 355, 383, 385, 415, 417, 419, 512, 543, 551, 767, 771, 2047, 2111, 2559, 2561, 3071, 3135, 8191, 8207, 10239, 10271, 10367, 12288, 12415, 12431, 13311, 13315, 14335
Offset: 0

Views

Author

Karl-Heinz Hofmann, Jun 18 2025

Keywords

Examples

			  n |  a(n)_2   a(n)   A002487(n)
----+-----------------------------
  0 |       0     0       0
  1 |       1     1       1
  2 |      10     2       1
  3 |      11     3       2
  4 |     100     4       1
  5 |     111     7       3
  6 |    1001     9       2
  7 |    1011    11       3
  8 |   10000    16       1
  9 |   10111    23       4
 10 |   11001    25       3
 11 |   11111    31       5
 12 |  100001    33       2
 13 |  101111    47       5
 14 |  110001    49       3
		

Crossrefs

Programs

  • Mathematica
    k = s[0] = 0; s[1] = 1; s[n_] := s[n] = If[EvenQ[n], s[n/2], s[(n - 1)/2] + s[(n + 1)/2]]; Array[s, 2^10]; {k}~Join~Monitor[Table[Set[k, Max[k + 1, 2^s[n] - 1]]; While[DigitCount[k, 2, 1] != s[n], k++]; k, {n, 100}], n] (* Michael De Vlieger, Jul 14 2025 *)
  • PARI
    lista(nn) = my(list = List([0]), last = 0); for (n=1, nn, my(k=last+1, d=dia(n)); while (hammingweight(k) != d, k++); last = k; listput(list, k);); Vec(list); \\ Michel Marcus, Jul 12 2025
    
  • Python
    # see links

Formula

a(A212288(n)) >= 2^A212289(n+1) - 1. - Hugo Pfoertner, Jul 15 2025