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

A093178 If n is even then 1, otherwise n.

Original entry on oeis.org

1, 1, 1, 3, 1, 5, 1, 7, 1, 9, 1, 11, 1, 13, 1, 15, 1, 17, 1, 19, 1, 21, 1, 23, 1, 25, 1, 27, 1, 29, 1, 31, 1, 33, 1, 35, 1, 37, 1, 39, 1, 41, 1, 43, 1, 45, 1, 47, 1, 49, 1, 51, 1, 53, 1, 55, 1, 57, 1, 59, 1, 61, 1, 63, 1, 65, 1, 67, 1, 69, 1, 71, 1, 73, 1, 75, 1, 77, 1, 79, 1, 81, 1, 83, 1, 85
Offset: 0

Views

Author

Michael Somos, Mar 27 2004

Keywords

Comments

Continued fraction expansion for tan(1).
1 followed by run lengths of A062557 = 2n-1 1's followed by a 2. - Jeremy Gardiner, Aug 12 2012
Greatest common divisor of n and (n+1) mod 2. - Bruno Berselli, Mar 07 2017

Examples

			1.557407724654902230506974807... = 1 + 1/(1 + 1/(1 + 1/(3 + 1/(1 + ...))))
G.f. = 1 + x + x^2 + 3*x^3 + x^4 + 5*x^5 + x^6 + 7*x^7 + x^8 + 9*x^9 + x^10 + ...
		

Crossrefs

Equals |A009001(n)|.
Cf. A133080, A049471 (decimal expansion), A009001, A161738, A062557, A124625.

