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.

Showing 1-6 of 6 results.

A001462 Golomb's sequence: a(n) is the number of times n occurs, starting with a(1) = 1.

Original entry on oeis.org

1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 19
Offset: 1

Views

Author

Keywords

Comments

It is understood that a(n) is taken to be the smallest number >= a(n-1) which is compatible with the description.
In other words, this is the lexicographically earliest nondecreasing sequence of positive numbers which is equal to its RUNS transform. - N. J. A. Sloane, Nov 07 2018
Also called Silverman's sequence.
Vardi gives several identities satisfied by A001463 and this sequence.
We can interpret this sequence as a triangle: start with 1; 2,2; 3,3; and proceed by letting the row sum of row m-1 be the number of elements of row m. The partial sums of the row sums give 1, 5, 11, 38, 272, ... Conjecture: this proceeds as Lionel Levine's sequence A014644. See also A113676. - Floor van Lamoen, Nov 06 2005
A Golomb-type sequence, that is, one with the property of being a sequence of run length of itself, can be built over any sequence with distinct terms by repeating each term a corresponding number of times, in the same manner as a(n) is built over natural numbers. See cross-references for more examples. - Ivan Neretin, Mar 29 2015
From Amiram Eldar, Jun 19 2021: (Start)
Named after the American mathematician Solomon Wolf Golomb (1932-2016).
Guy (2004) called it "Golomb's self-histogramming sequence", while in previous editions of his book (1981 and 1994) he called it "Silverman's sequence" after David Silverman. (End)
a(n) is also the number of numbers that occur n times. - Leo Crabbe, Feb 15 2025

Examples

			a(1) = 1, so 1 only appears once. The next term is therefore 2, which means 2 appears twice and so a(3) is also 2 but a(4) must be 3. And so on.
G.f. = x + 2*x^2 + 2*x^3 + 3*x^4 + 3*x^5 + 4*x^6 + 4*x^7 + 4*x^8 + ... - _Michael Somos_, Nov 07 2018
		

References

  • Graham Everest, Alf van der Poorten, Igor Shparlinski and Thomas Ward, Recurrence Sequences, Amer. Math. Soc., 2003; p. 10.
  • Ronald L. Graham, Donald E. Knuth and Oren Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 66.
  • Richard K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, 2004, Section E25, p. 347-348.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane, Seven Staggering Sequences, in Homage to a Pied Puzzler, E. Pegg Jr., A. H. Schoen and T. Rodgers (editors), A. K. Peters, Wellesley, MA, 2009, pp. 93-110.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A001463 (partial sums) and A262986 (start of first run of length n).
First differences are A088517.
Golomb-type sequences over various substrates (from Glen Whitney, Oct 12 2015):
A000002 and references therein (over periodic sequences),
A109167 (over nonnegative integers),
A080605 (over odd numbers),
A080606 (over even numbers),
A080607 (over multiples of 3),
A169682 (over primes),
A013189 (over squares),
A013322 (over triangular numbers),
A250983 (over integral sums of itself).
Applying "ee Rabot" to this sequence gives A319434.
See also A095114.

