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.

A026272 a(n) = smallest k such that k=a(n-k-1) is the only appearance of k so far; if there is no such k, then a(n) = least positive integer that has not yet appeared.

This page as a plain text file.
%I A026272 #46 Mar 28 2025 10:19:19
%S A026272 1,2,1,3,2,4,5,3,6,7,4,8,5,9,10,6,11,7,12,13,8,14,15,9,16,10,17,18,11,
%T A026272 19,20,12,21,13,22,23,14,24,15,25,26,16,27,28,17,29,18,30,31,19,32,20,
%U A026272 33,34,21,35,36,22,37,23,38,39,24,40,41,25
%N A026272 a(n) = smallest k such that k=a(n-k-1) is the only appearance of k so far; if there is no such k, then a(n) = least positive integer that has not yet appeared.
%C A026272 From _Daniel Joyce_, Apr 13 2001: (Start)
%C A026272 This sequence displays every positive integer exactly twice and the gap between the two occurrences of n contains exactly n other values. The first occurrence of n precedes the first occurrence of n+1.
%C A026272 Also related to the Wythoff array (A035513) and the Para-Fibonacci sequence (A035513) where every positive integer is displayed exactly once in the whole array. Take any integer n in A026272 and let C = number of terms from the beginning of the sequence to the second occurrence of n. Then C = (2nd term after n in the applicable sequence for n in A035513).
%C A026272 Also in the second occurrence of n in A026272, let N=n ( - one term) = (first term value after n in the applicable sequence for n in A035513). In this format the second occurrence of n in A026272 will produce in A035513, n itself and two of the succeeding terms of n in the Wythoff array where every positive integer can only be displayed once.
%C A026272 In A026272 if |a(n)-a(n+1)| > 10 then phi ~ a(n)/|a(n)-a(n+1)|. When n -> infinity it will converge to phi. (End)
%C A026272 Or, put a copy of n in A000027 n places further along! - _Zak Seidov_, May 24 2008
%C A026272 Another version would prefix this sequence with two leading 0's (see the Angelini reference). If we use this form and write down the indices of the two 0's, the two 1's, the two 2's, the two 3's, etc., then we get A072061. - _Jacques ALARDET_, Jul 26 2008
%D A026272 Eric Angelini, "Jeux de suites", in Dossier Pour La Science, pp. 32-35, Volume 59 (Jeux math'), April/June 2008, Paris.
%H A026272 Zak Seidov, <a href="/A026272/b026272.txt">Table of n, a(n) for n = 1..1000</a>
%H A026272 Jon Asier Bárcena-Petisco, Luis Martínez, María Merino, Juan Manuel Montoya, and Antonio Vera-López, <a href="https://arxiv.org/abs/2503.19696">Fibonacci-like partitions and their associated piecewise-defined permutations</a>, arXiv:2503.19696 [math.CO], 2025. See p. 3.
%H A026272 Jeffrey Shallit, <a href="https://arxiv.org/abs/2501.08823">The Hurt-Sada Array and Zeckendorf Representations</a>, arXiv:2501.08823 [math.NT], 2025. See p. 10.
%F A026272 a(n) = A026242(n+2) - 1 = A026350(n+3) - 2 = A026354(n+4) - 3.
%t A026272 s=Range[1000];n=0;Do[n++;s=Insert[s,n,Position[s,n][[1]]+n+1],{500}];A026272=Take[s,1000] (* _Zak Seidov_, May 24 2008 *)
%o A026272 (PARI) A026272=apply(t->t-1,A026242[3..-1]) \\ Use vecextract(A026242,"3..") in PARI versions < 2.7. - _M. F. Hasler_, Sep 17 2014
%o A026272 (Python)
%o A026272 from collections import Counter
%o A026272 from itertools import count, islice
%o A026272 def agen(): # generator of terms
%o A026272     aset, alst, k, mink, counts = set(), [0], 0, 1, Counter()
%o A026272     for n in count(1):
%o A026272         for k in range(1, len(alst)-1):
%o A026272             if k == alst[n-k-1] and counts[alst[n-k-1]] == 1: an = k; break
%o A026272         else: an = mink
%o A026272         yield an; aset.add(an); alst.append(an); counts.update([an])
%o A026272         while mink in aset: mink += 1
%o A026272 print(list(islice(agen(), 66))) # _Michael S. Branicky_, Jun 27 2022
%Y A026272 Cf. A000027, A035513, A014552, A176127.
%K A026272 nonn,easy,nice
%O A026272 1,2
%A A026272 _Clark Kimberling_
%E A026272 Edited by _Max Alekseyev_, May 31 2011