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-10 of 11 results. Next

A165157 Zero followed by partial sums of A133622.

Original entry on oeis.org

0, 1, 3, 4, 7, 8, 12, 13, 18, 19, 25, 26, 33, 34, 42, 43, 52, 53, 63, 64, 75, 76, 88, 89, 102, 103, 117, 118, 133, 134, 150, 151, 168, 169, 187, 188, 207, 208, 228, 229, 250, 251, 273, 274, 297, 298, 322, 323, 348, 349, 375, 376, 403, 404, 432, 433, 462, 463, 493, 494, 525
Offset: 0

Views

Author

Jaroslav Krizek, Sep 05 2009

Keywords

Comments

A133622 is a toothed sequence.
Interleaving of A055998 and A034856.

Examples

			From _Stefano Spezia_, Jul 10 2020: (Start)
Illustration of the initial terms for n > 0:
o    o      o      o         o        o
     o o    o o    o o       o o      o o
            o      o         o        o
                   o o o     o o o    o o o
                             o        o
                                      o o o o
(1)  (3)   (4)    (7)       (8)      (12)
(End)
		

Crossrefs

Equals -1+A101881.
a(n) = A117142(n+2)-2 = A055802(n+6)-3 = A114220(n+5)-3 = A134519(n+3)-3.

Programs

  • Haskell
    a165157 n = a165157_list !! n
    a165157_list = scanl (+) 0 a133622_list
    -- Reinhard Zumkeller, Feb 20 2015
  • Magma
    m:=60; T:=[ 1+(1+(-1)^n)*n/4: n in [1..m] ]; [0] cat [ n eq 1 select T[1] else Self(n-1)+T[n]: n in [1..m] ]; // Klaus Brockhaus, Sep 06 2009
    
  • Magma
    [ n le 2 select n-1 else n le 4 select n else 2*Self(n-2)-Self(n-4)+1: n in [1..61] ]; // Klaus Brockhaus, Sep 06 2009
    

Formula

a(0) = 0, a(2*n) = a(2*n-1) + n + 1, a(2*n+1) = a(2*n) + 1.
a(n) = (n^2+10*n)/8 if n is even, a(n) = (n^2+8*n-1)/8 if n is odd.
a(2*k) = A055998(k) = k*(k+5)/2; a(2*k+1) = A034856(k+1) = k*(k+5)/2+1.
a(n) = 2*a(n-2)-a(n-4)+1 for n > 3; a(0)=0, a(1)=1, a(2)=3, a(3)=4. - Klaus Brockhaus, Sep 06 2009
a(n) = (2*n*(n+9)-1+(2*n+1)*(-1)^n)/16. - Klaus Brockhaus, Sep 06 2009
a(n) = n+binomial(1+floor(n/2),2). - Mircea Merca, Feb 18 2012
G.f.: x*(1+2*x-x^2-x^3)/((1-x)^3*(1+x)^2). - Klaus Brockhaus, Sep 06 2009
From Stefano Spezia, Jul 10 2020: (Start)
E.g.f.: (x*(9 + x)*cosh(x) + (-1 + 11*x + x^2)*sinh(x))/8.
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n > 4. (End)

Extensions

Edited and extended by Klaus Brockhaus, Sep 06 2009

A289809 p-INVERT of (1,2,1,3,1,4,1,5,...) (A133622), where p(S) = 1 - S - S^2.

Original entry on oeis.org

1, 4, 12, 38, 114, 354, 1076, 3311, 10120, 31043, 95044, 291284, 892242, 2733804, 8375092, 25659298, 78610859, 240840496, 737856017, 2260561368, 6925635380, 21217961710, 65005083598, 199154984626, 610147638720, 1869298875531, 5726938575936, 17545523113507
Offset: 0

Views

Author

Clark Kimberling, Aug 12 2017

Keywords

Comments