Programs

  • Haskell
    a001462 n = a001462_list !! (n-1)
    a001462_list = 1 : 2 : 2 : g 3  where
       g x = (replicate (a001462 x) x) ++ g (x + 1)
    -- Reinhard Zumkeller, Feb 09 2012
    
  • Magma
    [ n eq 1 select 1 else 1+Self(n-Self(Self(n-1))) : n in [1..100] ]; // Sergei Haller (sergei(AT)sergei-haller.de), Dec 21 2006
    
  • Maple
    N:= 10000: A001462[1]:= 1: B[1]:= 1: A001462[2]:= 2:
    for n from 2 while B[n-1] <= N do
      B[n]:= B[n-1] + A001462[n];
      for j from B[n-1]+1 to B[n] do A001462[j]:= n end do
    end do:
    seq(A001462[j],j=1..N); # Robert Israel, Oct 30 2012
  • Mathematica
    a[1] = 1; a[n_] := a[n] = 1 + a[n - a[a[n - 1]]]; Table[ a[n], {n, 84}] (* Robert G. Wilson v, Aug 26 2005 *)
    GolSeq[n_]:=Nest[(k = 0; Flatten[# /. m_Integer :> (ConstantArray[++k,m])]) &, {1, 2}, n]
    GolList=Nest[(k = 0;Flatten[# /.m_Integer :> (ConstantArray[++k,m])]) &, {1, 2},7]; AGolList=Accumulate[GolList]; Golomb[n_]:=Which[ n <= Length[GolList], GolList[[n]], n <= Total[GolList],First[FirstPosition[AGolList, ?(# > n &)]], True, $Failed] (* _JungHwan Min, Nov 29 2015 *)
  • PARI
    a = [1, 2, 2]; for(n=3, 20, for(i=1, a[n], a = concat(a, n))); a /* Michael Somos, Jul 16 1999 */
    
  • PARI
    {a(n) = my(A, t, i); if( n<3, max(0, n), A = vector(n); t = A[i=2] = 2; for(k=3, n, A[k] = A[k-1] + if( t--==0, t = A[i++]; 1)); A[n])}; /* Michael Somos, Oct 21 2006 */
    
  • Python
    a=[0, 1, 2, 2]
    for n in range(3, 21):a+=[n for i in range(1, a[n] + 1)]
    a[1:] # Indranil Ghosh, Jul 05 2017

Formula

a(n) = phi^(2-phi)*n^(phi-1) + E(n), where phi is the golden number (1+sqrt(5))/2 (Marcus and Fine) and E(n) is an error term which Vardi shows is O( n^(phi-1) / log n ).
a(1) = 1; a(n+1) = 1 + a(n+1-a(a(n))). - Colin Mallows
a(1)=1, a(2)=2 and for a(1) + a(2) + ... + a(n-1) < k <= a(1) + a(2) + ... + a(n) we have a(k)=n. - Benoit Cloitre, Oct 07 2003
G.f.: Sum_{n>0} a(n) x^n = Sum_{k>0} x^a(k). - Michael Somos, Oct 21 2006
a(A095114(n)) = n and a(m) < n for m < A095114(n). - Reinhard Zumkeller, Feb 09 2012 [First inequality corrected from a(m) < m by Glen Whitney, Oct 06 2015]
Conjecture: a(n) >= n^(phi-1) for all n. - Jianing Song, Aug 19 2021
a(n) = A095114(n+1) - A095114(n). - Alan Michael Gómez Calderón, Dec 21 2024 after Ralf Stephan

A080605 Golomb's sequence using odd integers.

Original entry on oeis.org

1, 3, 3, 3, 5, 5, 5, 7, 7, 7, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11, 13, 13, 13, 13, 13, 15, 15, 15, 15, 15, 15, 15, 17, 17, 17, 17, 17, 17, 17, 19, 19, 19, 19, 19, 19, 19, 21, 21, 21, 21, 21, 21, 21, 21, 21, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25, 25, 25, 25, 25, 25, 25, 25, 25, 27
Offset: 1

Views

Author

Benoit Cloitre, Feb 25 2003

Keywords

Examples

			Read 1,3,3,3,5,5,5,7,7,7,9,9,9,9,9,11,11,11,11,11, as 1,(3,3,3),(5,5,5),(7,7,7),(9,9,9,9,9),(11,11,11,11,11), count occurrences between 2 parentheses, gives 1,3,3,3,5,5,... which is the sequence itself.
		

Crossrefs

Programs

  • PARI
    a=[1,3,3,3];for(n=3,20,for(i=1,a[n],a=concat(a,2*n-1)));a

Formula

a(n) = tau^(2-tau)*(2n)^(tau-1)+O(n^(tau-1)/log(n)) where tau is the golden ratio.

Extensions

Corrected at the suggestion of Kevin Ryde by Benoit Cloitre, May 31 2012

A080607 Golomb's sequence using multiples of 3.

Original entry on oeis.org

3, 3, 3, 6, 6, 6, 9, 9, 9, 12, 12, 12, 12, 12, 12, 15, 15, 15, 15, 15, 15, 18, 18, 18, 18, 18, 18, 21, 21, 21, 21, 21, 21, 21, 21, 21, 24, 24, 24, 24, 24, 24, 24, 24, 24, 27, 27, 27, 27, 27, 27, 27, 27, 27, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 33, 33, 33, 33, 33, 33
Offset: 1

Views

Author

Benoit Cloitre, Feb 25 2003

Keywords

Comments

More generally let b(k) be a sequence of integers in arithmetic progression: b(k) = A*k+B, then the Golomb's sequence a(n) using b(k) is asymptotic to tau^(2-tau)*(A*n)^(tau-1).

Examples

			Read 3,3,3,6,6,6,9,9,9,12,12,12,12,12,12,15 as (3,3,3),(6,6,6),(9,9,9),(12,12,12,12,12,12),... count occurrences between 2 parentheses, gives 3,3,3,6,... which is the sequence itself.
		

Crossrefs

Programs

  • Mathematica
    a = {3, 3, 3}; Do[a = Join[a, Array[3i&, a[[i]]]], {i, 2, 11}]; a (* Ivan Neretin, Apr 03 2015 *)

Formula

a(n) is asymptotic to tau^(2-tau)*(3n)^(tau-1) and more precisely it seems that a(n) = round(tau^(2-tau)*(3n)^(tau-1)) +(-2, -1, +0, +1 or +1) where tau is the golden ratio.

A013189 All terms are squares and a(n) is length of n-th run.

Original entry on oeis.org

1, 4, 4, 4, 4, 9, 9, 9, 9, 16, 16, 16, 16, 25, 25, 25, 25, 36, 36, 36, 36, 36, 36, 36, 36, 36, 49, 49, 49, 49, 49, 49, 49, 49, 49, 64, 64, 64, 64, 64, 64, 64, 64, 64, 81, 81, 81, 81, 81, 81, 81, 81, 81, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100
Offset: 1

Views

Author

Keywords

Comments

Golomb's sequence using squares. - Benoit Cloitre, Apr 20 2003

Crossrefs

Programs

  • Mathematica
    f[s_] := Join@@Table[i^2, {i, Length[s]}, {s[[i]]}]; Nest[f, {1, 4}, 3]

Formula

n-th term, divided by n, tends to square root of two.

A113724 A variant of Golomb's sequence using even numbers: a(n) is the number of times 2*n+2 occurs, starting with a(1) = 2.

Original entry on oeis.org

2, 4, 4, 6, 6, 6, 6, 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 12, 12, 12, 12, 12, 12, 14, 14, 14, 14, 14, 14, 16, 16, 16, 16, 16, 16, 18, 18, 18, 18, 18, 18, 18, 18, 20, 20, 20, 20, 20, 20, 20, 20, 22, 22, 22, 22, 22, 22, 22, 22, 24, 24, 24, 24, 24, 24, 24, 24, 26, 26, 26, 26, 26, 26
Offset: 1

Views

Author

Floor van Lamoen and Paul D. Hanna, Nov 08 2005

Keywords

Comments

a(n) is taken to be the smallest number >= a(n-1) which is compatible with the description.

Examples

			Start with 2 in row 1 and form a triangle where row n is generated from row n-1 by the rule given in the description. Then row 2 will have (2) 4's, row 3 will have (4) 6's and (4) 8's, etc.
The triangle begins:
2;
4,4;
6,6,6,6,8,8,8,8; ...
The number of terms in each row (also row sums with offset) is given by A113725: [1,2,8,56,984,87848,115679160,...].
		

Crossrefs

Cf. A001462 (Golomb's sequence), A113725, A113722, A113676.
Cf. A080606. [From R. J. Mathar, Aug 13 2008]

Programs

  • PARI
    a=[2,4,4];for(n=2,20, for(i=1,a[n],a=concat(a,2*n+2)));a

A111439 Variation of Golomb's sequence: a(n) is the number of times n appears with a(n) unequal to a(n-1).

Original entry on oeis.org

1, 2, 3, 2, 3, 4, 3, 4, 5, 6, 5, 6, 5, 6, 7, 6, 7, 8, 7, 8, 9, 8, 9, 8, 9, 10, 9, 10, 9, 10, 11, 10, 11, 10, 11, 10, 11, 12, 11, 12, 13, 12, 13, 12, 13, 12, 13, 12, 13, 14, 15, 14, 15, 14, 15, 14, 15, 14, 15, 14, 15, 16, 15, 16, 17, 16, 17, 16, 17
Offset: 1

Views

Author

Floor van Lamoen, Nov 14 2005

Keywords

Comments

a(n) is understood to be the smallest number >=a(n-2) fitting the description.

Crossrefs

Bisections: A080606 and A080605. Cf. A001462 (Golomb's sequence).

Programs

  • PARI
    r = vector(69,k,-1); p = 0; for (i=1, #r, v = 1; while (v==p || r[v]==0, v++); r[i]=v; r[v]--; print1 (v ", "); p=v); \\ Rémy Sigrist, Jan 28 2017

Extensions

Offset corrected by Rémy Sigrist, Jan 28 2017
Showing 1-6 of 6 results.