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.

This page as a plain text file.
%I A304971 #46 Dec 21 2018 14:55:10
%S A304971 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,
%T A304971 27,22,42,25,43,26,60,28,58,30,54,31,45,32,62,37,41,33,61,34,44,36,68,
%U A304971 47,65,39,71,40,66,46,94,49,63,50,100,51,67,48,92,64,72
%N 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.
%C A304971 Apparently every positive integer appears in the sequence.
%H A304971 Rémy Sigrist, <a href="/A304971/b304971.txt">Table of n, a(n) for n = 1..10000</a>
%H A304971 Rémy Sigrist, <a href="/A304971/a304971.png">Scatterplot of (n, a(n)) for n = 1..10000000</a>
%F A304971 a(n) = (3*a(2*n) - a(2*n+1)) / 2.
%e A304971 The first terms, alongside k(n) and associate children, are:
%e A304971   n   a(n)  k(n)  a(2*n)  a(2*n+1)
%e A304971   --  ----  ----  ------  --------
%e A304971    1     1     1       2         4
%e A304971    2     2     1       3         5
%e A304971    3     4     2       6        10
%e A304971    4     3     4       7        15
%e A304971    5     5     3       8        14
%e A304971    6     6     5      11        21
%e A304971    7    10     2      12        16
%e A304971    8     7     2       9        13
%e A304971    9    15     3      18        24
%e A304971   10     8     9      17        35
%o A304971 (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
%o A304971 , a[n]+3*k]); s+=2^(a[n]+k) + 2^(a[n]+3*k); break))); a[1..nn]
%Y A304971 This sequence is a variant of A305410.
%K A304971 nonn,look,nice
%O A304971 1,2
%A A304971 _Rémy Sigrist_, Dec 16 2018