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.

A004956 a(n) = ceiling(n*phi), where phi is the golden ratio, A001622.

This page as a plain text file.
%I A004956 #67 Jul 30 2025 11:20:07
%S A004956 0,2,4,5,7,9,10,12,13,15,17,18,20,22,23,25,26,28,30,31,33,34,36,38,39,
%T A004956 41,43,44,46,47,49,51,52,54,56,57,59,60,62,64,65,67,68,70,72,73,75,77,
%U A004956 78,80,81,83,85,86,88,89
%N A004956 a(n) = ceiling(n*phi), where phi is the golden ratio, A001622.
%C A004956 a(0)=0, a(1)=2; for n > 1, a(n) = a(n-1) + 2 if n is already in the sequence, a(n) = a(n-1) + 1 otherwise.
%C A004956 Integer solutions to the equation x = ceiling(phi*floor(x/phi)). - _Benoit Cloitre_, Feb 14 2004
%C A004956 From _Benoit Cloitre_, Mar 05 2007: (Start)
%C A004956 The following is an alternative way to obtain this sequence. NP means "term not in parentheses". Write down the natural numbers and mark the least NP, which is 1:
%C A004956 1* 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ...
%C A004956 Take the first NP (which is 1) and parenthesize it; mark the least NP (which is 2):
%C A004956 (1*) 2* 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ...
%C A004956 Take the 2nd NP (which is 3) and parenthesize it; mark the next NP (which is 4):
%C A004956 (1*) 2* (3) 4* 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ...
%C A004956 Take the 4th NP (which is 6) and parenthesize it; mark the next NP (which is 5):
%C A004956 (1*) 2* (3) 4* 5* (6) 7 8 9 10 11 12 13 14 15 16 17 18 19 ...
%C A004956 Continuing in this way we obtain
%C A004956 (1*) 2* (3) 4* 5* (6) 7* (8) 9* 10* (11) 12* 13* (14) 15* (16) 17* (18) 19* ...
%C A004956 The starred entries (after the first) give the sequence. (End)
%C A004956 From _Rick L. Shepherd_, Dec 05 2009: (Start)
%C A004956 An equivalent statement of the sieving process described by _Benoit Cloitre_ on Mar 05 2007:
%C A004956 Begin with the natural numbers N. Repeatedly perform these two steps:
%C A004956 i) Let k = N's least remaining term not yet used in Step ii).
%C A004956 ii) Remove the k-th remaining term from N.
%C A004956 The remaining terms of N are the (positive) terms shared by this sequence and A026351.
%C A004956 The terms removed from N (the complement) are A026352's terms (see also A004957).
%C A004956 The PARI program performs this sieving process and prints the positive terms of this sequence. (End)
%C A004956 In the Fokkink-Joshi paper, apart from a(0) = 0, this sequence is the Cloitre (0,2,2,1)-hiccup sequence, i.e., a(1) = 2; for m < n, a(n) = a(n-1)+2 if a(m) = n, else a(n) = a(n-1)+1. - _Michael De Vlieger_, Jul 30 2025
%H A004956 Christian Krause, <a href="/A004956/b004956.txt">Table of n, a(n) for n = 0..10000</a>
%H A004956 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 A004956 Benoit Cloitre, <a href="https://arxiv.org/abs/2506.18103">A study of a family of self-referential sequences</a>, arXiv:2506.18103 [math.GM], 2025. See p. 7.
%H A004956 Benoit Cloitre, N. J. A. Sloane and M. J. Vandermast, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL6/Cloitre/cloitre2.html">Numerical analogues of Aronson's sequence</a>, J. Integer Seqs., Vol. 6 (2003), #03.2.2.
%H A004956 Benoit Cloitre, N. J. A. Sloane and M. J. Vandermast, <a href="https://arxiv.org/abs/math/0305308">Numerical analogues of Aronson's sequence</a>, arXiv:math/0305308 [math.NT], 2003.
%H A004956 Robbert Fokkink and Gandhar Joshi, <a href="https://arxiv.org/abs/2507.16956">On Cloitre's hiccup sequences</a>, arXiv:2507.16956 [math.CO], 2025. See p. 3.
%t A004956 Ceiling[Range[0,100]GoldenRatio] (* _Paolo Xausa_, Oct 28 2023 *)
%t A004956 (* Second program: *)
%t A004956 cloitreH[j_, x_, y_, z_, w_ : 120] := Module[{c, k}, c[_] := False; k = x; c[x] = True; {x}~Join~Reap[Do[If[c[n - j], k += y, k += z]; c[k] = True; Sow[k], {n, 2, w}] ][[-1, 1]] ]; {0}~Join~cloitreH[0, 2, 2, 1] (* _Michael De Vlieger_, Jul 30 2025 *)
%o A004956 (PARI) {/* paws = Print Absolute values of all elements in vector v With same Sign as sn */
%o A004956 paws(v,sn) = for(m=1,matsize(v)[2], if(sign(v[m])==sign(sn),\
%o A004956 print1(abs(v[m]),",")))}
%o A004956 {/* Sieve through lim numbers; make values negative to signify "removed" */
%o A004956 lim=100; v=vector(lim,i,i); i=0; j=0; c=1;
%o A004956 while(i<lim, i++; if(v[i]>0, k=v[i]; c=c--;
%o A004956 while(c<k && j<lim, j++; if(v[j]>0, c++)); v[j]=-v[j])); paws(v,1)\
%o A004956 /* Changing "1" to "-1" in paws() above prints out the terms of A026352 instead */} \\ _Rick L. Shepherd_, Dec 05 2009
%o A004956 (PARI) a(n) = ceil(n*(1 + sqrt(5))/2); \\ _Michel Marcus_, Apr 13 2021
%Y A004956 Cf. A001622, A004957, A026352 (Cloitre (1,1,2,3)-hiccup sequence).
%Y A004956 Essentially same as A026351.
%K A004956 nonn,easy
%O A004956 0,2
%A A004956 _N. J. A. Sloane_