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.

A080567 1 + Sum_{k=2..n} 2^((prime(k)-1)/2).

Original entry on oeis.org

1, 3, 7, 15, 47, 111, 367, 879, 2927, 19311, 52079, 314223, 1362799, 3459951, 11848559, 78957423, 615828335, 1689570159, 10279504751, 44639243119, 113358719855, 663114533743, 2862137789295, 20454323833711, 301929300544367
Offset: 1

Views

Author

N. J. A. Sloane, based on information supplied by Artur Jasinski, Mar 21 2003

Keywords

Comments

Take an initial segment of A080545, stopping at the n-th 1, reverse and interpret as a binary number.

Crossrefs

Extensions

More terms from Vladeta Jovovic, Mar 26 2003

A090405 a(n) = PrimePi(n+2) - PrimePi(n).

Original entry on oeis.org

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

Views

Author

Eric W. Weisstein, Nov 29 2003

Keywords

Comments

For n>1, a(n) = 1 if n+1 or n+2 is prime, otherwise a(n) = 0. - Robert Israel, Mar 30 2017

Crossrefs

Programs

  • Maple
    with(numtheory): A090405:=n->pi(n+2)-pi(n): seq(A090405(n), n=1..150); # Wesley Ivan Hurt, Mar 30 2017
  • Mathematica
    Table[Subtract @@ Map[PrimePi, n + {2, 0}], {n, 120}] (* or *)
    Table[Boole@ PrimeQ[n + 1 + Boole[OddQ@ n]] + Boole[n == 1], {n, 120}] (* Michael De Vlieger, Mar 30 2017 *)
  • PARI
    for(n=1, 100, print1(primepi(n + 2) - primepi(n),", ")) \\ Indranil Ghosh, Mar 31 2017
    
  • Python
    from sympy import primepi
    print([primepi(n + 2) - primepi(n) for n in range(1, 101)])
    # Indranil Ghosh, Mar 31 2017
    
  • Python
    from sympy import isprime
    def a(n):
        if n<2: return 2
        else:
            if isprime(n + 1 + (n%2 == 1) + (n==1)): return 1
            else: return 0 # Indranil Ghosh, Mar 31 2017

A090406 a(n) = PrimePi(n+3) - PrimePi(n).

Original entry on oeis.org

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

Views

Author

Eric W. Weisstein, Nov 29 2003

Keywords

Comments

a(n) <= 2, with equality if and only if n=1 or n+1 is in A001359. - Robert Israel, Aug 14 2015

Crossrefs

Programs

  • Maple
    B:= [seq(numtheory:-pi(n),n=1..103)]:
    B[4..-1] - B[1..-4]; # Robert Israel, Aug 14 2015
  • Mathematica
    Last[#]-First[#]&/@Partition[PrimePi[Range[110]],4,1] (* Harvey P. Dale, Feb 24 2013 *)

Formula

a(n) = A010051(n+1) + A010051(n+2) + A010051(n+3). - Robert Israel, Aug 14 2015

A171387 The characteristic function of primes > 3: 1 if n is prime such that neither prime+-1 is prime else 0.

Original entry on oeis.org

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

Views

Author

Juri-Stepan Gerasimov, Dec 07 2009

Keywords

Crossrefs

Formula

A010051(n) = a(n) + A171386(n).
If n > 3, a(n) = A010051(n), otherwise a(n) = 0. - Antti Karttunen, Oct 04 2017

A309676 Number of compositions (ordered partitions) of n into odd primes (including 1).

Original entry on oeis.org

1, 1, 1, 2, 3, 5, 8, 13, 21, 33, 53, 86, 138, 222, 357, 573, 921, 1481, 2381, 3828, 6153, 9890, 15898, 25556, 41082, 66039, 106156, 170644, 274307, 440945, 708815, 1139412, 1831589, 2944253, 4732847, 7607989, 12229743, 19659153, 31601828, 50799517, 81659549
Offset: 0

Views

Author

Ilya Gutkovskiy, Aug 12 2019

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 1, a(n-1)+
          add(`if`(isprime(j), a(n-j), 0), j=3..n))
        end:
    seq(a(n), n=0..42);  # Alois P. Heinz, Aug 12 2019
  • Mathematica
    nmax = 42; CoefficientList[Series[1/(1 - x - Sum[x^Prime[k], {k, 2, nmax}]), {x, 0, nmax}], x]
    a[0] = 1; a[n_] := a[n] = Sum[Boole[PrimeOmega[k] < 2 && OddQ[k]] a[n - k], {k, 1, n}]; Table[a[n], {n, 0, 42}]

Formula

G.f.: 1/(1 - x - Sum_{k>=2} x^prime(k)).
Showing 1-5 of 5 results.