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.

A236866 Positions of primes in A007775 (numbers not divisible by 2, 3 or 5).

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 22, 23, 24, 26, 27, 28, 29, 30, 31, 34, 35, 37, 38, 40, 41, 42, 44, 45, 47, 48, 49, 51, 52, 53, 54, 57, 60, 61, 62, 63, 64, 65, 67, 69, 71, 72, 73, 74, 75, 76, 79, 82, 83, 84, 85, 89, 90, 93, 94, 95
Offset: 1

Views

Author

Alex Ratushnyak, Jan 31 2014

Keywords

Comments

From Antti Karttunen, Feb 01 2014: (Start)
Positions of primes among natural numbers coprime to 30.
Term 1 is missing from the sequence, because A007775(1)=1 is not considered a prime, terms 2 - 13 are all present, and 14 is the next term missing from here, as A007775(14)=49 is the first composite in that sequence.
(End)

Crossrefs

Programs

  • Python
    from sympy import isprime
    i=0
    for n in range(1000):
        if n%2 and n%3 and n%5:
            i+=1   # A007775(i)=n
            if isprime(n):  print(i, end=', ')
    
  • Scheme
    ;; With Antti Karttunen's IntSeq-library.
    (define A236866 (MATCHING-POS 1 1 (lambda (n) (prime? (A007775 n)))))
    ;; Where a slow version of A007775 can be defined for example like this,
    (define A007775 (MATCHING-POS 1 1 (lambda (n) (= 1 (gcd n 30)))))
    ;; from Antti Karttunen, Feb 01 2014

A334495 Position of prime(n) in A045572, a(1) = a(3) = 0.

Original entry on oeis.org

0, 2, 0, 3, 5, 6, 7, 8, 10, 12, 13, 15, 17, 18, 19, 22, 24, 25, 27, 29, 30, 32, 34, 36, 39, 41, 42, 43, 44, 46, 51, 53, 55, 56, 60, 61, 63, 66, 67, 70, 72, 73, 77, 78, 79, 80, 85, 90, 91, 92, 94, 96, 97, 101, 103, 106, 108, 109, 111, 113, 114, 118, 123, 125, 126
Offset: 1

Views

Author

Michael De Vlieger, Aug 27 2020

Keywords

Comments

A045572 contains the positive numbers coprime to 10.
Nondivisor primes p (i.e., all primes except p | 10, that is, 2 or 5) belong to one of four residues r (i.e., 1, 3, 7, 9) in the reduced residue system mod 10. Therefore all primes aside from 2 and 5 appear in A045572. On account of this fact, one may use A045572 as a sort of prime sieve. This use is less efficient than searching for primes aside from 2 and 3 amid numbers that are +/-1 (mod 6), i.e., in A007310, and slightly more efficient than searching for primes aside from 2 amid the odd numbers, but in line with the common (decimal) base.

Examples

			a(1) = a(3) = 0 by definition, since 2 and 5 are not in A045572.
a(2) = 2 since A045572(2) = 3, a(10) = 12 since prime(10) = 29 = A045572(12), etc.
		

Crossrefs

Cf. A000040, A045572. Analogous to A181709.

Programs

  • Mathematica
    Array[If[FreeQ[{2, 5}, #], 4 #1 + (#2 + 1)/2 - Boole[#2 > 5] & @@ QuotientRemainder[#, 10], 0] &@ Prime@ # &, 65]

Formula

For prime p_n for n =/= 1 nor n =/= 3, a(p_n) = 4*q + (r + 1)/2 - [r > 5] (Iverson brackets), where q = floor(p_n/10) and r = p_n mod 10.
Showing 1-2 of 2 results.