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-3 of 3 results.

A116966 a(n) = n + {1,2,0,1} according as n == {0,1,2,3} mod 4.

Original entry on oeis.org

1, 3, 2, 4, 5, 7, 6, 8, 9, 11, 10, 12, 13, 15, 14, 16, 17, 19, 18, 20, 21, 23, 22, 24, 25, 27, 26, 28, 29, 31, 30, 32, 33, 35, 34, 36, 37, 39, 38, 40, 41, 43, 42, 44, 45, 47, 46, 48, 49, 51, 50, 52, 53, 55, 54, 56, 57, 59, 58, 60, 61, 63, 62, 64, 65, 67, 66, 68
Offset: 0

Views

Author

N. J. A. Sloane, Mar 31 2006

Keywords

Comments

In each group of four consecutive numbers, swap 2nd and 3rd terms. - Zak Seidov, Mar 31 2006
First differences of A089781. - Reinhard Zumkeller, Aug 15 2015
From Guenther Schrack, May 31 2017: (Start)
Permutation of the positive integers partitioned into quadruples [4k+1,4k+3,4k+2,4k+4].
Partial sums: A116996. (End)

Crossrefs

Programs

  • Haskell
    a116966 n = a116966_list !! n
    a116966_list = zipWith (+) [0..] $ drop 2 a140081_list
    -- Reinhard Zumkeller, Aug 15 2015
  • Magma
    /* By definition: */ [ n + [1,2,0,1][1+(n mod 4)]: n in [0..70] ]; // Bruno Berselli, Nov 25 2012
    
  • Maple
    f:=proc(i) if i mod 4 = 0 then i+1 elif i mod 4 = 1 then i+2 elif i mod 4 = 2 then i else i+1; fi; end;
  • Mathematica
    b := {1, 2, 0, 1}; a[n_] := n + b[[1 + Mod[n, 4]]]; Table[a[n], {n, 0, 60}] (* Stefan Steinerberger, Mar 31 2006 *)
    CoefficientList[Series[(2 x^3 - x^2 + 2 x + 1) / ((x - 1)^2 (x + 1) (x^2 + 1)), {x, 0, 40}], x] (* Vincenzo Librandi, Jun 19 2013 *)
  • Maxima
    makelist(n+1+(%i^(n*(n-1))-(-1)^n)/2, n, 0, 70); /* Bruno Berselli, Nov 25 2012 */
    
  • PARI
    Vec((2*x^3-x^2+2*x+1) / ((x-1)^2*(x+1)*(x^2+1)) + O(x^66) ) \\ Joerg Arndt, Apr 30 2013
    

Formula

a(n) = n+1+(i^(n(n-1))-(-1)^n)/2, where i=sqrt(-1). - Bruno Berselli, Nov 25 2012
G.f.: (2*x^3-x^2+2*x+1) / ((x-1)^2*(x+1)*(x^2+1)). - Colin Barker, Apr 30 2013
a(n) = A140081(n+2) + n. - Reinhard Zumkeller, Aug 15 2015
From Guenther Schrack, May 31 2017: (Start)
a(n) = n + 1 + ((-1)^(n*(n-1)/2) - (-1)^n)/2.
a(n) = a(n-4) + 4, n > 3.
a(n) = a(n-1) + a(n-4) - a(n-5), n > 4. (End)
Sum_{n>=0} (-1)^n/a(n) = Pi/4 + log(2)/2. - Amiram Eldar, Jan 31 2023

A162899 Partial sums of [A052938(n)^2].

Original entry on oeis.org

1, 10, 14, 30, 39, 64, 80, 116, 141, 190, 226, 290, 339, 420, 484, 584, 665, 786, 886, 1030, 1151, 1320, 1464, 1660, 1829, 2054, 2250, 2506, 2731, 3020, 3276, 3600, 3889, 4250, 4574, 4974, 5335, 5776, 6176, 6660, 7101, 7630, 8114, 8690, 9219, 9844, 10420
Offset: 0

Views

Author

Rick L. Shepherd, Jul 16 2009

Keywords

Comments

Another plausible solution, besides A115391 and A116955, to A115603: Each additional term of the partial sums here is the square of a number that alternately differs +2, -1, +2, -1, ..., from the previous number that is squared: a(3) = 30 = 1^2 + 3^2 + 2^2 + 4^2, where 1, 3, 2, 4 display this pattern.

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{2,1,-4,1,2,-1},{1,10,14,30,39,64},50] (* Harvey P. Dale, Sep 26 2020 *)
  • PARI
    a(n) = sum(k=0, n, (if(k%2==0, k+2, k+5)/2)^2)

Formula

a(n) = sum(k=0..n, A052938(n)^2).
a(n) = (60-36*(-1)^n+(109-9*(-1)^n)*n+24*n^2+2*n^3)/24. G.f.: (4*x^4-4*x^3-7*x^2+8*x+1) / ((x-1)^4*(x+1)^2). - Colin Barker, Jul 18 2013

A164765 Partial sums of [A080782^2].

Original entry on oeis.org

1, 10, 14, 30, 66, 91, 140, 221, 285, 385, 529, 650, 819, 1044, 1240, 1496, 1820, 2109, 2470, 2911, 3311, 3795, 4371, 4900, 5525, 6254, 6930, 7714, 8614, 9455, 10416, 11505, 12529, 13685, 14981, 16206, 17575, 19096, 20540, 22140, 23904, 25585
Offset: 1

Views

Author

Carl R. White, Aug 25 2009

Keywords

Comments

Yet another plausible solution to A115603.
The first differences of A115603 are all squares (assuming a prior term of 0), meaning that any sequence beginning 1,3,2,4 is sufficient to account for them; This solution chooses the permutation of integers A080782 = {1,3,2,4,6,5,7,9,8,...}
Ultimately that means this sequence is equal to A000330 for every two out of three consecutive terms, and is greater by 2n+1 where different.

Crossrefs

Original puzzle: A115603; Used in this solution: A080782, A000330; Other solutions: A115391, A116955, A162899

Programs

  • Mathematica
    Accumulate[Array[#+Mod[#+1,3]&,70,0]^2] (* Harvey P. Dale, Mar 29 2013 *)
  • PARI
    Vec(x*(1 + 8*x - 5*x^2 + 10*x^3 + 4*x^4 - x^5 + x^6) / ((1 - x)^4*(1 + x + x^2)^2) + O(x^40)) \\ Colin Barker, Aug 03 2020

Formula

a(n) = ( n(n+1) + 6 - 8*sin^2(Pi*(n+1)/3) )*(2n+1)/6.
a(n) = Sum_{k=0..n} A080782(k)^2.
From Colin Barker, Aug 03 2020: (Start)
G.f.: x*(1 + 8*x - 5*x^2 + 10*x^3 + 4*x^4 - x^5 + x^6) / ((1 - x)^4*(1 + x + x^2)^2).
a(n) = 2*a(n-1) - a(n-2) + 2*a(n-3) - 4*a(n-4) + 2*a(n-5) - a(n-6) + 2*a(n-7) - a(n-8) for n>8.
(End)
Showing 1-3 of 3 results.