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

A131378 Starting with 0, the sequence a(n) changes from 0 to 1 or back when the next number n is a prime.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Zero together with A071986. - Omar E. Pol, Feb 19 2011
Parity of A230980. - Omar E. Pol, Jul 19 2019

Examples

			n = 0, 1, 2, 3, 4, 5, etc.
a(n)= 0, 0, 1, 0, 0, 1, etc.
Starting with 0 the sequence changes when we move from 1 to 2 because 2 is prime, again from 2 to 3 because also 3 is prime, then from 4 to 5 being 5 prime and so on.
		

Crossrefs

Cf. A131377.
Cf. A071986. - Omar E. Pol, Feb 19 2011

Programs

  • Maple
    P:=proc(n) local i,k; k:=0; for i from 0 by 1 to n do if isprime(i) then if k=1 then k:=0; else k:=1; fi; fi; print(k); od; end: P(100);
  • Mathematica
    nxt[{n_,a_}]:={n+1,Which[a==0&&PrimeQ[n+1],1,a==1&&PrimeQ[n+1],0,True,a]}; NestList[nxt,{0,0},100][[All,2]] (* Harvey P. Dale, Jul 19 2019 *)

A347041 Stirling transform of pi (A000720).

Original entry on oeis.org

0, 0, 1, 5, 21, 88, 389, 1852, 9525, 52632, 310141, 1936489, 12749204, 88149847, 637769490, 4812457992, 37763509549, 307453610201, 2592851608305, 22626572045811, 204197274002794, 1905132039608335, 18370391387293756, 183001650861913887, 1882207129695280320
Offset: 0

Views

Author

Alois P. Heinz, Aug 13 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, m) option remember; `if`(n=0,
          numtheory[pi](m), m*b(n-1, m)+b(n-1, m+1))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..27);

Formula

G.f.: Sum_{k>=0} pi(k)*x^k / Product_{j=1..k} (1-j*x).
E.g.f.: Sum_{k>=0} pi(k)*(exp(x)-1)^k/k!.
a(n) = Sum_{k=0..n} Stirling2(n,k)*pi(k).
Showing 1-2 of 2 results.