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.

Previous Showing 11-20 of 25 results. Next

A006999 Partitioning integers to avoid arithmetic progressions of length 3.

Original entry on oeis.org

0, 1, 2, 4, 7, 11, 17, 26, 40, 61, 92, 139, 209, 314, 472, 709, 1064, 1597, 2396, 3595, 5393, 8090, 12136, 18205, 27308, 40963, 61445, 92168, 138253, 207380, 311071, 466607, 699911, 1049867, 1574801, 2362202, 3543304, 5314957, 7972436
Offset: 0

Views

Author

N. J. A. Sloane, D. R. Hofstadter, and James Propp, Jul 15 1977

Keywords

Comments

a(n) = A006997(3^n-1).
It appears that, aside from the first term, this is the (L)-sieve transform of A016789 ={2,5,8,11,...,3n+2....}. This has been verified up to a(30)=311071. See A152009 for the definition of the (L)-sieve transform. - John W. Layman, Nov 20 2008
a(n) is also the largest-index square reachable in n jumps if we start at square 0 of the Infinite Sidewalk. - Jose Villegas, Mar 27 2023

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A061419, A061418, A005428 (first differences), A083286.
Cf. A003312.

Programs

  • Haskell
    a006999 n = a006999_list !! n
    a006999_list = 0 : map ((`div` 2) . (+ 2) . (* 3)) a006999_list
    -- Reinhard Zumkeller, Oct 26 2011
  • Mathematica
    a[0] = 0; a[n_] := a[n] = Floor[(3 a[n-1] + 2)/2];
    Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Aug 01 2018 *)
  • PARI
    a(n)=if(n<1,0,floor((3*a(n-1)+2)/2))
    

Formula

a(n) = A061419(n) - 1.
a(n) = A061418(n) - 2.
a(n) = floor((3a(n-1)+2)/2).
a(n) = -1 + floor(c*(3/2)^n) where c=1.0815136... - Benoit Cloitre, Jan 10 2002; this constant c is 2/3*K(3) (see A083286). - Ralf Stephan, May 29 2003
a(n+1) = (3*a(n))/2+1 if a(n) is even. a(n+1) = (3*a(n)+1)/2 if a(n) is odd. - Miquel Cerda, Jun 15 2019

Extensions

More terms from James Sellers, Feb 06 2000

A060144 a(n) = floor(n/(1+tau)), or equivalently floor(n/(tau)^2), where tau is the golden ratio (A001622).

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 14, 14, 14, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 19, 19, 19, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 24, 24, 24, 25, 25, 25, 26, 26, 27, 27, 27, 28, 28, 29, 29
Offset: 0

Views

Author

Clark Kimberling, Mar 05 2001

Keywords

Comments

The RUNS transform of this sequence appears to be yet another version of the Fibonacci word (cf. A001468, A001950, A076662). - N. J. A. Sloane, Mar 29 2025

Crossrefs

Programs

  • Haskell
    a060144 n = a060144_list !! n
    a060144_list = 0 : 0 : scanl1 (+) a003849_list
    -- Reinhard Zumkeller, Apr 07 2012
    
  • Maple
    A060144 := proc(n)
        (3+sqrt(5))/2 ;
        floor(n/%) ;
    end proc:
    seq(A060144(n),n=0..100) ; # R. J. Mathar, Jul 29 2021
  • Mathematica
    Table[Floor[n/GoldenRatio^2], {n, 0, 100}] (* T. D. Noe, Dec 10 2011 *)
  • PARI
    { default(realprecision, 10); f=2/(sqrt(5) + 3); for (n=0, 1000, write("b060144.txt", n, " ", floor(n*f)); ) } \\ Harry J. Smith, Jul 02 2009
    
  • Python
    from math import isqrt
    def A060144(n): return (n<<1)-1-(n+isqrt(5*n**2)>>1) if n else 0 # Chai Wah Wu, Aug 09 2022

Formula

