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 23 results. Next

A205558 (A204898)/2 = (prime(k)-prime(j))/2; A086802 without its zeros.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Jan 30 2012

Keywords

Comments

Let p(n) denote the n-th prime. If c is a positive integer, there are infinitely many pairs (k,j) such that c divides p(k)-p(j). The set of differences p(k)-p(j) is ordered as a sequence at A204890. Guide to related sequences:
c....k..........j..........p(k)-p(j).[p(k)-p(j)]/c
It appears that, as rectangular array, this sequence can be described by A(n,k) is the least m such that there are k primes in the set prime(n) + 2*i for {i=1..n}. - Michel Marcus, Mar 29 2023

Examples

			Writing prime(k) as p(k),
p(3)-p(2)=5-3=2
p(4)-p(2)=7-3=4
p(4)-p(3)=7-5=2
p(5)-p(2)=11-3=8
p(5)-p(3)=11-5=6
p(5)-p(4)=11-7=4,
so that the first 6 terms of A205558 are 1,2,1,4,3,2.
The sequence can be regarded as a rectangular array in which row n is given by [prime(n+2+k)-prime(n+1)]/2; a northwest corner follows:
1...2...4...5...7...8....10...13...14...17...19...20
1...3...4...6...7...9....12...13...16...18...19...21
2...3...5...6...8...11...12...15...17...18...20...23
1...3...4...6...9...10...13...15...16...18...21...24
2...3...5...8...9...12...14...15...17...20...23...24
1...3...6...7...10..12...13...15...18...21...22...25
2...5...6...9...11..12...14...17...20...21...24...26
- _Clark Kimberling_, Sep 29 2013
		

Crossrefs

Programs

  • Mathematica
    s[n_] := s[n] = Prime[n]; z1 = 200; z2 = 80;
    f[n_] := f[n] = Floor[(-1 + Sqrt[8 n - 7])/2];
    Table[s[n], {n, 1, 30}]              (* A000040 *)
    u[m_] := u[m] = Flatten[Table[s[k] - s[j], {k, 2, z1}, {j, 1, k - 1}]][[m]]
    Table[u[m], {m, 1, z1}]              (* A204890 *)
    v[n_, h_] := v[n, h] = If[IntegerQ[u[h]/n], h, 0]
    w[n_] := w[n] = Table[v[n, h], {h, 1, z1}]
    d[n_] := d[n] = Delete[w[n], Position[w[n], 0]]
    c = 2; t = d[c]                      (* A080036 *)
    k[n_] := k[n] = Floor[(3 + Sqrt[8 t[[n]] - 1])/2]
    j[n_] := j[n] = t[[n]] - f[t][[n]] (f[t[[n]]] + 1)/2
    Table[k[n], {n, 1, z2}]                  (* A133196 *)
    Table[j[n], {n, 1, z2}]                  (* A131818 *)
    Table[s[k[n]] - s[j[n]], {n, 1, z2}]     (* A204898 *)
    Table[(s[k[n]] - s[j[n]])/c, {n, 1, z2}] (* A205558 *)

A003057 n appears n - 1 times.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The PARI functions t1, t2 can be used to read a triangular array T(n,k) (n >= 2, 1 <= k <= n - 1) by rows from left to right: n -> T(t1(n), t2(n)). - Michael Somos, Aug 23 2002
Smallest integer such that n-1 <= C(a(n),2). - Frank Ruskey, Nov 06 2007
a(n) = inverse (frequency distribution) sequence of A161680. - Jaroslav Krizek, Jun 19 2009
Taken as a triangle t(n, m) with offset 1, i.e., n >= m >= 1, this gives all positive integer limits r = r (a = m, b = A063929(n, m)) of the (a,b)-Fibonacci ratio F(a,b;k+1)/F(a,b;k) for k -> infinity. See the Jan 11 2015 comment on A063929. - Wolfdieter Lang, Jan 12 2015
Square array, T(n,k) = n + k + 2, n > = 0 and k >= 0, read by antidiagonals. Northwest corner:
2, 3, 4, 5, ...
3, 4, 5, 6, ...
4, 5, 6, 7, ...
5, 6, 7, 8, ...
... - Franck Maminirina Ramaharo, Nov 21 2018
a(n) is the pair chromatic number of an empty graph with n vertices. (The pair chromatic number of a graph G is the smallest number of colors for which G has a coloring where every vertex has two distinct colors, no adjacent vertices have a common color, and no pair of colors is repeated.) - Allan Bickle, Dec 26 2021

