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

A023520 Exponent of 2 in prime factorization of prime(n)*prime(n-1) - 1.

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 1, 2, 1, 3, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 3, 1, 1, 2, 1, 6, 2, 3
Offset: 2

Views

Author

Keywords

Comments

a(n) = 1 if and only if A080378(n-1) = 2. - Robert Israel, Feb 07 2018

Crossrefs

Programs

  • Maple
    seq(padic:-ordp(ithprime(n)*ithprime(n-1)-1,2),n=2..200); # Robert Israel, Feb 07 2018
  • PARI
    a(n) = valuation(prime(n)*prime(n-1) - 1, 2); \\ Michel Marcus, Sep 30 2013
    
  • Python
    from sympy import prime
    def A023520(n): return (~(m:=prime(n)*prime(n-1)-1)& m-1).bit_length()    # Chai Wah Wu, Jul 07 2022

Formula

a(n) = A007814(A023515(n)). - Michel Marcus, Sep 30 2013

Extensions

Offset set to 2 and a(2) corrected by Michel Marcus, Sep 30 2013

A330559 a(n) = (number of primes p <= prime(n) with Delta(p) == 2 (mod 4)) - (number of primes p <= prime(n) with Delta(p) == 0 (mod 4)), where Delta(p) = nextprime(p) - p.

Original entry on oeis.org

0, 1, 2, 1, 2, 1, 2, 1, 2, 3, 4, 3, 4, 3, 4, 5, 6, 7, 6, 7, 8, 7, 8, 7, 6, 7, 6, 7, 6, 7, 6, 7, 8, 9, 10, 11, 12, 11, 12, 13, 14, 15, 16, 15, 16, 15, 14, 13, 14, 13, 14, 15, 16, 17, 18, 19, 20, 21, 20, 21, 22, 23, 22, 23, 22, 23, 24, 25, 26, 25, 26, 25, 26, 27, 26, 27, 26, 25, 24, 25, 26, 27, 28, 29, 28
Offset: 1

Views

Author

N. J. A. Sloane, Dec 30 2019

Keywords

Comments

Equals A330560 - A330561.
Since Delta(prime(n)) grows roughly like log n, this probably changes sign infinitely often. When is the next time a(n) is zero, or the first time a(n) < 0 (if these values exist)?
Let s = A024675, the interprimes. For each n let E(n) = number of even terms of s that are <= n, and let O(n) = number of odd terms of s that are <= n. Then a(n+1) = E(n) - O(n). That is, as we progress through s, the number of evens stays greater than the number of odds. - Clark Kimberling, Feb 26 2024

Examples

			n=6: prime(6) = 13, primes p <= 13 with Delta(p) == 2 (mod 4) are 3,5,11; primes p <= 13 with Delta(p) == 0 (mod 4) are 7,13; so a(6) = 3-2 = 1.
		

Crossrefs

Sequences related to the differences between successive primes: A001223 (Delta(p)), A028334, A080378, A104120, A330556, A330557, A330558, A330560, A330561.

Programs

  • Mathematica
    Join[{0}, Accumulate[Mod[Differences[Prime[Range[2, 100]]], 4] - 1]] (* Paolo Xausa, Feb 05 2024 *)

A330560 a(n) = number of primes p <= prime(n) with Delta(p) == 2 (mod 4), where Delta(p) = nextprime(p) - p.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 4, 4, 5, 6, 7, 7, 8, 8, 9, 10, 11, 12, 12, 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, 18, 18, 19, 20, 21, 22, 23, 24, 24, 25, 26, 27, 28, 29, 29, 30, 30, 30, 30, 31, 31, 32, 33, 34, 35, 36, 37, 38, 39, 39, 40, 41, 42, 42, 43, 43, 44, 45, 46, 47, 47, 48, 48, 49, 50, 50, 51, 51, 51, 51, 52, 53, 54
Offset: 1

Views

Author

N. J. A. Sloane, Dec 30 2019

Keywords

Crossrefs

Sequences related to the differences between successive primes: A001223 (Delta(p)), A028334, A080378, A104120, A330556, A330557, A330558, A330559, A330561.

Programs

  • Magma
    [#[p:p in PrimesInInterval(1,NthPrime(n))| (NextPrime(p)-p) mod 4 eq 2]:n in [1..90]]; // Marius A. Burtea, Dec 31 2019
  • Maple
    N:= 200: # for a(1)..a(N)
    P:= [seq(ithprime(i), i=1..N+1)]:
    Delta:= P[2..-1]-P[1..-2] mod 4:
    R:= map(charfcn[2], Delta):
    ListTools:-PartialSums(R); # Robert Israel, Dec 31 2019
  • Mathematica
    Accumulate[Map[Boole[Mod[#, 4] == 2]&, Differences[Prime[Range[100]]]]] (* Paolo Xausa, Feb 05 2024 *)

A259360 Initial prime in the least set of exactly n+1 consecutive primes with n gaps all multiples of 4.

Original entry on oeis.org

7, 89, 199, 883, 12401, 463, 36551, 11593, 183091, 766261, 3358169, 241603, 11739307, 9177431, 12270077, 105639091, 310523021, 297779117, 727334879, 5344989829, 1481666377, 2572421893, 1113443017, 79263248027, 84676452781
Offset: 1

Views

Author

Zak Seidov, Jun 24 2015

Keywords

Examples

			a(6)=463 because the first set of 7 consecutive primes is {463,467,479,487,491,499,503} with 6 gaps {4,12,8,4,8,4} all multiples of 4 while the next prime after 503 is 509 and 509-503=6 is not a multiple of 4.
		

Crossrefs

Programs

  • PARI
    back(p,n)=while(n,p=precprime(p-1); n--); p
    v=vector(20); g=0; p=2; forprime(q=3,1e6, if((q-p)%4, if(g&&g<=#v&&v[g]==0, v[g]=back(p,g)); g=0, g++);p=q); v \\ Charles R Greathouse IV, Jul 14 2015

Extensions

a(13)-a(14) corrected by Charles R Greathouse IV, Jul 14 2015
a(24)-a(25) by Zak Seidov, Jul 15 2015
Previous Showing 11-14 of 14 results.