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.

A305410 a(1) = 1, and for any n > 0, a(2*n) = a(n) + k(n) and a(2*n+1) = a(n) + 2 * k(n) where k(n) is the least positive integer not leading to a duplicate term.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Dec 16 2018

Keywords

Comments

Apparently, every positive integer appears in the sequence.

Examples

			The first terms, alongside k(n) and associate children, are:
  n   a(n)  k(n)  a(2*n)  a(2*n+1)
  --  ----  ----  ------  --------
   1     1     1       2         3
   2     2     2       4         6
   3     3     2       5         7
   4     4     4       8        12
   5     6     4      10        14
   6     5     4       9        13
   7     7     4      11        15
   8     8     8      16        24
   9    12     5      17        22
  10    10     8      18        26
		

Crossrefs

This sequence is a variant of A322510.

Programs

  • PARI
    lista(nn) = my (a=[1], s=2^a[1]); for (n=1, ceil(nn/2), for (k=1, oo, if (!bittest(s, a[n]+k) && !bittest(s, a[n]+2*k), a=concat(a, [a[n]+k, a[n]+2*k]); s+=2^(a[n]+k) + 2^(a[n]+2*k); break))); a[1..nn]

Formula

a(n) = 2*a(2*n) - a(2*n + 1).

Extensions

Name corrected by Rémy Sigrist, Apr 26 2020