Examples

			(a,b)-Fibonacci ratio limits r(a,b) (see a comment above): as a triangle with offset 1 one has t(3, m) = 4 for m = 1, 2, 3. This gives the limits r(a = m,b = A063929(3, m)), i.e., r(1,12) = r(2,8) = r(3,4) = 4 (and the limit 4 appears only for these three (a,b) values). - _Wolfdieter Lang_, Jan 12 2015
		

Crossrefs

Programs

  • Magma
    [Round(Sqrt(2*(n-1)))+1: n in [2..60]]; // Vincenzo Librandi, Jun 23 2011
    
  • Maple
    seq(n$(n-1),n=2..15); # Robert Israel, Jan 12 2015
  • Mathematica
    Flatten[Table[PadRight[{},n-1,n],{n,15}]] (* Harvey P. Dale, Feb 26 2012 *)
  • PARI
    t1(n)=floor(3/2+sqrt(2*n-2)) /* A003057 */
    
  • PARI
    t2(n)=n-1-binomial(floor(1/2+sqrt(2*n-2)),2) /* A002260(n-2) */
    
  • Python
    from math import isqrt
    def A003057(n): return (k:=isqrt(m:=n-1<<1))+int((m<<2)>(k<<2)*(k+1)+1)+1 # Chai Wah Wu, Jul 26 2022

Formula

a(n) = A002260(n) + A004736(n).
a(n) = A002024(n-1) + 1 = floor(sqrt(2*(n - 1)) + 1/2) + 1 = round(sqrt(2*(n - 1))) + 1. - Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 21 2003
a(n) = ceiling((sqrt(8*n - 7) + 1)/2). - Reinhard Zumkeller, Aug 28 2001, modified by Frank Ruskey, Nov 06 2007, restored by M. F. Hasler, Jan 13 2015
a(n) = A080036(n-1) - (n - 1) for n >= 2. - Jaroslav Krizek, Jun 19 2009
G.f.: (2*x^2 + Sum_{n>=2} x^(n*(n - 1)/2 + 2))/(1 - x) = (x^2 + x^(15/8)*theta_2(0,sqrt(x))/2)/(1 - x) where theta_2 is the second Jacobi theta function. - Robert Israel, Jan 12 2015

Extensions

More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 21 2003

A014132 Complement of triangular numbers (A000217); also array T(n,k) = ((n+k)^2 + n-k)/2, n, k > 0, read by antidiagonals.

Original entry on oeis.org

2, 4, 5, 7, 8, 9, 11, 12, 13, 14, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 79
Offset: 1

Views

Author

Keywords

Comments

Numbers that are not triangular (nontriangular numbers).
Also definable as follows: a(1)=2; for n>1, a(n) is smallest integer greater than a(n-1) such that the condition "n and a(a(n)) have opposite parities" can always be satisfied. - Benoit Cloitre and Matthew Vandermast, Mar 10 2003
Record values in A256188 that are greater than 1. - Reinhard Zumkeller, Mar 26 2015
From Daniel Forgues, Apr 10 2015: (Start)
With n >= 1, k >= 1:
t(n+k) - k, 1 <= k <= n+k-1, n >= 1;
t(n+k-1) + n, 1 <= n <= n+k-1, k >= 1;
where t(n+k) = t(n+k-1) + (n+k) is the (n+k)-th triangular number, while the number of compositions of n+k into 2 parts is C(n+k-1, 2-1) = n+k-1, the number of nontriangular numbers between t(n+k-1) and t(n+k), just right!
Related to Hilbert's Infinite Hotel:
0) All rooms, numbered through the positive integers, are full;
1) An infinite number of trains, each containing an infinite number of passengers, arrives: i.e., a 2-D lattice of pairs of positive integers;
2) Move occupant of room m, m >= 1, to room t(m) = m*(m+1)/2, where t(m) is the m-th triangular number;
3) Assign n-th passenger from k-th train to room t(n+k-1) + n, 1 <= n <= n+k-1, k >= 1;
4) Everybody has his or her own room, no room is empty, for m >= 1.
If situation 1 happens again, repeat steps 2 and 3, you're back to 4.
(End)
1711 + 2*a(n)*(58 + a(n)) is prime for n<=21. The terms that do not have this property start 29,32,34,43,47,58,59,60,62,63,65,68,70,73,... - Benedict W. J. Irwin, Nov 22 2016
Also numbers k with the property that in the symmetric representation of sigma(k) both Dyck paths have a central peak or both Dyck paths have a central valley. (Cf. A237593.) - Omar E. Pol, Aug 28 2018

