A019446 a(n) = ceiling(n/tau), where tau = (1+sqrt(5))/2.
1, 2, 2, 3, 4, 4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 10, 11, 12, 12, 13, 13, 14, 15, 15, 16, 17, 17, 18, 18, 19, 20, 20, 21, 22, 22, 23, 23, 24, 25, 25, 26, 26, 27, 28, 28, 29, 30, 30, 31, 31, 32, 33, 33, 34, 34, 35, 36, 36, 37, 38, 38, 39, 39, 40, 41, 41, 42, 43, 43, 44, 44, 45, 46, 46
Offset: 1
Examples
a(6)=4 since 6-1=[i+j*tau] for these (i,j): (5,0), (4,1), (2,2), (1,3). - _Clark Kimberling_, Jun 18 2002
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- J.-P. Allouche and F. M. Dekking, Generalized Beatty sequences and complementary triples, arXiv:1809.03424 [math.NT], 2018.
- Problem of the week, Problem 818
- J. Rickard, Rearrangement of the natural numbers [Broken link]
- J. Shallit, Proving properties of some greedily-defined integer recurrences via automata theory, arXiv:2308.06544 [cs.DM], August 12 2023.
Programs
-
GAP
a:=[1];; for n in [2..80] do a[n]:=n+1-a[a[n-1]]; od; a; # Muniru A Asiru, Aug 30 2018
-
Haskell
a019446 n = a019446_list !! (n-1) a019446_list = 1 : zipWith (-) [3..] (map a019446 a019446_list) -- Reinhard Zumkeller, Feb 02 2012
-
Maple
A019446:=n->ceil(2*n/(1+sqrt(5))); seq(A019446(n), 1..100); # Wesley Ivan Hurt, Jan 19 2014
-
Mathematica
Ceiling[Range[80]/GoldenRatio] (* Harvey P. Dale, Aug 02 2011 *)
-
Python
from math import isqrt def A019446(n): return (n+isqrt(5*n**2)>>1)-n+1 # Chai Wah Wu, Aug 09 2022
Formula
a(1)=1; a(n) = n+1 - a(a(n-1)). - Benoit Cloitre, Nov 06 2002
a(n) = A019445(n) / n. - Sean A. Irvine, Mar 17 2019
Extensions
Better name from David Radcliffe and John Rickard, Dec 12 2000
Edited by Dean Hickerson, Nov 09 2002
Comments