A064437 a(1)=1, a(n) = a(n-1) + 3 if n is already in the sequence, a(n) = a(n-1) + 2 otherwise.
1, 3, 6, 8, 10, 13, 15, 18, 20, 23, 25, 27, 30, 32, 35, 37, 39, 42, 44, 47, 49, 51, 54, 56, 59, 61, 64, 66, 68, 71, 73, 76, 78, 80, 83, 85, 88, 90, 93, 95, 97, 100, 102, 105, 107, 109, 112, 114, 117, 119, 122, 124, 126, 129, 131, 134, 136, 138, 141, 143, 146, 148, 150
Offset: 1
Keywords
Examples
a(6)=13 hence a(13) = a(12) + 3 = 27 + 3 = 30.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
- Benoit Cloitre, A study of a family of self-referential sequences, arXiv:2506.18103 [math.GM], 2025. See p. 7.
- Benoit Cloitre, N. J. A. Sloane and M. J. Vandermast, Numerical analogues of Aronson's sequence, J. Integer Seqs., Vol. 6 (2003), #03.2.2.
- Benoit Cloitre, N. J. A. Sloane and M. J. Vandermast, Numerical analogues of Aronson's sequence, arXiv:math/0305308 [math.NT], 2003.
- Robbert Fokkink and Gandhar Joshi, On Cloitre's hiccup sequences, arXiv:2507.16956 [math.CO], 2025. See pp. 2-3, 8.
Programs
-
Haskell
a064437 n = a064437_list !! (n-1) a064437_list = 1 : f 2 [1] where f x zs@(z:_) = y : f (x + 1) (y : zs) where y = if x `elem` zs then z + 3 else z + 2 -- Reinhard Zumkeller, Sep 26 2014
-
Maple
A064437:= n -> ceil((1+sqrt(2))*(n-1)+1/(2+sqrt(2))): seq(A064437(n),n=1..100); # Robert Israel, May 19 2014
-
Mathematica
a[1] = 1; a[n_] := a[n] = a[n-1] + If[MemberQ[Array[a, n-1], n], 3, 2]; Array[a, 100] (* Jean-François Alcover, Aug 01 2018 *)
-
PARI
an=vector(100); an[1]=1; a(n)=if(n<0,0,an[n]); x=1; y=3; z=2; an[1]=x; for(n=2,100,an[n]=if(setsearch(Set(vector(n- 1,i,a(i))),n),a(n-1)+y,a(n-1)+z)); an
Formula
a(n) = ceiling((1+sqrt(2))*(n-1)+C) where C = 1/(2+sqrt(2)) = 0.292893218813...
Comments