Examples

			From _Boris Putievskiy_, Jan 14 2013: (Start)
Start of the sequence as a table (read by antidiagonals, right to left), where the k-th row corresponds to the k-th column of the triangle (shown thereafter):
   2,  4,  7, 11, 16, 22, 29, ...
   5,  8, 12, 17, 23, 30, 38, ...
   9, 13, 18, 24, 31, 39, 48, ...
  14, 19, 25, 32, 40, 49, 59, ...
  20, 26, 33, 41, 50, 60, 71, ...
  27, 34, 42, 51, 61, 72, 84, ...
  35, 43, 52, 62, 73, 85, 98, ...
  (...)
Start of the sequence as a triangle (read by rows), where the i elements of the i-th row are t(i) + 1 up to t(i+1) - 1, i >= 1:
   2;
   4,  5;
   7,  8,  9;
  11, 12, 13, 14;
  16, 17, 18, 19, 20;
  22, 23, 24, 25, 26, 27;
  29, 30, 31, 32, 33, 34, 35;
  (...)
Row number i contains i numbers, where t(i) = i*(i+1)/2:
  t(i) + 1, t(i) + 2, ..., t(i) + i = t(i+1) - 1
(End) [Edited by _Daniel Forgues_, Apr 11 2015]
		

Crossrefs

Cf. A000124 (left edge: quasi-triangular numbers), A000096 (right edge: almost-triangular numbers), A006002 (row sums), A001105 (central terms).
Cf. A242401 (subsequence).
Cf. A145397 (the non-tetrahedral numbers).