Suppose s = (c(0), c(1), c(2), ...) is a sequence and p(S) is a polynomial. Let S(x) = c(0)*x + c(1)*x + ^2c(2)*x^3 + ... and T(x) = (-p(0) + 1/p(S(x)))/x. The p-INVERT of s is the sequence t(s) of coefficients in the Maclaurin series for T(x). Taking p(S) = 1 - S gives the INVERT transform of s, so that p-INVERT is a generalization of the INVERT transform (e.g., A033453).
See A289780 for a guide to related sequences.

Crossrefs

Programs

  • Mathematica
    z = 60; s = x (1 + 2 x - x^2 - x^3)/(1 - x^2)^2; p = 1 - s - s^2;
    Drop[CoefficientList[Series[s, {x, 0, z}], x], 1] (* A133622 *)
    u = Drop[CoefficientList[Series[1/p, {x, 0, z}], x], 1] (* A289809 *)

Formula

G.f.: (1 + 3 x + x^2 - 3 x^3 - 3 x^4 + x^5 + x^6)/(1 - x - 7 x^2 - x^3 +
9 x^4 + 3 x^5 - 5 x^6 - x^7 + x^8).
a(n) = a(n-1) + 7*a(n-2) + a(n-3) - 9*a(n-4) - 3*a(n-5) + 5*a(n-6) + a(n-7) - a(n-8)..

A203193 (n-1)-st elementary symmetric function of the first n terms of (1,2,1,3,1,4,1,5,...)=A133622.

Original entry on oeis.org

1, 3, 5, 17, 23, 98, 122, 634, 754, 4644, 5364, 38268, 43308, 351504, 391824, 3566736, 3929616, 39659040, 43287840, 479795040, 519711840, 6276458880, 6755460480, 88299987840, 94527008640, 1329605141760, 1416783432960
Offset: 1

Views

Author

Clark Kimberling, Dec 30 2011

Keywords

Crossrefs

Cf. A133622.

Programs

  • Mathematica
    f[k_] := If[Mod[k, 2] == 1, 1, 1 + k/2];
    t[n_] := Table[f[k], {k, 1, n}]
    a[n_] := SymmetricPolynomial[n - 1, t[n]]
    Table[a[n], {n, 1, 33}] (* A203193 *)

A289780 p-INVERT of the positive integers (A000027), where p(S) = 1 - S - S^2.

Original entry on oeis.org

1, 4, 14, 47, 156, 517, 1714, 5684, 18851, 62520, 207349, 687676, 2280686, 7563923, 25085844, 83197513, 275925586, 915110636, 3034975799, 10065534960, 33382471801, 110713382644, 367182309614, 1217764693607, 4038731742156, 13394504020957, 44423039068114
Offset: 0

Views

Author

Clark Kimberling, Aug 10 2017

Keywords

Comments