Programs

  • Maple
    A093178:=n->(n+1+(1-n)*(-1)^n)/2; seq(A093178(k), k=0..100); # Wesley Ivan Hurt, Oct 19 2013
  • Mathematica
    Join[{1},Riffle[Range[1,85,2],1]] (* or *) Array[If[EvenQ[#],1,#]&,87,0] (* Harvey P. Dale, Nov 23 2011 *)
  • PARI
    {a(n) = if( n%2, n, 1)};

Formula

G.f.: (1+x-x^2+x^3)/(1-x^2)^2.
a(n) = (-1)^n * a(-n) for all n in Z.
a(n) = (1/2) * [ 1 + n + (1-n)*(-1)^n ]. - Ralf Stephan, Dec 02 2004
a(n) = n^n mod (n+1) for n > 0. - Amarnath Murthy, Apr 18 2004
Satisfies a(0) = 1, a(n+1) = a(n) + n if a(n) < n else a(n+1) = a(n)/n. - Amarnath Murthy, Oct 29 2002
a(n) = ((n+1)+(1-n)(-1)^n)/2 and have e.g.f. (1+x)cosh(x). - Paul Barry, Apr 09 2003
a(n) = binomial(n, 2*floor(n/2)). - Paul Barry, Dec 28 2006
Starting (1, 1, 3, 1, 5, 1, 7, ...) = A133080^(-1) * [1,2,3,...]. - Gary W. Adamson, Sep 08 2007
a(n) = denom(b(n+2)/b(n+1)) with b(n) = product((2*n-3-2*k), k=0..floor(n/2-1)). - Johannes W. Meijer, Jun 18 2009
a(n) = 2*floor(n/2) - n*(n-1 mod 2) + 1. - Wesley Ivan Hurt, Oct 19 2013
a(n) = n^(n mod 2). - Wesley Ivan Hurt, Apr 16 2014

A049471 Decimal expansion of tan(1).

Original entry on oeis.org

1, 5, 5, 7, 4, 0, 7, 7, 2, 4, 6, 5, 4, 9, 0, 2, 2, 3, 0, 5, 0, 6, 9, 7, 4, 8, 0, 7, 4, 5, 8, 3, 6, 0, 1, 7, 3, 0, 8, 7, 2, 5, 0, 7, 7, 2, 3, 8, 1, 5, 2, 0, 0, 3, 8, 3, 8, 3, 9, 4, 6, 6, 0, 5, 6, 9, 8, 8, 6, 1, 3, 9, 7, 1, 5, 1, 7, 2, 7, 2, 8, 9, 5, 5, 5, 0, 9, 9, 9, 6, 5, 2, 0, 2, 2, 4, 2, 9, 8
Offset: 1

Views

Author

Albert du Toit (dutwa(AT)intekom.co.za), N. J. A. Sloane

Keywords

Comments

By the Lindemann-Weierstrass theorem, this constant is transcendental. - Charles R Greathouse IV, May 13 2019

Examples

			1.5574077246549022305...
		

Crossrefs

Cf. A093178 (continued fraction), A009001, A073449.

Programs

  • Mathematica
    RealDigits[Tan[1], 10, 100][[1]] (* Amiram Eldar, May 15 2021 *)
  • PARI
    default(realprecision, 20080); x=tan(1); for (n=1, 20000, d=floor(x); x=(x-d)*10; write("b049471.txt", n, " ", d)); \\

Formula

Equals Sum_{k>=1} (-1)^(k+1) * B(2*k) * 2^(2*k) * (2^(2*k) - 1) / (2*k)!, where B(k) is the k-th Bernoulli number. - Amiram Eldar, May 15 2021

A009531 Expansion of the e.g.f. sin(x)*(1+x).

Original entry on oeis.org

0, 1, 2, -1, -4, 1, 6, -1, -8, 1, 10, -1, -12, 1, 14, -1, -16, 1, 18, -1, -20, 1, 22, -1, -24, 1, 26, -1, -28, 1, 30, -1, -32, 1, 34, -1, -36, 1, 38, -1, -40, 1, 42, -1, -44, 1, 46, -1, -48, 1, 50, -1, -52, 1, 54, -1, -56, 1, 58, -1, -60, 1, 62, -1, -64, 1, 66, -1, -68, 1, 70, -1, -72, 1, 74, -1, -76, 1, 78, -1, -80
Offset: 0

Views

Author

Keywords

References

  • Murat Sahin and Elif Tan, Conditional (strong) divisibility sequences, Fib. Q., 56 (No. 1, 2018), 18-31.

Crossrefs

Programs

  • Magma
    [(((2*n+3-(-1)^n)/2)*(-1)^((2*n+5-(-1)^n) div 4)+((2*n-1-(-1)^n) div 2)*(-1)^((6*n+5-(-1)^n) div 4))/2: n in [0..90]]; // Vincenzo Librandi, Jul 19 2015
  • Mathematica
    CoefficientList[Series[x*(1+x)^2/(1+x^2)^2, {x, 0, 100}], x] (* Vaclav Kotesovec, Oct 03 2014 *)
  • PARI
    concat(0, Vec(x*(1+x)^2/(1+x^2)^2 + O(x^80))) \\ Michel Marcus, Oct 03 2014
    
  • PARI
    A009531(n) = (((n^(n+1)) % (n+1)) * ((-1)^((n-1)\2))); \\ Antti Karttunen, Nov 02 2017, after Henry Bottomley's formula.
    
  • PARI
    A009531(n) = (lift(Mod(n, n+1)^(n+1)) * ((-1)^((n-1)\2))); \\ (like above, but quicker) - Antti Karttunen, Nov 02 2017
    

Formula

There's an obvious formula for the n-th term!
G.f.: x*(1+x)^2/(1+x^2)^2.
abs(a(n)) = Sum_{k=0..floor((n-1)/2)} (C(n-k-1, k) mod 2)*(-1)^k*2^A000120(n-2k-1). - Paul Barry, Jan 06 2005
a(n) = (n^(n+1) mod (n+1)) * (-1)^[(n-1)/2] = a(n-1)-a(n-2)+(-1)^n*a(n-1) = -2a(n-2)-a(n-4). - Henry Bottomley, May 07 2005
a(n+2) is the Hankel transform of A086622(n+1). - Paul Barry, Nov 06 2007
E.g.f.: sin(x)*(1+x)=x*Q(0); Q(k)=1+x/(1-x/(x-2*(k+1)*(2k+3)/Q(k+1))); (continued fraction). - Sergei N. Gladkovskii, Nov 18 2011
a(n) = sin(Pi*n/2)-n*cos(Pi*n/2). - Vaclav Kotesovec, Oct 03 2014
a(n) = (((2*n+3-(-1)^n)/2)*(-1)^((2*n+5-(-1)^n)/4)+((2*n-1-(-1)^n)/2)*(-1)^((6*n+5-(-1)^n)/4))/2. - Luce ETIENNE, Jul 18 2015

A062172 Table T(n,k) by antidiagonals of n^(k-1) mod k [n,k > 0].

Original entry on oeis.org

0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 3, 1, 1, 0, 1, 2, 1, 0, 1, 0, 0, 1, 1, 3, 1, 1, 0, 1, 0, 1, 0, 1, 4, 0, 0, 1, 0, 0, 1, 4, 3, 1, 5, 1, 3, 1, 1, 0, 1, 2, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 3, 7, 5, 1, 1, 1, 1, 1, 1, 0, 1, 8, 1, 4, 7, 0, 0, 2, 1, 0, 1, 0, 0, 1, 1, 3, 1, 5, 0, 7, 1, 3, 0, 3, 0, 1, 0
Offset: 1

Views

Author

Henry Bottomley, Jun 12 2001

Keywords

Examples

			T(5,3)=5^(3-1) mod 3=25 mod 3=1. Rows start (0,1,1,1,1,...), (0,0,1,0,1,...), (0,1,0,3,1...), (0,0,1,0,1,...), (0,1,1,1,0,...), ...
		

Crossrefs

Cf. A002997, A060154. Rows include A057427, A062173, A062174, A062175, A062176. Columns include A000004, A000035, A011655, A010684 with interleaved 0's, A011558, A010875. Diagonals include all the rows again and A000004 and A009001 unsigned.

A344935 a(0)=1; for n > 0, a(n) = n*(a(n-1) + i^(n-1)) if n is odd, n*a(n-1) + i^n otherwise, where i = sqrt(-1).

Original entry on oeis.org

1, 2, 3, 6, 25, 130, 779, 5446, 43569, 392130, 3921299, 43134278, 517611337, 6728947394, 94205263515, 1413078952710, 22609263243361, 384357475137154, 6918434552468771, 131450256496906630, 2629005129938132601, 55209107728700784642, 1214600370031417262123
Offset: 0

Views

Author

Amrit Awasthi, Jun 03 2021

Keywords

Examples

			a(0) = 1;
a(1) = 1*(a(0) + i^(1-1)) =  2;
a(2) = 2*a(1)  + i^2      =  3;
a(3) = 3*(a(2) + i^2)     =  6;
a(4) = 4*a(3)  + i^4      = 25.
		

Crossrefs

Programs

  • Maple
    A344935 := proc(n)
        option remember ;
        if n = 0 then
            1;
        elif type(n,'odd') then
            n*(procname(n-1)+I^(n-1)) ;
        else
            n*procname(n-1)+I^n ;
        end if;
        simplify(%) ;
    end proc:
    seq(A344935(n),n=0..40) ; # R. J. Mathar, Aug 19 2022
  • Mathematica
    a[0] = 1; a[n_] := a[n] = If[OddQ[n], n*(a[n - 1] + I^(n - 1)), n*a[n - 1] + I^n]; Array[a, 30, 0] (* Amiram Eldar, Jun 03 2021 *)
  • PARI
    a(n) = if (n==0, 1, if (n%2, n*(a(n-1) + I^(n-1)), n*a(n-1) + I^n)); \\ Michel Marcus, Jun 05 2021

Formula

E.g.f.: (1+x)*cos(x)/(1-x).
Lim_{n->infinity} a(n)/n! = 2*cos(1) = 2*A049470.
D-finite with recurrence a(n) -n*a(n-1) +2*a(n-2) +2*(-n+2)*a(n-3) +a(n-4) +(-n+4)*a(n-5)=0. - R. J. Mathar, Aug 19 2022
Showing 1-5 of 5 results.