For n>0, a(n)=n reduced modulo A005206(n). - Benoit Cloitre, Jan 01 2003
Let n' = n-1. Above formula is better as a(n') = n'-A005206(n'). Also a(n') = A005206(A005206(n'-1)). Also a(n'+1) = n'-a(n')-a(n'-a(n')), with a(0) = 0. - Frank Ruskey, Dec 09 2011
a(n+1) = n - A005206(n). - Reinhard Zumkeller, Apr 07 2012
a(n) = floor(n*A132338). - R. J. Mathar, Jul 29 2021

A060143 a(n) = floor(n/tau), where tau = (1 + sqrt(5))/2.

Original entry on oeis.org

0, 0, 1, 1, 2, 3, 3, 4, 4, 5, 6, 6, 7, 8, 8, 9, 9, 10, 11, 11, 12, 12, 13, 14, 14, 15, 16, 16, 17, 17, 18, 19, 19, 20, 21, 21, 22, 22, 23, 24, 24, 25, 25, 26, 27, 27, 28, 29, 29, 30, 30, 31, 32, 32, 33, 33, 34, 35, 35, 36, 37, 37, 38, 38, 39, 40, 40, 41, 42, 42, 43, 43, 44, 45, 45
Offset: 0

Views

Author

Clark Kimberling, Mar 05 2001

Keywords

Comments

Fibonacci base shift right: for n >= 0, a(n+1) = Sum_{k in A_n} F_{k-1}, where n = Sum_{k in A_n} F_k (unique) expression of n as a sum of "noncontiguous" Fibonacci numbers (with index >=2). - Michele Dondi (bik.mido(AT)tiscalenet.it), Dec 30 2001 [corrected, and aligned with sequence offset by Peter Munn, Jan 10 2018]
Numerators a(n) of fractions slowly converging to phi, the golden ratio: let a(1) = 0, b(n) = n - a(n); if (a(n) + 1) / b(n) < (1 + sqrt(5))/2, then a(n+1) = a(n) + 1, else a(n+1) = a(n). a(n) + b(n) = n and as n -> +infinity, a(n) / b(n) converges to (1 + sqrt(5))/2. For all n, a(n) / b(n) < (1 + sqrt(5))/2. - Robert A. Stump (bee_ess107(AT)msn.com), Sep 22 2002
a(10^n) gives the first few digits of phi=(sqrt(5)-1)/2.
Comment corrected, two alternative ways, by Peter Munn, Jan 10 2018: (Start)
(a(n) = a(n+1) or a(n) = a(n-1)) if and only if a(n) is in A066096.
a(n+1) = a(n+2) if and only if n is in A003622.
(End)
From Wolfdieter Lang, Jun 28 2011: (Start)
a(n+1) counts for n >= 1 the number of Wythoff A-numbers not exceeding n.
a(n+1) counts also the number of Wythoff B-numbers smaller than A(n+2), with the Wythoff A- and B-sequences A000201 and A001950, respectively.
a(n+1) = Sum_{j=1..n} A005614(j-1) for n >= 1 (no rounding problems like in the above definition, because the rabbit sequence A005614(n-1) for n >= 1, can be defined by a substitution rule).
a(n+1) = A(n+1)-(n+1) (serving, together with the last equation, as definition for A(n+1), given the rabbit sequence).
a(n+1) = A005206(n), n >= 0.
(End)
Let b(n) = floor((n+1)/phi). Then b(n) + b(b(n-1)) = n [Granville and Rasson]. - N. J. A. Sloane, Jun 13 2014

Examples

			a(6)= 3 so b(6) = 6 - 3 = 3. a(7) = 4 because (a(6) + 1) / b(6) = 4/3 which is < (1 + sqrt(5))/2. So b(7) = 7 - 4 = 3. a(8) = 4 because (a(7) + 1) / b(7) = 5/3 which is > (1 + sqrt(5))/2. - Robert A. Stump (bee_ess107(AT)msn.com), Sep 22 2002
From _Wolfdieter Lang_, Jun 28 2011: (Start)
There are a(4) = 2 (positive) Wythoff A-numbers <= 3, namely 1 and 3.
There are a(4) = 2 (positive) Wythoff B-numbers < A(4) = 6, namely 2 and 5.
a(4) = 2 = A(4) - 4 = 6 - 4.
(End)
		

Crossrefs

Cf. A000045 (Fibonacci numbers), A003622, A022342, A035336.
Terms that occur only once: A001950.
Terms that occur twice: A066096 (a version of A000201).
Numerator sequences for other values, as described in Robert A. Stump's 2002 comment: A074065 (sqrt(3)), A074840 (sqrt(2)).
Apart from initial terms, same as A005206.
First differences: A096270 (a version of A005614).
Partial sums: A183136.

Programs

  • Magma
    [Floor(2*n/(1+Sqrt(5))): n in [0..80]]; // Vincenzo Librandi, Mar 29 2015
    
  • Mathematica
    Floor[Range[0,80]/GoldenRatio] (* Harvey P. Dale, May 09 2013 *)
  • PARI
    { default(realprecision, 10); p=(sqrt(5) - 1)/2; for (n=0, 1000, write("b060143.txt", n, " ", floor(n*p)); ) } \\ Harry J. Smith, Jul 02 2009
    
  • Python
    from math import isqrt
    def A060143(n): return (n+isqrt(5*n**2)>>1)-n # Chai Wah Wu, Aug 10 2022

Formula

a(n) = floor(phi(n)), where phi=(sqrt(5)-1)/2. [corrected by Casey Mongoven, Jul 18 2008]
a(F_n + 1) = F_{n-1} if F_n is the n-th Fibonacci number. [aligned with sequence offset by Peter Munn, Jan 10 2018]
a(1) = 0. b(n) = n - a(n). If (a(n) + 1) / b(n) < (1 + sqrt(5))/2, then a(n+1) = a(n) + 1, else a(n+1) = a(n). - Robert A. Stump (bee_ess107(AT)msn.com), Sep 22 2002 [corrected by Peter Munn, Jan 07 2018]
A006336(n) = A006336(n-1) + A006336(a(n)) for n>1. - Reinhard Zumkeller, Oct 24 2007
a(n) = floor(n*phi) - n, where phi = (1+sqrt(5))/2. - William A. Tedeschi, Mar 06 2008
Celaya and Ruskey give an interesting formula for a(n). - N. J. A. Sloane, Jun 13 2014

Extensions

I merged three identical sequences to create this entry. Some of the formulas may need their initial terms adjusting now. - N. J. A. Sloane, Mar 05 2003
More terms from William A. Tedeschi, Mar 06 2008

A005243 A self-generating sequence: start with 1 and 2, take all sums of any number of successive previous elements and adjoin them to the sequence. Repeat!

Original entry on oeis.org

1, 2, 3, 5, 6, 8, 10, 11, 14, 16, 17, 18, 19, 21, 22, 24, 25, 29, 30, 32, 33, 34, 35, 37, 40, 41, 43, 45, 46, 47, 49, 51, 54, 57, 58, 59, 60, 62, 65, 67, 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, 80, 81, 82, 84, 86, 87, 88, 90, 91, 92, 93, 94, 95, 96, 97, 99, 100
Offset: 1

Views

Author

D. R. Hofstadter, Jul 15 1977

Keywords

Comments

Most of the natural numbers are members. Conjecture: there are infinitely many nonmembers. Is there an estimate for a(k)/k ?
A118164(n) = number of representations of a(n) as sum of consecutive earlier terms. - Reinhard Zumkeller, Apr 13 2006

Examples

			After 1,2,3,5,6 you can adjoin 8 = 3+5, 10 = 2+3+5, etc.
12 is not a term since it is not the sum of any set of consecutive previous terms.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, E31.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Complement of A048973.

Programs

  • Haskell
    import Data.Set (singleton, deleteFindMin, fromList, union, IntSet)
    a005243 n = a005243_list !! (n-1)
    a005243_list = 1 : h [1] (singleton 2) where
       h xs s = m : h (m:xs) (union s' $ fromList $ map (+ m) $ scanl1 (+) xs)
         where (m, s') = deleteFindMin s
    -- Reinhard Zumkeller, Dec 17 2015, Jun 22 2011
  • Mathematica
    nmax = 200; For[ s = {1, 2}; n = 3, n <= nmax, n++, ls = Length[s]; tt = Total /@ Flatten[Table[s[[i ;; j]], {i, 1, ls-1}, {j, i+1, ls}], 1]; If[MemberQ[tt, n], AppendTo[s, n]]]; A005243 = s (* Jean-François Alcover, Oct 21 2016 *)

Extensions

More terms from Jud McCranie

A005378 The female of a pair of recurrences.

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 6, 7, 8, 8, 9, 9, 10, 11, 11, 12, 13, 13, 14, 14, 15, 16, 16, 17, 17, 18, 19, 19, 20, 21, 21, 22, 22, 23, 24, 24, 25, 25, 26, 27, 27, 28, 29, 29, 30, 30, 31, 32, 32, 33, 34, 34, 35, 35, 36, 37, 37, 38, 38, 39, 40, 40, 41, 42, 42, 43, 43, 44, 45, 45
Offset: 0

Views

Author

Keywords

Comments

F(n) is not equal to M(n) if and only if n+1 is a Fibonacci number (A000045); a(n) = A005379(n) + A192687(n). - Reinhard Zumkeller, Jul 12 2011
Differs from A098294 at indices n = 0, 17, 20, 22, 25, 27, 29, 30, ... - M. F. Hasler, Jun 29 2014

References

  • Hofstadter, "Goedel, Escher, Bach", p. 137.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A005379.

Programs

  • Haskell
    a005378 n = a005378_list !! n
    a005378_list = 1 : zipWith (-) [1..] (map a005379 a005378_list)
    a005379 n = a005379_list !! n
    a005379_list = 0 : zipWith (-) [1..] (map a005378 a005379_list)
    -- Without memoization the original recursion would be feasible only for small n.
    -- Reinhard Zumkeller, Jul 12 2011
  • Mathematica
    f[0] = 1; m[0] = 0; f[n_] := f[n] = n - m[f[n-1]]; m[n_] := m[n] = n - f[m[n-1]]; Table[f[n], {n, 0, 73}] (* Jean-François Alcover, Jul 27 2011 *)

Formula

F(0) = 1; M(0) = 0; F(n) = n-M(F(n-1)); M(n) = n-F(M(n-1)).

Extensions

More terms from James Sellers, Jul 12 2000
Comment corrected by Jaroslav Krizek, Dec 25 2011

A005379 The male of a pair of recurrences.

Original entry on oeis.org

0, 0, 1, 2, 2, 3, 4, 4, 5, 6, 6, 7, 7, 8, 9, 9, 10, 11, 11, 12, 12, 13, 14, 14, 15, 16, 16, 17, 17, 18, 19, 19, 20, 20, 21, 22, 22, 23, 24, 24, 25, 25, 26, 27, 27, 28, 29, 29, 30, 30, 31, 32, 32, 33, 33, 34, 35, 35, 36, 37, 37, 38, 38, 39, 40, 40, 41, 42, 42, 43, 43, 44, 45, 45
Offset: 0

Views

Author

Keywords

Comments

M(n) is not equal to F(n) if and only if n+1 is a Fibonacci number (A000045); a(n)=A005379(n)-A192687(n). [Reinhard Zumkeller, Jul 12 2011]

References

  • D. R. Hofstadter, "Goedel, Escher, Bach", p. 137.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A005378.

Programs

  • Haskell
    Cf. A005378.
    
  • Maple
    F:= proc(n) option remember; n - M(procname(n-1)) end proc:
    M:= proc(n) option remember; n - F(procname(n-1)) end proc:
    F(0):= 1: M(0):= 0:
    seq(M(n),n=0..100); # Robert Israel, Jun 15 2015
  • Mathematica
    f[0] = 1; m[0] = 0; f[n_] := f[n] = n - m[f[n-1]]; m[n_] := m[n] = n - f[m[n-1]]; Table[m[n], {n, 0, 73}]
    (* Jean-François Alcover, Jul 27 2011 *)
  • PARI
    f(n) = if(n<1, 1, n - m(f(n - 1)));
    m(n) = if(n<1, 0, n - f(m(n - 1)));
    for(n=0, 73, print1(m(n),", ")) \\ Indranil Ghosh, Apr 23 2017

Formula

F(0) = 1; M(0) = 0; F(n) = n - M(F(n-1)); M(n) = n - F(M(n-1)).
The g.f. -z^2*(-1-z^3-z^6-z-z^4-z^7+z^8)/(z+1)/(z^2+1)/(z^4+1)/(z-1)^2, conjectured by Simon Plouffe in his 1992 dissertation is incorrect: the coefficient of z^33 in the g.f. is 21, but a(33) = 20. (Discovered by Sahand Saba, Jan 14 2013.) - Frank Ruskey, Jan 16 2013

Extensions

More terms from James Sellers, Jul 12 2000
Comment corrected by Jaroslav Krizek, Dec 25 2011

A006338 An "eta-sequence": floor((n+1)*sqrt(2) + 1/2) - floor(n*sqrt(2) + 1/2).

Original entry on oeis.org

2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2
Offset: 1

Views

Author

D. R. Hofstadter, Jul 15 1977

Keywords

Comments

Equals its own "second derivative" (cf. A006337).
Presumably this is the same as the following sequence from Hofstadter's book: the number of triangular numbers between each successive pair of squares. More precisely, a(n) is the number of triangular numbers T such that n^2 <= T < (n+1)^2. E.g., a(3) = 2 because 3^2 <= T < 4^2 permits T(4) = 10 and T(5) = 15 and no other triangular number. - Hugo van der Sanden, May 03 2005.
a(n) = A214848(n) = A022846(n+1) - A022846(n). - Reinhard Zumkeller, Mar 03 2014

References

  • Douglas Hofstadter, "Fluid Concepts and Creative Analogies", Chapter 1: "To seek whence cometh a sequence".
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a006338 n = a006338_list !! (n-1)
    a006338_list = tail a214848_list
    -- Reinhard Zumkeller, Mar 03 2014
    
  • Magma
    [Floor((n+1)*Sqrt(2)+1/2) - Floor(n*Sqrt(2)+1/2): n in [1..30]]; // G. C. Greubel, Nov 18 2017
  • Mathematica
    a[n_] := Floor[(n+1)*Sqrt[2]+1/2] - Floor[n*Sqrt[2]+1/2]; Table[a[n], {n, 1, 105}] (* Jean-François Alcover, Nov 24 2015 *)
    Differences[Table[Floor[n Sqrt[2]+1/2],{n,120}]] (* Harvey P. Dale, Dec 10 2021 *)
  • PARI
    for(n=1,30, print1(floor((n+1)*sqrt(2) + 1/2) - floor(n*sqrt(2) + 1/2), ", ")) \\ G. C. Greubel, Nov 18 2017
    

Formula

a(n) = floor((n+1)*sqrt(2) + 1/2) - floor(n*sqrt(2) + 1/2). - G. C. Greubel, Nov 18 2017

Extensions

More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Mar 28 2003

A007604 a(n) = a(n-1) + a(n-1-(number of odd terms so far)).

Original entry on oeis.org

1, 2, 3, 4, 6, 9, 12, 16, 22, 31, 40, 52, 68, 90, 121, 152, 192, 244, 312, 402, 523, 644, 796, 988, 1232, 1544, 1946, 2469, 2992, 3636, 4432, 5420, 6652, 8196, 10142, 12611, 15080, 18072, 21708, 26140, 31560, 38212, 46408, 56550, 69161, 81772, 96852
Offset: 1

Views

Author

Keywords

Comments

A003056(n) gives the number of odd terms in the first n terms of this sequence. Modulo 2, this sequence becomes A023531. - T. D. Noe, Jul 24 2007
The present definition was the original definition of this sequence. It was later changed to "Sequence formed from rows of triangle A046936", but this seems less satisfactory. - N. J. A. Sloane, Oct 26 2014

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a007604 n = a007604_list !! (n-1)
    a007604_list = concat $ map tail $ tail a046936_tabl
    -- Reinhard Zumkeller, Jan 01 2014
  • Maple
    A[1]:= 1: A[2]:= 2: o:= 1:
    for n from 3 to 100 do
      A[n]:= A[n-1] + A[n-1-o];
      if A[n]::odd then o:= o+1 fi
    od:
    seq(A[i],i=1..100); # Robert Israel, Mar 14 2023
  • Mathematica
    a[n_Integer] := a[n] = Block[{c, k}, c = 0; k = 1; While[k < n, If[ OddQ[ a[k] ], c++ ]; k++ ]; Return[a[n - 1] + a[n - 1 - c] ] ]; a[1] = 1; a[2] = 2; Table[ a[n], {n, 0, 60} ]

Extensions

Entry revised by N. J. A. Sloane, Oct 26 2014

A006340 An "eta-sequence": [ (n+1)*tau + 1/2 ] - [ n*tau + 1/2 ], tau = (1 + sqrt(5))/2.

Original entry on oeis.org

2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1
Offset: 0

Views

Author

D. R. Hofstadter, Jul 15 1977

Keywords

Comments

Equals its own "derivative", which is formed by counting the strings of 1's that lie between 2's.
Conjecture: A006340 = continued fraction expansion of (2.729967741... = sup{f(n,1)}), where f(1,x) = x + 1 and thereafter f(n,x) = x + 1 if n is in the lower Wythoff sequence (A000201), else f(n,x) = 1/x. The first 12 values of f(n,1) are given in Example at A245216. - Clark Kimberling, Jul 14 2014
From Michel Dekking, Mar 05 2018: (Start)
The description of this sequence is not correct, since the derivative of a equals
a' = 1,2,2,1,2,2,1,2,1,2,2,1,2,1,2,2,...
The claim by Hofstadter in formula (4) in the 1977 letter to Sloane is also not correct, since the second derivative of a is equal to
a'' = 2,2,1,2,1,2,2,1,2,1,2,2,1,...
so a is not equal to its own second derivative.
Nevertheless, this sequence has a self-similarity property: if one replaces every chunk 212 with 1 and every chunk 21212 with 2, then one obtains back the original sequence. In other words, (a(n)) is the unique fixed point of the morphism sigma given by sigma: 1->212, 2->21212.
This can be proved following the ideas of Chapter 2 in Lothaire's book and Section 4 of my paper "Substitution invariant Sturmian words and binary trees".
To comply with these references change the alphabet to {0,1}. This changes sigma into the morphism 0->101, 1->10101.
The fractional part {tau} of tau is larger than 1/2; as it is convenient to have it smaller than 1/2 we change to beta = 1-tau = (3-sqrt(5))/2.
This changes the morphism 0->101, 1->10101 to its mirror image psi given by 0->01010, 1->010.
Let psi_1 and psi_2 be the elementary Sturmian morphisms given by
psi_1(0)=01 , psi_1(1)=1, psi_2(0)=10, psi_2(1)=0.
Then psi = psi_2^2 psi_1.
This already shows that psi generates a Sturmian sequence with certain parameters alpha and rho: s(alpha,rho) = ([(n+1)*alpha+rho]-[n*alpha+rho]).
Since psi is the composition psi_2^2psi_1, the parameters of s(alpha,rho) are given by the composition T:=T_2^2T_1 of the fractional linear maps
T_1(x,y) = ((1-x)/(2-x),(1-y)/(2-x)),
T_2(x,y) = ((1-x)/(2-x), (2-x-y)/(2-x)).
Since one can verify that T(beta,1/2)=(beta,1/2), it follows that
alpha = beta, and rho = 1/2.
(End)

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Differs from A014675 in many places. Cf. A245216.

Programs

  • Mathematica
    Differences[ Table[ Round[ GoldenRatio*n], {n, 0, 93}]] (* Jean-François Alcover, Aug 13 2012 *)
  • PARI
    rt(n) = my(tau=(1 + sqrt(5))/2); round(tau*n)
    a(n) = rt(n+1)-rt(n) \\ Felix Fröhlich, Aug 26 2018

Extensions

Extended by N. J. A. Sloane, Nov 07 2001

A249036 a(1)=1, a(2)=2; thereafter a(n) = a(n-1-(number of even terms so far)) + a(n-1-(number of odd terms so far)).

Original entry on oeis.org

1, 2, 2, 3, 4, 4, 5, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 13, 14, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47
Offset: 1

Views

Author

N. J. A. Sloane, Oct 26 2014

Keywords

Comments

Suggested by A006336 and A007604.

Crossrefs

A249037 and A249038 give numbers of even and odd terms so far.

Programs

  • Maple
    M:=100;
    v[1]:=1; v[2]:=2; w[1]:=0; w[2]:=1; x[1]:=1; x[2]:=1;
    for n from 3 to M do
       v[n]:=v[n-1-w[n-1]]+v[n-1-x[n-1]];
    if v[n] mod 2 = 0 then w[n]:=w[n-1]+1; x[n]:=x[n-1];
                      else w[n]:=w[n-1]; x[n]:=x[n-1]+1; fi;
    od:
    [seq(v[n], n=1..M)]; # A249036
    [seq(w[n], n=1..M)]; # A249037
    [seq(x[n], n=1..M)]; # A249038
  • Mathematica
    Nest[Append[#, #[[Length@Select[#, OddQ]]] + #[[Length@Select[#, EvenQ]]]] &, {1, 2}, 75] (* Ivan Neretin, May 02 2016 *)
Previous Showing 11-20 of 25 results. Next