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.

A165211 Period 8: repeat [0,1,0,1,1,0,1,0].

Original entry on oeis.org

0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0
Offset: 0

Views

Author

Philippe Deléham, Sep 07 2009

Keywords

Comments

Parity of A064706.
Parity of the generalized pentagonal numbers A001318. - Omar E. Pol, Feb 04 2012
More generally, parity of the generalized k-gonal numbers, for odd k >= 5. - Omar E. Pol, Feb 05 2012

Crossrefs

Cf. A130198 (essentially the same).

Programs

Formula

a(n) = A002817(n) mod 2. - Wesley Ivan Hurt, Apr 23 2014
a(n) = 1/2 - (-1)^(n*(n+1)*(n^2 + n + 2)/8)/2. - Vaclav Kotesovec, Apr 28 2014
From Colin Barker, Dec 20 2017: (Start)
G.f.: x*(1 - x + x^2) / ((1 - x)*(1 + x^4)).
a(n) = a(n-1) - a(n-4) + a(n-5) for n>4.
(End)

A132194 a(n) = 1 if n-th prime is 0 or 2 mod 3, otherwise 0.

Original entry on oeis.org

1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0
Offset: 1

Views

Author

Roger L. Bagula, Nov 05 2007

Keywords

Comments

Equivalently, a(n) = 0 if n-th prime is 1 mod 3, otherwise 1. - Wouter Meeussen, May 21 2019
Binary sequence based on the primes: play it at a slower tempo to appreciate the irregularities.

Crossrefs

Characteristic function of A133677.

Programs

  • Magma
    [(NthPrime(n) mod 3) eq 1 select 0 else 1: n in [1..200]]; // G. C. Greubel, May 21 2019
    
  • Maple
    a := n -> 1 - irem(modp(ithprime(n), 3), 2):
    seq(a(n), n = 1..105); # Peter Luschny, May 21 2019
  • Mathematica
    Table[If[Mod[Prime[n],3]== 1,0,1],{n,200}] (* Harvey P. Dale, May 21 2019 *)
  • PARI
    {a(n) = if(prime(n)%3==1, 0, 1)}; \\ G. C. Greubel, May 21 2019
    
  • Sage
    def a(n):
        if (mod(nth_prime(n), 3)==1): return 0
        else: return 1
    [a(n) for n in (1..200)] # G. C. Greubel, May 21 2019

Formula

a(n) = 1-A099618(n). - R. J. Mathar, Jun 06 2019
Sum_{k=1..n} a(k) ~ n / 2. - Amiram Eldar, Mar 14 2025

Extensions

Definition corrected by Harvey P. Dale, May 21 2019

A374646 Paradiddle version of Thue-Morse sequence.

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1
Offset: 0

Views

Author

Robert P. P. McKone, Jul 15 2024

Keywords

Comments

A paradiddle is a basic drum pattern, either "left left right left" or "right right left right". We can take left, right to be either 0, 1 or 1, 0.
Limiting word of the morphism with maps 0 |--> 0100, 1 |--> 1011 and axiom 1011. - Joerg Arndt, Jul 15 2024

Examples

			k = 0: Sequence starts at its simplest form;
1.
-----------------------------------------------
k = 1: The 1 of the initial sequence expands following the morphism rules, where 1 -> {1, 0, 1, 1} and 0 -> {0, 1, 0, 0}, resulting in;
1, 0, 1, 1.
-----------------------------------------------
k = 2: Each element of the initial sequence expands following the morphism rules, where 1 -> {1, 0, 1, 1} and 0 -> {0, 1, 0, 0};
1, 0, 1, 1,
0, 1, 0, 0,
1, 0, 1, 1,
1, 0, 1, 1.
-----------------------------------------------
k = 3: The expansion is applied recursively, giving:
1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1,
0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0,
1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1,
1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1.
		

Crossrefs

Cf. A160381, A130198 (single paradiddle), A010059, A010060, A374724.

Programs

  • Mathematica
    SubstitutionSystem[{1 -> {1, 0, 1, 1}, 0 -> {0, 1, 0, 0}}, {1}, {4}] // Flatten
  • PARI
    first(n,v=[1])=if(n>4*#v, v=first((n+3)\4)); my(u=List()); for(i=1,#v-1, listput(u,v[i]); listput(u,1-v[i]); listput(u,v[i]); listput(u,v[i])); my(t=vector(n-#u,i,if(i==2,1-v[#v],v[#v]))); for(j=1,#t, listput(u,t[j])); Vec(u) \\ Charles R Greathouse IV, Jul 31 2024

Formula

a(n) = A160381(n)+1 mod 2. - Kevin Ryde, Dec 28 2024
Showing 1-3 of 3 results.