Suppose s = (c(0), c(1), c(2), ...) is a sequence and p(S) is a polynomial. Let S(x) = c(0)*x + c(1)*x^2 + c(2)*x^3 + ... and T(x) = (-p(0) + 1/p(S(x)))/x. The p-INVERT of s is the sequence t(s) of coefficients in the Maclaurin series for T(x).
Taking p(S) = 1 - S gives the INVERT transform of s, so that p-INVERT is a generalization of the INVERT transform (e.g., A033453).
Guide to p-INVERT sequences using p(S) = 1 - S - S^2:
t(A000012) = t(1,1,1,1,1,1,1,...) = A001906
t(A000290) = t(1,4,9,16,25,36,...) = A289779
t(A000027) = t(1,2,3,4,5,6,7,8,...) = A289780
t(A000045) = t(1,2,3,5,8,13,21,...) = A289781
t(A000032) = t(2,1,3,4,7,11,14,...) = A289782
t(A000244) = t(1,3,9,27,81,243,...) = A289783
t(A000302) = t(1,4,16,64,256,...) = A289784
t(A000351) = t(1,5,25,125,625,...) = A289785
t(A005408) = t(1,3,5,7,9,11,13,...) = A289786
t(A005843) = t(2,4,6,8,10,12,14,...) = A289787
t(A016777) = t(1,4,7,10,13,16,...) = A289789
t(A016789) = t(2,5,8,11,14,17,...) = A289790
t(A008585) = t(3,6,9,12,15,18,...) = A289795
t(A000217) = t(1,3,6,10,15,21,...) = A289797
t(A000225) = t(1,3,7,15,31,63,...) = A289798
t(A000578) = t(1,8,27,64,625,...) = A289799
t(A000984) = t(1,2,6,20,70,252,...) = A289800
t(A000292) = t(1,4,10,20,35,56,...) = A289801
t(A002620) = t(1,2,4,6,9,12,16,...) = A289802
t(A001906) = t(1,3,8,21,55,144,...) = A289803
t(A001519) = t(1,1,2,5,13,34,...) = A289804
t(A103889) = t(2,1,4,3,6,5,8,7,,...) = A289805
t(A008619) = t(1,1,2,2,3,3,4,4,...) = A289806
t(A080513) = t(1,2,2,3,3,4,4,5,...) = A289807
t(A133622) = t(1,2,1,3,1,4,1,5,...) = A289809
t(A000108) = t(1,1,2,5,14,42,...) = A081696
t(A081696) = t(1,1,3,9,29,97,...) = A289810
t(A027656) = t(1,0,2,0,3,0,4,0,5...) = A289843
t(A175676) = t(1,0,0,2,0,0,3,0,...) = A289844
t(A079977) = t(1,0,1,0,2,0,3,...) = A289845
t(A059841) = t(1,0,1,0,1,0,1,...) = A289846
t(A000040) = t(2,3,5,7,11,13,...) = A289847
t(A008578) = t(1,2,3,5,7,11,13,...) = A289828
t(A000142) = t(1!, 2!, 3!, 4!, ...) = A289924
t(A000201) = t(1,3,4,6,8,9,11,...) = A289925
t(A001950) = t(2,5,7,10,13,15,...) = A289926
t(A014217) = t(1,2,4,6,11,17,29,...) = A289927
t(A000045*) = t(0,1,1,2,3,5,...) = A289975 (* indicates prepended 0's)
t(A000045*) = t(0,0,1,1,2,3,5,...) = A289976
t(A000045*) = t(0,0,0,1,1,2,3,5,...) = A289977
t(A290990*) = t(0,1,2,3,4,5,...) = A290990
t(A290990*) = t(0,0,1,2,3,4,5,...) = A290991
t(A290990*) = t(0,0,01,2,3,4,5,...) = A290992

Examples

			Example 1:  s = (1,2,3,4,5,6,...) = A000027 and p(S) = 1 - S.
S(x) = x + 2x^2 + 3x^3 + 4x^4 + ...
p(S(x)) = 1 - (x + 2x^2 + 3x^3 + 4x^4 + ... )
- p(0) + 1/p(S(x)) = -1 + 1 + x + 3x^2 + 8x^3 + 21x^4 + ...
T(x) = 1 + 3x + 8x^2 + 21x^3 + ...
t(s) = (1,3,8,21,...) = A001906.
***
Example 2:  s = (1,2,3,4,5,6,...) = A000027 and p(S) = 1 - S - S^2.
S(x) =  x + 2x^2 + 3x^3 + 4x^4 + ...
p(S(x)) = 1 - ( x + 2x^2 + 3x^3 + 4x^4 + ...) - ( x + 2x^2 + 3x^3 + 4x^4 + ...)^2
- p(0) + 1/p(S(x)) = -1 + 1 + x + 4x^2 + 14x^3 + 47x^4 + ...
T(x) = 1 + 4x + 14x^2 + 47x^3 + ...
t(s) = (1,4,14,47,...) = A289780.
		

Crossrefs

Cf. A000027.

Programs

  • GAP
    P:=[1,4,14,47];; for n in [5..10^2] do P[n]:=5*P[n-1]-7*P[n-2]+5*P[n-3]-P[n-4]; od; P; # Muniru A Asiru, Sep 03 2017
  • Mathematica
    z = 60; s = x/(1 - x)^2; p = 1 - s - s^2;
    Drop[CoefficientList[Series[s, {x, 0, z}], x], 1] (* A000027 *)
    Drop[CoefficientList[Series[1/p, {x, 0, z}], x], 1] (* A289780 *)
  • PARI
    x='x+O('x^99); Vec((1-x+x^2)/(1-5*x+7*x^2-5*x^3+x^4)) \\ Altug Alkan, Aug 13 2017
    

