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.

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

Original entry on oeis.org

1, 2, 4, 3, 5, 6, 10, 7, 15, 8, 14, 11, 21, 12, 16, 9, 13, 18, 24, 17, 35, 19, 29, 20, 38, 23, 27, 22, 42, 25, 43, 26, 60, 28, 58, 30, 54, 31, 45, 32, 62, 37, 41, 33, 61, 34, 44, 36, 68, 47, 65, 39, 71, 40, 66, 46, 94, 49, 63, 50, 100, 51, 67, 48, 92, 64, 72
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         4
   2     2     1       3         5
   3     4     2       6        10
   4     3     4       7        15
   5     5     3       8        14
   6     6     5      11        21
   7    10     2      12        16
   8     7     2       9        13
   9    15     3      18        24
  10     8     9      17        35
		

Crossrefs

This sequence is a variant of A305410.

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]+3*k), a=concat(a, [a[n]+k
    , a[n]+3*k]); s+=2^(a[n]+k) + 2^(a[n]+3*k); break))); a[1..nn]

Formula

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