Programs

  • Haskell
    a014132 n = n + round (sqrt $ 2 * fromInteger n)
    a014132_list = filter ((== 0) . a010054) [0..]
    -- Reinhard Zumkeller, Dec 12 2012
    
  • Magma
    IsTriangular:=func< n | exists{ k: k in [1..Isqrt(2*n)] | n eq (k*(k+1) div 2)} >; [ n: n in [1..90] | not IsTriangular(n) ]; // Klaus Brockhaus, Jan 04 2011
    
  • Mathematica
    f[n_] := n + Round[Sqrt[2n]]; Array[f, 71] (* or *)
    Complement[ Range[83], Array[ #(# + 1)/2 &, 13]] (* Robert G. Wilson v, Oct 21 2005 *)
    DeleteCases[Range[80],?(OddQ[Sqrt[8#+1]]&)] (* _Harvey P. Dale, Jul 24 2021 *)
  • PARI
    a(n)=if(n<1,0,n+(sqrtint(8*n-7)+1)\2)
    
  • PARI
    isok(n) = !ispolygonal(n,3); \\ Michel Marcus, Mar 01 2016
    
  • Python
    from math import isqrt
    def A014132(n): return n+(isqrt((n<<3)-7)+1>>1) # Chai Wah Wu, Jun 17 2024

Formula

a(n) = n + round(sqrt(2*n)).
a(a(n)) = n + 2*floor(1/2 + sqrt(2n)) + 1.
a(n) = a(n-1) + A035214(n), a(1)=2.
a(n) = A080036(n) - 1.
a(n) = n + A002024(n). - Vincenzo Librandi, Jul 08 2010
A010054(a(n)) = 0. - Reinhard Zumkeller, Dec 10 2012
From Boris Putievskiy, Jan 14 2013: (Start)
a(n) = A007401(n)+1.
a(n) = A003057(n)^2 - A114327(n).
a(n) = ((t+2)^2 + i - j)/2, where
i = n-t*(t+1)/2,
j = (t*t+3*t+4)/2-n,
t = floor((-1+sqrt(8*n-7))/2). (End)
A248952(a(n)) < 0. - Reinhard Zumkeller, Oct 20 2014
a(n) = A256188(A004202(n)). - Reinhard Zumkeller, Mar 26 2015
From Robert Israel, Apr 20 2015 (Start):
a(n) = A118011(n) - n.
G.f.: x/(1-x)^2 + x/(1-x) * Sum(j>=0, x^(j*(j+1)/2)) = x/(1-x)^2 + x^(7/8)/(2-2*x) * Theta2(0,sqrt(x)), where Theta2 is a Jacobi theta function. (End)
G.f. as array: x*y*(2 - 2*y + x^2*y + y^2 - x*(1 + y))/((1 - x)^3*(1 - y)^3). - Stefano Spezia, Apr 22 2024

Extensions

Following Alford Arnold's comment: keyword tabl and correspondent crossrefs added by Reinhard Zumkeller, Dec 12 2012
I restored the original definition. - N. J. A. Sloane, Jan 27 2019

A080037 a(0)=2; for n > 0, a(n) = n + floor(sqrt(4n-3)) + 2.

Original entry on oeis.org

2, 4, 6, 8, 9, 11, 12, 14, 15, 16, 18, 19, 20, 22, 23, 24, 25, 27, 28, 29, 30, 32, 33, 34, 35, 36, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 54, 55, 56, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68, 69, 70, 71, 72, 74, 75, 76, 77, 78, 79, 80, 81, 83, 84, 85, 86, 87, 88, 89, 90, 92
Offset: 0

Views

Author

N. J. A. Sloane, Mar 14 2003

Keywords

Comments

a(0)=2, a(1)=4; for n > 2, a(n) = a(n-1) + 1 if n is already in the sequence, a(n) = a(n-1) + 2 otherwise. [corrected by Jon E. Schoenfield, Jun 24 2018]
For n > 0, a(n) = ceiling((1 + sqrt(n))^2). Empirical observation. - Ronald S. Tiberio, Jun 24 2018
For n > 0, a(n) is the minimal number of thumbtacks needed to secure n square sheets of paper on a bulletin board - one thumbtack in each corner of each sheet - slight overlap allowed so that one thumbtack can secure up to four sheets. - Ronald S. Tiberio, Jun 24 2018
From Ya-Ping Lu, Mar 17 2022: (Start)
Integers m such that connecting the external lattice points of a square spiral with m lattice points forms a polyomino (m is indicated by * in the figure below).
.
37--36*-35*-34*-33*-32*-31
| |
38* 17--16*-15*-14*-13 30*
| | | |
39* 18* 5---4*--3 12* 29*
| | | | | |
40* 19* 6* 1---2* 11* 28*
| | | | |
41* 20* 7---8*--9*-10 27*
| | |
42* 21--22*-23*-24*-25*-26
|
43--44*-45*-46*-47*-48*-49* (End)

Crossrefs

Cf. A000267, A080036, A033638 (complement, except 2).

Programs

  • Maple
    f:= n -> n + floor(sqrt(4*n-3)) + 2:
    f(0):= 2:
    map(f, [$0..100]); # Robert Israel, Jul 27 2023
  • Mathematica
    Join[{2},Table[n+Floor[Sqrt[4n-3]]+2,{n,100}]] (* Harvey P. Dale, Jul 22 2025 *)
  • Python
    from math import isqrt
    def A080037(n): return n+2+isqrt((n<<2)-1) if n else 2 # Chai Wah Wu, Jul 27 2022

Formula

G.f.: (2-z)/(1-z)^2 + Sum_{k >= 1} z^(k^2+1)/(1-z) + Sum_{k >= 0} z^(k^2+k+1)/(1-z) = 1/2 + 1/(z-1)^2 - 1/(2*(z-1)) + z^(3/4)*JacobiTheta2(0,z)/(2*(1-z)) + z*JacobiTheta3(0,z)/(2*(1-z)). - Robert Israel, Jul 27 2023

A080578 a(1)=1; for n > 1, a(n) = a(n-1) + 1 if n is already in the sequence, a(n) = a(n-1) + 3 otherwise.

Original entry on oeis.org

1, 4, 7, 8, 11, 14, 15, 16, 19, 22, 23, 26, 29, 30, 31, 32, 35, 38, 39, 42, 45, 46, 47, 50, 53, 54, 57, 60, 61, 62, 63, 64, 67, 70, 71, 74, 77, 78, 79, 82, 85, 86, 89, 92, 93, 94, 95, 98, 101, 102, 105, 108, 109, 110, 113, 116, 117, 120, 123, 124, 125, 126
Offset: 1

Views

Author

N. J. A. Sloane and Benoit Cloitre, Mar 23 2003

Keywords

Comments

More generally for fixed r, there is a nice connection between the sequence a(1)=1, a(n) = a(n-1) + 1 if n is in the sequence, a(n) = a(n-1) + r + 1 otherwise and the so-called metafibonacci sequences. Indeed, (a(n)-n)/r is a generalized metafibonacci sequence of order r as defined in Ruskey's recent paper (reference given at A046699). - Benoit Cloitre, Feb 04 2007
In the Fokkink-Joshi paper, this sequence is the Cloitre (0,1,1,3)-hiccup sequence. - Michael De Vlieger, Jul 29 2025

Crossrefs

Programs

  • Haskell
    a080578 n = a080578_list !! (n-1)
    a080578_list = 1 : f 2 [1] where
       f x zs@(z:_) = y : f (x + 1) (y : zs) where
         y = if x `elem` zs then z + 1 else z + 3
    -- Reinhard Zumkeller, Sep 26 2014
    
  • Mathematica
    l={1}; a=1; For[n=2, n<=100, If[MemberQ[l, n], a=a+1, a=a+3]; AppendTo[l, a]; n++]; l (* Indranil Ghosh, Apr 07 2017 *)
  • PARI
    a(n)=if(n<2,1,a(n+1-2^floor(log(n)/log(2)))+2*2^floor(log(n)/log(2))-1) \\ Benoit Cloitre, Feb 04 2007
    
  • Python
    l=[1]
    a=1
    for n in range(2, 101):
        a += 3 if n not in l else 1
        l.append(a)
    print(l) # Indranil Ghosh, Apr 07 2017

Formula

a(n) = 2n + O(1); a(2^n) = 2^(n+1). - Benoit Cloitre, Oct 12 2003
a(1) = 1, for n >= 2 a(n) = a(n + 1 - 2^floor(log(n)/log(2))) + 2*2^floor(log(n)/log(2)) - 1; (a(n) - n)/2 = A046699(n) for n >= 2. - Benoit Cloitre, Feb 04 2007
a(n) = A055938(n-1) + 2 (conjectured). - Ralf Stephan, Dec 27 2013

A080458 a(1)=4; for n>1, a(n)=a(n-1) if n is already in the sequence, a(n)=a(n-1)+4 otherwise.

Original entry on oeis.org

4, 8, 12, 12, 16, 20, 24, 24, 28, 32, 36, 36, 40, 44, 48, 48, 52, 56, 60, 60, 64, 68, 72, 72, 76, 80, 84, 84, 88, 92, 96, 96, 100, 104, 108, 108, 112, 116, 120, 120, 124, 128, 132, 132, 136, 140, 144, 144, 148, 152, 156, 156, 160, 164, 168, 168, 172, 176
Offset: 1

Views

Author

N. J. A. Sloane and Benoit Cloitre, Mar 20 2003

Keywords

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1, 0, 0, 1, -1}, {4, 8, 12, 12, 16}, 60] (* Jean-François Alcover, Sep 20 2018 *)
  • PARI
    a(n) = 4 + 4*(n-2-(n-4)\4); \\ Michel Marcus, May 06 2016

Formula

a(n) = 4 + 4*(n-2-floor((n-4)/4)).
From Chai Wah Wu, Jul 17 2016: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n > 5.
G.f.: 4*x*(x^2 + x + 1)/(x^5 - x^4 - x + 1). (End)
From Ilya Gutkovskiy, Jul 17 2016: (Start)
E.g.f.: (3*x + 1)*cosh(x) + (3*x + 2)*sinh(x) - cos(x) - sin(x).
a(n) = (6*n - (-1)^n - 2*sqrt(2)*sin(Pi*n/2+Pi/4) + 3)/2. (End)

A080455 a(1)=1; for n>1, a(n) = a(n-1) if n is already in the sequence, a(n) = a(n-1) + 4 otherwise.

Original entry on oeis.org

1, 5, 9, 13, 13, 17, 21, 25, 25, 29, 33, 37, 37, 41, 45, 49, 49, 53, 57, 61, 61, 65, 69, 73, 73, 77, 81, 85, 85, 89, 93, 97, 97, 101, 105, 109, 109, 113, 117, 121, 121, 125, 129, 133, 133, 137, 141, 145, 145, 149, 153, 157, 157, 161, 165, 169, 169, 173
Offset: 1

Views

Author

N. J. A. Sloane, Mar 20 2003

Keywords

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1, 0, 0, 1, -1}, {1, 5, 9, 13, 13}, 58] (* Jean-François Alcover, Sep 21 2017 *)
  • PARI
    Vec(-x*(x^4-4*x^3-4*x^2-4*x-1)/((x-1)^2*(x+1)*(x^2+1)) + O(x^100)) \\ Colin Barker, Oct 16 2013

Formula

For m>=1, a(4m) = a(4m+1) = 12m+1, a(4m+2) = 12m+5, a(4m+3) = 12m+9.
Or, shorter: a(n) = 4*n+1- 4*floor((n+3)/4). - Benoit Cloitre, Mar 20 2003
From Colin Barker, Oct 16 2013: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5).
G.f.: -x*(x^4 - 4*x^3 - 4*x^2 - 4*x - 1) / ((x-1)^2*(x+1)*(x^2+1)). (End)

A080652 a(1)=2; for n>1, a(n)=a(n-1)+3 if n is already in the sequence, a(n)=a(n-1)+2 otherwise.

Original entry on oeis.org

2, 5, 7, 9, 12, 14, 17, 19, 22, 24, 26, 29, 31, 34, 36, 38, 41, 43, 46, 48, 50, 53, 55, 58, 60, 63, 65, 67, 70, 72, 75, 77, 79, 82, 84, 87, 89, 92, 94, 96, 99, 101, 104, 106, 108, 111, 113, 116, 118, 121, 123, 125, 128, 130, 133, 135, 137, 140, 142, 145
Offset: 1

Views

Author

N. J. A. Sloane, Mar 23 2003

Keywords

Comments

In the Fokkink-Joshi paper, this sequence is the Cloitre (0,2,3,2)-hiccup sequence. - Michael De Vlieger, Jul 29 2025

Crossrefs

Cf. A080455-A080458, A080036, A080037. Apart from start, equals A064437 - 1.

Programs

  • Magma
    [Floor(n*(1+Sqrt(2)) + 1/(1+(1+Sqrt(2)))): n in [1..60]]; // Vincenzo Librandi, Oct 02 2018
  • Mathematica
    a[1] = 2;
    a[n_] := a[n] = If[MemberQ[Array[a, n-1], n], a[n-1] + 3, a[n-1] + 2];
    Array[a, 60] (* Jean-François Alcover, Oct 01 2018 *)
    Table[Floor[n (1 + Sqrt[2]) + 1 / (1 + (1 + Sqrt[2]))], {n, 60}] (* Vincenzo Librandi, Oct 02 2018 *)
  • PARI
    a(n) = my(r=sqrt(2)+1); (r*(r+1)*n+1)\(r+1); \\ Altug Alkan, Oct 01 2018
    

Formula

a(n) = floor(n*r + 1/(1+r)) where r = 1+sqrt(2).

A080456 a(1) = a(2) = 2; for n > 2, a(n) = a(n-1) if n is already in the sequence, a(n) = a(n-1) + 4 otherwise.

Original entry on oeis.org

2, 2, 6, 10, 14, 18, 18, 22, 26, 30, 30, 34, 38, 42, 42, 46, 50, 54, 54, 58, 62, 66, 66, 70, 74, 78, 78, 82, 86, 90, 90, 94, 98, 102, 102, 106, 110, 114, 114, 118, 122, 126, 126, 130, 134, 138, 138, 142, 146, 150, 150, 154, 158, 162, 162, 166, 170, 174, 174
Offset: 1

Views

Author

N. J. A. Sloane, Mar 20 2003

Keywords

Comments

First differences are 4-periodic.

Crossrefs

Programs

  • Mathematica
    Join[{2}, LinearRecurrence[{1, 0, 0, 1, -1}, {6, 10, 14, 18, 18}, 60]] (* Jean-François Alcover, Sep 02 2018 *)
    CoefficientList[Series[-2*(-1 - 2 x^2 - 2 x^3 - x^4 - 2 x^5 + 2 x^6)/((-1 + x)^2 (1 + x +x^2 + x^3)), {x, 0, 60}],x] (* Stefano Spezia, Sep 02 2018 *)

Formula

From Chai Wah Wu, Jul 17 2016: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n > 6.
G.f.: -2*(-1 - 2*x^2 - 2*x^3 - x^4 - 2*x^5 + 2*x^6)/((-1 + x)^2*(1 + x + x^2 + x^3)). (End)

Extensions

a(1) = 2 prepended by Stefano Spezia, Sep 04 2018

A080457 a(1)=3; for n>1, a(n)=a(n-1) if n is already in the sequence, a(n)=a(n-1)+4 otherwise.

Original entry on oeis.org

3, 7, 7, 11, 15, 19, 19, 23, 27, 31, 31, 35, 39, 43, 43, 47, 51, 55, 55, 59, 63, 67, 67, 71, 75, 79, 79, 83, 87, 91, 91, 95, 99, 103, 103, 107, 111, 115, 115, 119, 123, 127, 127, 131, 135, 139, 139, 143, 147, 151, 151, 155, 159, 163, 163, 167, 171, 175
Offset: 1

Views

Author

N. J. A. Sloane and Benoit Cloitre, Mar 20 2003

Keywords

Crossrefs

Programs

  • Magma
    [3+4*(n-2-Floor((n-3)/4)) : n in [1..100]]; // Wesley Ivan Hurt, Jul 15 2015
    
  • Maple
    A080457:=n->3+4*(n-2-floor((n-3)/4)): seq(A080457(n), n=1..100); # Wesley Ivan Hurt, Jul 15 2015
  • Mathematica
    CoefficientList[Series[(3 + 4 x + 4 x^3 + x^4)/((x - 1)^2*(1 + x + x^2 + x^3)), {x, 0, 100}], x] (* Wesley Ivan Hurt, Jul 15 2015 *)
    LinearRecurrence[{1, 0, 0, 1, -1}, {3, 7, 7, 11, 15}, 70] (* Vincenzo Librandi, Jul 16 2015 *)
  • PARI
    main(size)={my(v=vector(size),i,j);v[1]=3;for(j=2,size,x=0;for(i=1,j-1,if(v[i]==j,x=1;break));if(x==1,v[j]=v[j-1],v[j]=v[j-1]+4));return(v);} /* Anders Hellström, Jul 15 2015 */

Formula

a(n) = 3 + 4*(n-2-floor((n-3)/4)).
From Wesley Ivan Hurt, Jul 15 2015: (Start)
G.f.: x*(3+4*x+4*x^3+x^4)/((x-1)^2*(1+x+x^2+x^3)).
a(n) = a(n-1)+a(n-4)-a(n-5), n>5.
a(n) = (6*n-1+(-1)^n-2*(-1)^((2*n+1-(-1)^n)/4))/2. (End)
Showing 1-10 of 23 results. Next