Formula

G.f.: (1 - x + x^2)/(1 - 5 x + 7 x^2 - 5 x^3 + x^4).
a(n) = 5*a(n-1) - 7*a(n-2) + 5*a(n-3) - a(n-4).

A042964 Numbers that are congruent to 2 or 3 mod 4.

Original entry on oeis.org

2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31, 34, 35, 38, 39, 42, 43, 46, 47, 50, 51, 54, 55, 58, 59, 62, 63, 66, 67, 70, 71, 74, 75, 78, 79, 82, 83, 86, 87, 90, 91, 94, 95, 98, 99, 102, 103, 106, 107, 110, 111, 114, 115, 118, 119, 122, 123, 126, 127
Offset: 1

Views

Author

Keywords

Comments

Also numbers m such that binomial(m+2, m) mod 2 = 0. - Hieronymus Fischer, Oct 20 2007
Also numbers m such that floor(1+(m/2)) mod 2 = 0. - Hieronymus Fischer, Oct 20 2007
Partial sums of the sequence 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, ... which has period 2. - Hieronymus Fischer, Oct 20 2007
In groups of four add and divide by two the odd and even numbers. - George E. Antoniou, Dec 12 2001
From Jeremy Gardiner, Jan 22 2006: (Start)
Comments on the "mystery calculator". There are 6 cards.
Card 0: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, ... (A005408 sequence).
Card 1: 2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31, 34, 35, 38, 39, ... (this sequence).
Card 2: 4, 5, 6, 7, 12, 13, 14, 15, 20, 21, 22, 23, 28, 29, 30, 31, 36, 37, 38, 39, ... (A047566).
Card 3: 8, 9, 10, 11, 12, 13, 14, 15, 24, 25, 26, 27, 28, 29, 30, 31, 40, 41, 42, ... (A115419).
Card 4: 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 48, 49, 50, ... (A115420).
Card 5: 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, ... (A115421).
The trick: You secretly select a number between 1 and 63 from one of the cards. You indicate to me the cards on which that number appears; I tell you the number you selected!
The solution: I add together the first term from each of the indicated cards. The total equals the selected number. The numbers in each sequence all have a "1" in the same position in their binary expansion. Example: You indicate cards 1, 3 and 5. Your selected number is 2 + 8 + 32 = 42.
Numbers having a 1 in position 1 of their binary expansion. One of the mystery calculator sequences: A005408, A042964, A047566, A115419, A115420, A115421. (End)
Complement of A042948. - Reinhard Zumkeller, Oct 03 2008
Also the 2nd Witt transform of A040000 [Moree]. - R. J. Mathar, Nov 08 2008
In general, sequences of numbers congruent to {a,a+i} mod k will have a closed form of (k-2*i)*(2*n-1+(-1)^n)/4+i*n+a, from offset 0. - Gary Detlefs, Oct 29 2013
Union of A004767 and A016825; Fixed points of A098180. - Wesley Ivan Hurt, Jan 14 2014, Oct 13 2015

Crossrefs

