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

A283427 a(n) is the number of consecutive smallest prime totatives of primorial A002110(n).

Original entry on oeis.org

0, 1, 7, 26, 34, 55, 65, 91, 137, 152, 208, 251, 270, 315, 394, 471, 502, 591, 656, 685, 790, 864, 977, 1139, 1227, 1268, 1354, 1395, 1494, 1847, 1945, 2109, 2157, 2455, 2512, 2693, 2878, 3005, 3202, 3396, 3471, 3826, 3902, 4045, 4119, 4581, 5059, 5226, 5307
Offset: 1

Views

Author

Jamie Morken and Michael De Vlieger, May 15 2017

Keywords

Comments

Let p_n# = A002110(n) be the n-th primorial, and let t be a totative of p_n#, i.e., gcd(t, p_n#) = 1. Let q be the smallest prime totative of p_n#. We know q must be p_(n+1) by the definition of "primorial" as the product of the smallest n primes. This is the starting point of the range of primes we are considering. The ending point is the smallest composite totative, which is a square semiprime. This semiprime in fact must be q^2, since q is the smallest prime totative of p_n#. Stated in terms of prime n, the range we are considering are primes p_(n+1) <= t <= prevprime((p_(n+1))^2). For the smallest primorials, q^2 > p_n# with n <= 3. Thus a(n) < A054272(n) for n <= 3.

