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.
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, 19, 20, 12, 21, 13, 22, 23, 14, 24, 15, 25, 26, 16, 27, 28, 17, 29, 18, 30, 31, 19, 32, 20, 33, 34, 21, 35, 36, 22, 37, 23, 38, 39, 24, 40, 41, 25
Offset: 1
References
- Eric Angelini, "Jeux de suites", in Dossier Pour La Science, pp. 32-35, Volume 59 (Jeux math'), April/June 2008, Paris.
Links
- Zak Seidov, Table of n, a(n) for n = 1..1000
- Jon Asier Bárcena-Petisco, Luis Martínez, María Merino, Juan Manuel Montoya, and Antonio Vera-López, Fibonacci-like partitions and their associated piecewise-defined permutations, arXiv:2503.19696 [math.CO], 2025. See p. 3.
- Jeffrey Shallit, The Hurt-Sada Array and Zeckendorf Representations, arXiv:2501.08823 [math.NT], 2025. See p. 10.
Programs
-
Mathematica
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 *)
-
PARI
A026272=apply(t->t-1,A026242[3..-1]) \\ Use vecextract(A026242,"3..") in PARI versions < 2.7. - M. F. Hasler, Sep 17 2014
-
Python
from collections import Counter from itertools import count, islice def agen(): # generator of terms aset, alst, k, mink, counts = set(), [0], 0, 1, Counter() for n in count(1): for k in range(1, len(alst)-1): if k == alst[n-k-1] and counts[alst[n-k-1]] == 1: an = k; break else: an = mink yield an; aset.add(an); alst.append(an); counts.update([an]) while mink in aset: mink += 1 print(list(islice(agen(), 66))) # Michael S. Branicky, Jun 27 2022
Extensions
Edited by Max Alekseyev, May 31 2011
Comments