Programs

  • Magma
    [2*n+((-1)^(n-1)-1)/2 : n in [1..100]]; // Wesley Ivan Hurt, Oct 13 2015
    
  • Magma
    [n: n in [1..150] | n mod 4 in [2, 3]]; // Vincenzo Librandi, Oct 13 2015
    
  • Maple
    A042964:=n->2*n+((-1)^(n-1)-1)/2; seq(A042964(n), n=1..100); # Wesley Ivan Hurt, Jan 07 2014
  • Mathematica
    Flatten[Table[4n + {2, 3}, {n, 0, 31}]] (* Alonso del Arte, Feb 07 2013 *)
    Select[Range[200],MemberQ[{2,3},Mod[#,4]]&] (* or *) LinearRecurrence[ {1,1,-1},{2,3,6},90] (* Harvey P. Dale, Nov 28 2018 *)
  • PARI
    a(n)=2*n+2-n%2
    
  • PARI
    Vec((2+x+x^2)/((1-x)*(1-x^2)) + O(x^100)) \\ Altug Alkan, Oct 13 2015

Formula

a(n) = A047406(n)/2.
From Michael Somos, Jan 12 2000: (Start)
G.f.: x*(2+x+x^2)/((1-x)*(1-x^2)).
a(n) = a(n-1) + 2 + (-1)^n. (End)
a(n) = 2n if n is odd, otherwise n = 2n - 1. - Amarnath Murthy, Oct 16 2003
a(n) = (3 + (-1)^(n-1))/2 + 2*(n-1) = 2n + 2 - (n mod 2). - Hieronymus Fischer, Oct 20 2007
A133872(a(n)) = 0. - Reinhard Zumkeller, Oct 03 2008
a(n) = 4*n - a(n-1) - 3 (with a(1) = 2). - Vincenzo Librandi, Nov 17 2010
a(n) = 2*n + ((-1)^(n-1) - 1)/2. - Gary Detlefs, Oct 29 2013
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/8 - log(2)/4. - Amiram Eldar, Dec 05 2021
E.g.f.: 1 + ((4*x - 1)*exp(x) - exp(-x))/2. - David Lovler, Aug 08 2022

Extensions

Edited by N. J. A. Sloane, Jun 30 2008 at the suggestion of R. J. Mathar
Corrected by Jaroslav Krizek, Dec 18 2009

A158416 Expansion of g.f. (1+x-x^3)/(1-x^2)^2.

Original entry on oeis.org

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

Views

Author

Paul Barry, Mar 18 2009

Keywords

Comments

Binomial transform is A111297. Binomial transform of [1,1,1,2,1,3,1,...] is A109975.
Essentially the same as A152271 and A133622. - R. J. Mathar, Mar 20 2009
Also defined by: a(0)=1; thereafter, a(n) = number of copies of a(n-1) in the list [a(0), a(1), ..., a(n-1)]. - N. J. A. Sloane, Feb 12 2016

Crossrefs

Related to A268696.

Programs

  • Mathematica
    CoefficientList[Series[(1+x-x^3)/(1-x^2)^2,{x,0,100}],x] (* or *) LinearRecurrence[{0,2,0,-1},{1,1,2,1},100] (* Harvey P. Dale, Aug 17 2016 *)
  • PARI
    a(n)=1+!(n%2)*n/2 \\ Jaume Oliver Lafont, Mar 21 2009

Formula

a(n) = Sum_{k=0..floor(n/2)} binomial(k+1,n-k).
G.f.: Q(0)/x - 1/x, where Q(k)= 1 + (k+1)*x/(1 - x/(x + (k+1)/Q(k+1))); (continued fraction). - Sergei N. Gladkovskii, Apr 23 2013
E.g.f.: cosh(x) + (2 + x)*sinh(x)/2. - Stefano Spezia, Sep 06 2023

A358921 a(1) = 1; a(n) is the smallest positive number not among the terms a(n-c .. n-1) where c = the number of times a(n-1) has occurred.

Original entry on oeis.org

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

Views

Author

Samuel Harkness, Dec 06 2022

Keywords

Comments

A new number other than 1 is always followed by a 1, so a(n) < n/2 for n > 4.

Examples

			For a(6), a(5) = 1 has occurred 3 times, so the smallest positive integer not in {a(5), a(4), a(3)} = {1, 3, 1} is 2, thus a(6) = 2.
Next, for a(7), a(6) = 2 has occurred 2 times, so the smallest positive integer not in {a(6), a(5)} = {2, 1} is 3, thus a(7) = 3.
Then, for a(8), a(7) = 3 has occurred 2 times, so the smallest positive integer not in {a(7), a(6)} = {3, 2} is 1, thus a(8) = 1.
Now, for a(9), a(8) = 1 has occurred 4 times, so the smallest positive integer not in {a(8), a(7), a(6), a(5)} = {1, 3, 2, 1} is 4, thus a(9) = 4.
The first terms, alongside the number of times they have occurred o(n), are:
  n  a(n)  o(n)
  -  ----  ----
  1     1     1
  2     2     1
  3     1     2
  4     3     1
  5     1     3
  6     2     2
  7     3     2
  8     1     4
  9     4     1
  10    1     5
		

Crossrefs

Programs

  • Mathematica
    V = {1} While[Length[V] < 84, b = 1; While[MemberQ[Take[V, -Count[V, Last[V]]], b], b++ ]; AppendTo[V, b]]; Print[V]
  • PARI
    { a = o = vector(84); v = 1; for (n=1, #a, print1 (a[n]=v", "); v=setminus([1..n+1], Set(a[n-o[a[n]]+++1..n]))[1]) } \\ Rémy Sigrist, Jan 09 2023

A133884 a(n) = binomial(n+4,n) mod 4.

Original entry on oeis.org

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

Views

Author

Hieronymus Fischer, Oct 10 2007

Keywords

Comments

Periodic with length 4^2=16.

Examples

			For n=2, binomial(6,2) = 6*5/2 = 15, which is 3 (mod 4) so a(2) = 3. - _Michael B. Porter_, Jul 19 2016
		

Crossrefs

Programs

  • Magma
    [Binomial(n+4,n) mod 4: n in [0..100]]; // Vincenzo Librandi, Jul 15 2016
  • Mathematica
    Table[Mod[Binomial[n + 4, 4], 4], {n, 0, 100}] (* Vincenzo Librandi, Jul 15 2016 *)

Formula

a(n) = binomial(n+4,4) mod 4.
G.f.: (1 + x + 3*x^2 + 3*x^3 + 2*x^4 + 2*x^5 + 2*x^6 + 2*x^7 + 3*x^8 + 3*x^9 + x^10 + x^11)/(1 - x^16) = (1 + 2*x^2 + 2*x^6 + x^8)/((1 - x)*(1 + x^4)*(1 + x^8)).
a(n) = A000505(n+5) mod 4. - John M. Campbell, Jul 14 2016
a(n) = A000506(n+6) mod 4. - John M. Campbell, Jul 15 2016

Extensions

G.f. corrected by Bruno Berselli, Jul 19 2016

A330332 a(n) = (number of times a(n-1) has already appeared) + (number of times a(n-2) has already appeared) + (number of times a(n-3) has already appeared), starting with a(n) = n for n<3.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Dec 14 2019

Keywords

Comments

Generalizes A316774, which looks at the frequencies of the two previous terms. Here we look at three previous terms.
If we look at just one previous term, we get 0, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, ..., which is A133622 prefixed by 0, 1, or A152271 with its initial 1 changed to 0.

Crossrefs

Programs

  • Maple
    b:= proc() 0 end:
    a:= proc(n) option remember; local t;
          t:= `if`(n<3, n, b(a(n-1))+b(a(n-2))+b(a(n-3)));
          b(t):= b(t)+1; t
        end:
    [seq(a(n), n=0..200)]; # Following Alois P. Heinz's program for A316774
  • Mathematica
    b[_] = 0;
    a[n_] := a[n] = Module[{t}, t = If[n<3, n, b[a[n-1]] + b[a[n-2]] + b[a[n-3]]]; b[t]++; t];
    a /@ Range[0, 200] (* Jean-François Alcover, Nov 09 2020, after Maple *)

A282738 First differences of A282737.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Mar 04 2017

Keywords

Crossrefs

Cf. A282737.
A152271 and A133622 are very similar sequences.

Programs

  • PARI
    Vec((1 + 2*x - x^2 - x^5) / ((1 - x)^2*(1 + x)^2) + O(x^100)) \\ Colin Barker, Mar 04 2017

Formula

G.f.: (1 + 2*x - x^2 - x^5) / (1 - x^2)^2.
From Colin Barker, Mar 04 2017: (Start)
a(n) = 2*a(n-2) - a(n-4) for n>3.
a(n) = 1 for n>1 and even.
a(n) = (n+5) / 2 for n>1 and odd.
(End)
Showing 1-10 of 11 results. Next