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.

A167151 a(2n+1) = a(2n) + a(2n-1), a(2n)=least number not yet in the sequence, a(1)=1.

This page as a plain text file.
%I A167151 #22 Dec 02 2021 07:33:41
%S A167151 0,1,2,3,4,7,5,12,6,18,8,26,9,35,10,45,11,56,13,69,14,83,15,98,16,114,
%T A167151 17,131,19,150,20,170,21,191,22,213,23,236,24,260,25,285,27,312,28,
%U A167151 340,29,369,30,399,31,430,32,462,33,495,34,529,36,565,37,602,38,640,39,679
%N A167151 a(2n+1) = a(2n) + a(2n-1), a(2n)=least number not yet in the sequence, a(1)=1.
%C A167151 Lexicographically earliest reordering of the nonnegative integers (can be extended by symmetry to a permutation of all integers) such that a(2n+1) = a(2n) + a(2n-1).
%H A167151 M. F. Hasler, <a href="/A167151/b167151.txt">Table of n, a(n) for n = 0..2000</a>
%H A167151 <a href="/index/Ho#Hofstadter">Index entries for Hofstadter-type sequences</a>
%H A167151 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A167151 a(2n-1) = A005228(n); a(2n) = A030124(n).
%t A167151 a[0] = 0; a[1] = 1;
%t A167151 a[n_?OddQ] := a[n] = a[n - 1] + a[n - 2];
%t A167151 a[n_?EvenQ] := a[n] = For[k = 2, True, k++,
%t A167151      If[FreeQ[Array[a, n - 1], k], Return[k]]];
%t A167151 Table[a[n], {n, 0, 100}] (* _Jean-François Alcover_, Dec 02 2021 *)
%o A167151 (PARI) {used=[]; print1(b=0); a=1; for(i=1,99, used=setunion(used,Set(a+=b)); while(setsearch(used,b++), used=setminus(used,Set(b))); print1(", "a", "b))}
%o A167151 (Haskell)
%o A167151 import Data.List (transpose)
%o A167151 a167151 n = a167151_list !! n
%o A167151 a167151_list = 0 : concat (transpose [a005228_list, a030124_list])
%o A167151 -- _Reinhard Zumkeller_, May 17 2013
%Y A167151 Cf. A022941, A143344, A156031.
%Y A167151 Cf. A225850 (inverse).
%K A167151 easy,nonn
%O A167151 0,3
%A A167151 _M. F. Hasler_, Nov 01 2009