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.

Previous Showing 11-13 of 13 results.

A089607 a(n)=((-1)^(n+1)*A002425(n)) modulo 4.

Original entry on oeis.org

1, 3, 1, 3, 3, 1, 1, 3, 3, 3, 1, 1, 3, 1, 1, 3, 3, 3, 1, 3, 3, 1, 1, 1, 3, 3, 1, 1, 3, 1, 1, 3, 3, 3, 1, 3, 3, 1, 1, 3, 3, 3, 1, 1, 3, 1, 1, 1, 3, 3, 1, 3, 3, 1, 1, 1, 3, 3, 1, 1, 3, 1, 1, 3, 3, 3, 1, 3, 3, 1, 1, 3, 3, 3, 1, 1, 3, 1, 1, 3, 3, 3, 1, 3, 3, 1, 1, 1, 3, 3, 1, 1, 3, 1, 1, 1, 3, 3, 1, 3, 3, 1, 1, 3, 3
Offset: 1

Views

Author

Benoit Cloitre, Dec 30 2003

Keywords

Crossrefs

Cf. A056832.

Programs

  • PARI
    a(n)=numerator(2/n*(4^n-1)*bernfrac(2*n))%4

Formula

a(1)=1; for n>=2, a(n) = 2*A014577(n-1)+1

A089612 a(n) = ((-1)^(n+1)*A002425(n)) modulo 5.

Original entry on oeis.org

1, 4, 1, 3, 1, 4, 1, 1, 1, 4, 1, 3, 1, 4, 1, 2, 1, 4, 1, 3, 1, 4, 1, 1, 1, 4, 1, 3, 1, 4, 1, 4, 1, 4, 1, 3, 1, 4, 1, 1, 1, 4, 1, 3, 1, 4, 1, 2, 1, 4, 1, 3, 1, 4, 1, 1, 1, 4, 1, 3, 1, 4, 1, 3, 1, 4, 1, 3, 1, 4, 1, 1, 1, 4, 1, 3, 1, 4, 1, 2, 1, 4, 1, 3, 1, 4, 1, 1, 1, 4, 1, 3, 1, 4, 1, 4, 1, 4, 1, 3, 1, 4, 1, 1, 1
Offset: 1

Views

Author

Benoit Cloitre, Dec 30 2003

Keywords

Crossrefs

Programs

  • Magma
    [Numerator(2/n*(4^n-1)*Bernoulli(2*n)) mod 5: n in [1..100]]; // Vincenzo Librandi, Aug 01 2018
  • Mathematica
    Table[Mod[Numerator[2 / n (4^n - 1) BernoulliB[2 n]], 5], {n, 100}] (* Vincenzo Librandi, Aug 01 2018 *)
  • PARI
    a(n)=numerator(2/n*(4^n-1)*bernfrac(2*n))%5
    
  • PARI
    a(n)=if(n%2, 1, 2*2^valuation(n,2) % 5); \\ Andrew Howroyd, Aug 01 2018
    

Formula

Let S(1) = {1, 4} and S(n+1) = S(n)*S'(n), where S'(n) is obtained from S(n) by changing last term using the cyclic permutation 4->3->1->2->4; sequence is S(infinity).
Multiplicative with a(2^e) = 2^(e + 1) mod 5, a(p^e) = 1 for odd prime p. - Andrew Howroyd, Aug 01 2018
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 21/10. - Amiram Eldar, Nov 10 2022

A105931 a(1) = 1 then a(n) = a(n-1) - (-1)^ceiling(n/2)*a(floor(n/2)).

Original entry on oeis.org

1, 2, 1, -1, 1, 2, 1, 2, 1, 2, 1, -1, 1, 2, 1, -1, 1, 2, 1, -1, 1, 2, 1, 2, 1, 2, 1, -1, 1, 2, 1, 2, 1, 2, 1, -1, 1, 2, 1, 2, 1, 2, 1, -1, 1, 2, 1, -1, 1, 2, 1, -1, 1, 2, 1, 2, 1, 2, 1, -1, 1, 2, 1, -1, 1, 2, 1, -1, 1, 2, 1, 2, 1, 2, 1, -1, 1, 2, 1, -1, 1, 2, 1, -1, 1, 2, 1, 2, 1, 2, 1, -1, 1, 2, 1, 2, 1, 2, 1, -1, 1, 2, 1, 2, 1, 2, 1, -1, 1, 2, 1, -1, 1, 2, 1, -1, 1, 2
Offset: 1

Views

Author

Benoit Cloitre, Apr 26 2005

Keywords

Comments

The asymptotic density of the occurrences of -1, 1, and 2 are 1/6, 1/2, and 1/3, respectively. - Amiram Eldar, Nov 30 2022

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{e = IntegerExponent[n, 2]}, If[e > 0, If[Mod[e, 2] == 1, 2, -1], 1]]; Array[a, 100] (* Amiram Eldar, Nov 30 2022 after the second PARI code *)
  • PARI
    a(n)=if(n<2,1,a(n-1)-(-1)^ceil(n/2)*a(floor(n/2)))
    
  • PARI
    a(n)={my(e=valuation(n, 2)); if(e>0, if(e%2, 2, -1), 1)} \\ Andrew Howroyd, Aug 06 2018

Formula

abs(a(n)) = A056832(n).
a(k) = -1 iff k is in 4*A003159.
From Amiram Eldar, Nov 30 2022: (Start)
Multiplicative with a(2^e) = 2 if e is odd and -1 if e is even, and a(p^e) = 1 for p > 2.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 1. (End)
Dirichlet g.f.: zeta(s)*(4^s+2^(s+1)-2)/(4^s+2^s). - Amiram Eldar, Jan 04 2023
Previous Showing 11-13 of 13 results.