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

A292936 a(n) = the least k >= 0 such that floor(n/(2^k)) is a nonprime; a(n) is degree of the "safeness" of prime, 0 if n is not a prime, 1 for unsafe primes (A059456), and k >= 2 for primes that are (k-1)-safe but not k-safe.

Original entry on oeis.org

0, 1, 1, 0, 2, 0, 2, 0, 0, 0, 3, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 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

Antti Karttunen, Sep 27 2017

Keywords

Comments

Records occur at positions 1, 2, 5, 11, 23, 47, 2879, ... (A292937).

Crossrefs

Cf. A000040, A005385, A066179, A157358, A157359 (positions of terms that are > k, for k = 0..4).
Cf. A059456 (positions of ones).

Programs

  • Maple
    A292936 := proc(n)
        for k from 0 do
            if not isprime(floor(n/2^k)) then
                return k;
            end if;
        end do:
    end proc:
    seq(A292936(n),n=1..100) ; # R. J. Mathar, Sep 28 2017
  • Mathematica
    Table[SelectFirst[Range[0, 10], ! PrimeQ@ Floor[n/(2^#)] &], {n, 105}] (* Michael De Vlieger, Sep 29 2017 *)
  • PARI
    A292936(n) = { my(k=0); while(isprime(n), n >>= 1; k++); k; };
    
  • Scheme
    (define (A292936 n) (A007814 (1+ (A292599 n))))

Formula

a(n) = A007814(1+A292599(n)).
For n >= 1, a(n) <= A078349(n).
For n > 47, a(n) <= A007814(1+n).

A162019 Double-safe primes which are also double-Sophie Germain primes.

Original entry on oeis.org

11, 359, 719, 214559, 215399, 245639, 253679, 266999, 507359, 508559, 574439, 670919, 744599, 825479, 1017119, 1072199, 1184399, 1363679, 1621079, 1688279, 1786439, 2156039, 2377799, 2429279, 2633399, 2684999, 2900039, 3103799
Offset: 1

Views

Author

Keywords

Comments

The intersection of the primes in A066179 and those in A007700: they remain prime after each of two successive applications of the substitution p->(p-1)/2, and remain prime after each two successive applications of the substitution p->2p+1.

Examples

			a(1)=11 is double safe: (11-1)/2=5; (5-1)/2=2, and double Sophie-Germain: 2*11+1=23; 2*23+1=47.
		

Crossrefs

Programs

  • Mathematica
    lst={};Do[p=Prime[n];If[PrimeQ[safe=(p-1)/2],If[PrimeQ[(safe-1)/2],If[PrimeQ[sophie=2*p+1],If[PrimeQ[2*sophie+1],AppendTo[lst,p]]]]],{n,3*9!}];lst

Formula

a(n) = 4*A023302(n) + 3 = (A157359(n)-3)/4. - R. J. Mathar, Jun 26 2009

Extensions

Edited by R. J. Mathar, Jun 26 2009

A292937 a(0)=1, followed by highly safe primes: positions of records in A292936.

Original entry on oeis.org

1, 2, 5, 11, 23, 47, 2879, 71850239, 2444789759, 21981381119
Offset: 0

Views

Author

Antti Karttunen, Sep 28 2017

Keywords

Comments

The starting offset is 0 to accommodate 1, which is only nonprime in this sequence, and also to align with the indexing used in A110056.
Sequence starts like A007505, and at least for terms a(5) .. a(9) is equal to A110056.

Crossrefs

Cf. A000040, A005385, A066179, A157358, A157359 (each starts with the term a(1) .. a(5) of this sequence).

Programs

  • Mathematica
    With[{s = Table[SelectFirst[Range[0, 10], ! PrimeQ@ Floor[n/(2^#)] &], {n, 10^7}]}, Map[FirstPosition[s, #][[1]] &, Union@ FoldList[Max, s]]] (* Michael De Vlieger, Sep 29 2017 *)
Showing 1-3 of 3 results.