Examples

			a(2) = pi(min(prime(3)^2, p_2#)) - 2 = pi(min(25,6)) - 2 = 3 - 2 = 1.
a(4) = pi(min(prime(5)^2, p_4#)) - 4 = pi(min(121,210)) - 4 = 30 - 4 = 26.
		

Crossrefs

Programs

  • Mathematica
    Table[PrimePi[Min[Prime[n + 1]^2, Product[Prime@ i, {i, n}]]] - n, {n, 49}] (* Michael De Vlieger, May 16 2017 *)

Formula

a(n) = pi(min(prime(n+1)^2, Product_{k=1..n} ( prime(k) ) )) - n.

A308777 Number of twin primes between p and p^2 (inclusive) where p is the n-th prime.

Original entry on oeis.org

1, 3, 6, 9, 16, 19, 32, 35, 42, 58, 61, 82, 96, 101, 122, 148, 174, 183, 220, 242, 247, 276, 304, 332, 374, 404, 417, 436, 447, 468, 552, 576, 630, 641, 730, 749, 788, 822, 864, 910, 960, 985, 1082, 1095, 1134, 1149, 1252, 1370, 1416, 1433, 1464, 1528, 1545, 1636, 1702
Offset: 1

Views

Author

Michel Marcus, Jun 24 2019

Keywords

Comments

Similar sequences given in cross-references have further information and references; in particular A273257 has much more efficient PARI code. - M. F. Hasler, Jun 27 2019

Examples

			There is a single twin prime (3) between 2 and 4, so a(1) = 1.
There are 3 twin primes (3, 5 and 7) between 3 and 9, so a(2) = 3.
		

Crossrefs

Cf. A001097 (twin primes), A054272, A057767 (twin pairs between p(n)^2 and p(n+1)^2), A088019.
Cf. A143738 (twin primes between n and n^2), A273257 (twin pairs between prime(n) and prime(n)^2).

Programs

  • Maple
    a:= n-> (p-> add(`if`(isprime(j) and (isprime(j-2) or
            isprime(j+2)), 1, 0), j=p..p^2))(ithprime(n)):
    seq(a(n), n=1..55);  # Alois P. Heinz, Jun 25 2019
  • Mathematica
    a[n_] := With[{p = Prime[n]}, Sum[Boole[PrimeQ[k] && (PrimeQ[k-2] || PrimeQ[k+2])], {k, p, p^2}]];
    Array[a, 55] (* Jean-François Alcover, Feb 29 2020 *)
  • PARI
    a(n) = my(p=prime(n)); sum(k=p, p^2, isprime(k) && (isprime(k-2) || isprime(k+2)));
    
  • Python
    from sympy import prime, prevprime, nextprime
    def A308777(n):
        if n == 1:
            return 1
        c, p = 0, prime(n)
        p2, x = p**2, [prevprime(p), p , nextprime(p)]
        while x[1] <= p2:
            if x[1] - x[0] == 2 or x[2] - x[1] == 2:
                c += 1
            x = x[1:] + [nextprime(x[2])]
        return c # Chai Wah Wu, Jun 25 2019

A359632 Sequence of gaps between deletions of multiples of 7 in step 4 of the sieve of Eratosthenes.

Original entry on oeis.org

12, 7, 4, 7, 4, 7, 12, 3, 12, 7, 4, 7, 4, 7, 12, 3, 12, 7, 4, 7, 4, 7, 12, 3, 12, 7, 4, 7, 4, 7, 12, 3, 12, 7, 4, 7, 4, 7, 12, 3, 12, 7, 4, 7, 4, 7, 12, 3, 12, 7, 4, 7, 4, 7, 12, 3, 12, 7, 4, 7, 4, 7, 12, 3, 12, 7, 4, 7, 4, 7, 12, 3, 12, 7, 4, 7, 4, 7, 12, 3
Offset: 1

Views

Author

Alexandre Herrera, Jan 08 2023

Keywords

Comments

This sequence is a repeating cycle 12, 7, 4, 7, 4, 7, 12, 3 of length A005867(4) = 8 = (prime(1)-1)*(prime(2)-1)*(prime(3)-1).
The mean of the cycle is prime(4) = 7.
The cycle is constructed from the sieve of Eratosthenes as follows.
In the first 2 steps of the sieve, the gaps between the deleted numbers are constant: gaps of 2 in step 1 when we delete multiples of 2, and gaps of 3 in step 2 when we delete multiples of 3.
In step 3, when we delete all multiples of 5, the gaps are alternately 7 and 3 (i.e., cycle [7,3]).
For this sequence, we look at the interesting cycle from step 4 (multiples of 7).
Excluding the final 3, the cycle has reflective symmetry: 12, 7, 4, 7, 4, 7, 12. This is true for every subsequent step of the sieve too.
The central element is 7 (BUT not all steps have their active prime number as the central element).
a(1) is A054272(4).
a(8) = 3, the first appearance of the last element of the cycle, corresponds to deletion of 217 = A002110(4)+7.

Examples

			After sieve step 3, multiples of 2,3,5 have been eliminated leaving
  7,11,13,17,19,23,29,31,37,41,43,47,49,53, ...
  ^                                   ^
The first two multiples of 7 are 7 itself and 49 and they are distance 12 apart in the list so that a(1) = 12.
For n = 2, a(n) = 7, because the third multiple of 7 that is not a multiple of 2, 3 or 5 is 77 = 7 * 11, which is located 7 numbers after 49 = 7*7 in the list of numbers without the multiples of 2, 3 and 5.
		

Crossrefs

Equivalent sequences for steps 1..3: A007395, A010701, A010705 (without the initial 3).

Programs

  • Mathematica
    PadRight[{}, 100, {12, 7, 4, 7, 4, 7, 12, 3}] (* Paolo Xausa, Jul 01 2024 *)
  • Python
    numbers = []
    for i in range(2,880):
        numbers.append(i)
    gaps = []
    step = 4
    current_step = 1
    while current_step <= step:
        prime = numbers[0]
        new_numbers = []
        gaps = []
        gap = 0
        for i in range(1,len(numbers)):
            gap += 1
            if numbers[i] % prime != 0:
                new_numbers.append(numbers[i])
            else:
                gaps.append(gap)
                gap = 0
        current_step += 1
        numbers = new_numbers
    print(gaps)

Formula

a(n) = A236175(n)+1. - Peter Munn, Jan 21 2023

A058020 Difference between lcm(1,..,n) and the smallest prime > lcm(1,...,n) + 1, where n runs over A000961, lcm(n) runs through A051451.

Original entry on oeis.org

3, 5, 5, 7, 11, 13, 11, 13, 31, 23, 19, 37, 41, 29, 31, 43, 53, 41, 53, 79, 59, 97, 59, 61, 113, 97, 179, 73, 73, 97, 103, 101, 109, 101, 229, 109, 139, 113, 227, 131, 191, 163, 139, 199, 151, 139, 181, 223, 229, 367, 239, 499, 251, 509, 251, 227, 373, 281, 233
Offset: 1

Views

Author

Labos Elemer, Nov 14 2000

Keywords

Comments

Analogous to Fortunate numbers and like them so far proved to be primes. This holds for x<=421: if Q is the first follower prime, then Q(421)-lcm(1,...421) = 557. For first some cases when 1+LCM is also a prime, the 2nd primes give 3,5,5,7,11,11,.. deviations, i.e. give primes.

Crossrefs

Programs

  • PARI
    N=1; for(n=2,1e3, if(isprimepower(n,&p), N*=p; print1(nextprime(N+2)-N", "))) \\ Charles R Greathouse IV, Nov 18 2015

Extensions

Name corrected by Charles R Greathouse IV, Nov 18 2015

A162541 Primes p such that a splitting of the cyclic group Zp by the perfect 3-shift code {+-1,+-2,+-3} exists.

Original entry on oeis.org

7, 37, 139, 163, 181, 241, 313, 337, 349, 379, 409, 421, 541, 571, 607, 631, 751, 859, 877, 937, 1033, 1087, 1123, 1171, 1291, 1297, 1447, 1453, 1483, 1693, 1741, 1747, 2011, 2161, 2239, 2311, 2371, 2473, 2539, 2647, 2677, 2707, 2719, 2857, 3169, 3361, 3433, 3511, 3547
Offset: 1

Views

Author

Ctibor O. Zizka, Jul 05 2009

Keywords

Comments

This list was computed by S. Saidi.
From Travis Scott, Oct 04 2022: (Start)
These are also the p whose (phi/3)-th power residues have minimal bases at {1,2,3} (see under Example). Such covers {1
a(n)-> {1,2,3}(n) = 7, 37, 139, 163, 181, 241, ... ~ (9*n)*log(n)
{1,2,4}(n) = 13, 19, 61, 67, 73, 79, ... ~ (9*n/2)*log(n)
{1,3,5}(n) = 31, 223, 229, 277, 283, 397, ... ~ (27*n)*log(n)
{1,3,7}(n) = 43, 433, 457, 691, 1069, 1471, ... ~ (81*n/2)*log(n)
{1,3,9}(n) = 109, 127, 157, 601, 733, 739, ... ~ (81*n/4)*log(n)
{1,5,7}(n) = 307, 919, 1093, 2179, 2251, 3181, ... ~ (81*n)*log(n)
Note that the k-th q value takes A054272(k) x values and that a(n) = A040034(n) \ {1,2,4}(n). Following a result of Erdős (cf. A053760, A098990) the asymptotic means for q and x are Sum_{n>=1} prime(n)*2/3^n = 2.69463670741804726229622... and Sum_{n>=1} Sum_{prime(n) < k prime < prime(n)^2 OR k = prime(n)^2} D(prime(n),k)*k = 5.69767191389790422108748...
Subsequence of A040034 (2 is not a cubic residue modulo p) such that 3 is neither a residue nor in the same cubic power class as 2. (End)

Examples

			From _Travis Scott_, Oct 04 2022: (Start)
{1,2,3}^12 (mod 37) == {1,26,10} covers the 12th-power residues on Z/37Z.
{1,2,3}^14 (mod 43) == {1,1,36} misses 6. (End)
		

Crossrefs

Subsequence of A040034.

Programs

  • Mathematica
    Select[Prime@Range@497,Mod[#,3]==1&&DuplicateFreeQ@PowerMod[{1,2,3},(#-1)/3,#]&] (* Travis Scott, Oct 04 2022 *)

Formula

From Travis Scott, Oct 04 2022: (Start)
Primes of quadratic form 7x^2 +- 6xy + 36y^2 [from Saidi].
a(n) ~ 9*n*log(n). (End)

Extensions

Incorrect term deleted and more terms from Travis Scott, Oct 04 2022
Previous Showing 11-15 of 15 results.