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.

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

This page as a plain text file.
%I A322510 #22 Dec 20 2019 08:55:55
%S A322510 0,1,-1,4,-2,2,-4,5,3,6,-10,7,-3,8,-16,15,-5,12,-6,19,-7,-9,-11,22,-8,
%T A322510 9,-15,28,-12,-14,-18,16,14,10,-20,13,11,17,-29,20,18,21,-35,23,-41,
%U A322510 24,-46,57,-13,26,-42,35,-17,25,-55,29,27,30,-54,31,-59,32,-68
%N A322510 a(1) = 0, and for any n > 0, a(2*n) = a(n) + k(n) and a(2*n+1) = a(n) - k(n) where k(n) is the least positive integer not leading to a duplicate term in sequence a.
%C A322510 The point is that the same k(n) must be used for both a(2*n) and a(2*n+1). - _N. J. A. Sloane_, Dec 17 2019
%C A322510 Apparently every signed integer appears in the sequence.
%H A322510 Rémy Sigrist, <a href="/A322510/b322510.txt">Table of n, a(n) for n = 1..10000</a>
%F A322510 a(n) = (a(2*n) + a(2*n+1))/2.
%e A322510 The first terms, alongside k(n) and associate children, are:
%e A322510   n   a(n)  k(n)  a(2*n)  a(2*n+1)
%e A322510   --  ----  ----  ------  --------
%e A322510    1     0     1       1        -1
%e A322510    2     1     3       4        -2
%e A322510    3    -1     3       2        -4
%e A322510    4     4     1       5         3
%e A322510    5    -2     8       6       -10
%e A322510    6     2     5       7        -3
%e A322510    7    -4    12       8       -16
%e A322510    8     5    10      15        -5
%e A322510    9     3     9      12        -6
%e A322510   10     6    13      19        -7
%o A322510 (PARI) lista(nn) = my (a=[0], s=Set(0)); for (n=1, ceil(nn/2), for (k=1, oo, if (!setsearch(s, a[n]+k) && !setsearch(s, a[n]-k), a=concat(a, [a[n]+k, a[n]-k]); s=setunion(s, Set([a[n]+k, a[n]-k])); break))); a[1..nn]
%Y A322510 For k(n) see A330337, A330338.
%Y A322510 See A305410, A304971 and A322574-A322575 for similar sequences.
%K A322510 sign,look
%O A322510 1,4
%A A322510 _Rémy Sigrist_, Dec 13 2018