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.

A047606 Numbers that are congruent to {1, 2, 3, 5} mod 8.

Original entry on oeis.org

1, 2, 3, 5, 9, 10, 11, 13, 17, 18, 19, 21, 25, 26, 27, 29, 33, 34, 35, 37, 41, 42, 43, 45, 49, 50, 51, 53, 57, 58, 59, 61, 65, 66, 67, 69, 73, 74, 75, 77, 81, 82, 83, 85, 89, 90, 91, 93, 97, 98, 99, 101, 105, 106, 107, 109, 113, 114, 115, 117, 121, 122, 123
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [n: n in [1..120] | n mod 8 in [1,2,3,5]];
    
  • Maple
    A047606:=n->2*n-3+(3-I^(2*n))*(1-I^(n*(n+1)))/4: seq(A047606(n), n=1..100); # Wesley Ivan Hurt, Jun 02 2016
  • Mathematica
    Select[Range[120], MemberQ[{1, 2, 3, 5}, Mod[#, 8]] &] (* or *) LinearRecurrence[{1, 0, 0, 1, -1}, {1, 2, 3, 5, 9}, 60] (* Bruno Berselli, Jul 17 2012 *)
  • Maxima
    makelist(2*n-3+(3-(-1)^n)*(1-%i^(n*(n+1)))/4,n,1,60);
    
  • PARI
    Vec((1+x+x^2+2*x^3+3*x^4)/((1+x)*(1-x)^2*(1+x^2))+O(x^60)) (End)

Formula

From Bruno Berselli, Jul 17 2012: (Start)
G.f.: x*(1+x+x^2+2*x^3+3*x^4)/((1+x)*(1-x)^2*(1+x^2)).
a(n) = 2*n-3+(3-(-1)^n)*(1-i^(n*(n+1)))/4, where i=sqrt(-1). (End)
From Wesley Ivan Hurt, Jun 02 2016: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n>5.
a(2k) = A047617(k), a(2k-1) = A047471(k). (End)
E.g.f.: (6 + 2*sin(x) - cos(x) + 4*(x - 1)*sinh(x) + (4*x - 5)*cosh(x))/2. - Ilya Gutkovskiy, Jun 03 2016
Sum_{n>=1} (-1)^(n+1)/a(n) = (3*sqrt(2)-2)*Pi/16 + (2-sqrt(2))*log(2)/16 + sqrt(2)*log(2+sqrt(2))/8. - Amiram Eldar, Dec 23 2021