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

A007922 Smallest k such that k!! is a multiple of n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 4, 9, 10, 11, 6, 13, 14, 5, 6, 17, 12, 19, 10, 7, 22, 23, 6, 15, 26, 9, 14, 29, 10, 31, 8, 11, 34, 7, 12, 37, 38, 13, 10, 41, 14, 43, 22, 9, 46, 47, 6, 21, 20, 17, 26, 53, 18, 11, 14, 19, 58, 59, 10, 61, 62, 9, 8, 13, 22, 67, 34, 23, 14, 71, 12, 73, 74, 15, 38, 11, 26
Offset: 1

Views

Author

R. Muller

Keywords

Comments

a(n) <= n, with equality if n is 1, 9, a prime or twice a prime. Are those the only cases of equality? - Robert Israel, Apr 22 2024

Crossrefs

Programs

  • Maple
    V:= Vector(100): count:= 0:
    S:= {$1..100}:
    for k from 1 while count < 100 do
      v:= doublefactorial(k);
      SP:= select(t -> v mod t = 0, S);
      count:= count + nops(SP);
      V[convert(SP,list)]:= k;
      S:= S minus SP;
    od:
    convert(V,list); # Robert Israel, Apr 21 2024
  • Mathematica
    df[n_]:=Module[{k=1},While[!Divisible[k!!,n],k++];k]; Array[df,80] (* Harvey P. Dale, Jun 04 2013 *)

A085118 Primes together with twice the odd primes.

Original entry on oeis.org

2, 3, 5, 6, 7, 10, 11, 13, 14, 17, 19, 22, 23, 26, 29, 31, 34, 37, 38, 41, 43, 46, 47, 53, 58, 59, 61, 62, 67, 71, 73, 74, 79, 82, 83, 86, 89, 94, 97, 101, 103, 106, 107, 109, 113, 118, 122, 127, 131, 134, 137, 139, 142, 146, 149, 151, 157, 158, 163, 166, 167, 173, 178
Offset: 1

Views

Author

Leroy Quet, Apr 25 2004

Keywords

Comments

Probably the same sequence as: numbers n such that phi(n)+1 divides n.
Cohen and Segal showed that in case there were other solutions to this problem (which appeared to be posed by Schinzel), then they should have at least 15 distinct prime factors. Moreover, there is a connection with the Lehmer's totient problem which asks whether there is a composite n such that phi(n)|(n-1). If no such composite exists, then p and 2p are the only members for Leroy's sequence. - Francisco Salinas (franciscodesalinas(AT)hotmail.com), Apr 25 2004

Crossrefs

Equals A001751\{4}.

Programs

  • Mathematica
    With[{nn=40},Take[Sort[Join[Prime[Range[2nn]],2Prime[Range[2,nn]]]],2nn]] (* Harvey P. Dale, Oct 03 2013 *)
  • Python
    from sympy import primepi
    def A085118(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return int(n+x-primepi(x)-primepi(x>>1)+(x>=4))
        return bisection(f,n,n) # Chai Wah Wu, Oct 17 2024

Extensions

More terms from David Wasserman, Jan 27 2005

A105661 a(n)=1 if n is a prime, 2 if n is an even semiprime, otherwise 0.

Original entry on oeis.org

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

Views

Author

Giovanni Teofilatto, May 04 2005

Keywords

Examples

			a(3) = 1 because n = 3 is a prime;
a(4) = 2 because n = 4 = 2*2 is an even semiprime;
a(8) = 0 because n = 8 is neither prime nor an even semiprime.
a(15) = 0 because n = 15 = 3*5 is an odd semiprime.
		

Crossrefs

Programs

  • Mathematica
    Table[Which[PrimeQ[n],1,EvenQ[n]&&PrimeOmega[n]==2,2,True,0],{n,120}] (* Harvey P. Dale, Jul 05 2021 *)
  • PARI
    for(n=1,105,if((n%2==0)&&(bigomega(n)==2),r=2,r=isprime(n));print1(r,","))
    
  • Scheme
    (define (A105661 n) (cond ((= 1 (A001222 n)) 1) ((and (even? n) (= 2 (A001222 n))) 2) (else 0))) ;; Antti Karttunen, Jul 26 2017

Extensions

Corrected and extended by Rick L. Shepherd, May 17 2005

A251561 A permutation of the natural numbers: interchange p and 2p for every prime p.

Original entry on oeis.org

1, 4, 6, 2, 10, 3, 14, 8, 9, 5, 22, 12, 26, 7, 15, 16, 34, 18, 38, 20, 21, 11, 46, 24, 25, 13, 27, 28, 58, 30, 62, 32, 33, 17, 35, 36, 74, 19, 39, 40, 82, 42, 86, 44, 45, 23, 94, 48, 49, 50, 51, 52, 106, 54, 55, 56, 57, 29, 118, 60, 122, 31, 63, 64, 65, 66
Offset: 1

Views

Author

N. J. A. Sloane, Dec 26 2014

Keywords

Comments

a(A001751(n)) != A001751(n). - Reinhard Zumkeller, Dec 27 2014

Crossrefs

Programs

  • Haskell
    a251561 1 = 1
    a251561 n | q == 1                    = 2 * p
              | p == 2 && a010051' q == 1 = q
              | otherwise                 = n
              where q = div n p; p = a020639 n
    -- Reinhard Zumkeller, Dec 27 2014
  • Mathematica
    a251561[n_] := Block[{f}, f[x_] := Which[PrimeQ[x], 2 x, PrimeQ[x/2], x/2, True, x]; Array[f, n]]; a251561[66] (* Michael De Vlieger, Dec 26 2014 *)
  • Python
    from sympy import isprime
    def A251561(n):
        if n == 2:
            return 4
        q,r = divmod(n,2)
        if r :
            if isprime(n):
                return 2*n
            return n
        if isprime(q):
            return q
        return n # Chai Wah Wu, Dec 26 2014
    

A290541 Record gaps between numbers that are either prime or twice a prime.

Original entry on oeis.org

1, 3, 6, 10, 11, 12, 13, 15, 19, 21, 25, 28, 35, 40, 48, 57, 60, 64, 70, 75, 83, 90, 95, 117, 120, 144, 148, 150, 153, 167, 168, 196, 205, 212, 214, 221, 234, 244, 254, 255
Offset: 1

Views

Author

Bobby Jacobs, Aug 05 2017

Keywords

Comments

Records in A290496.
The gap of 57 between 31397 and 31454 is due to the record prime gap between 31397 and 31469 being almost exactly twice the record prime gap between 15683 and 15727.

Examples

			a(3) = 6 because the next number that is a prime or twice a prime after 47 is 53, and that is a record gap of size 6.
		

Crossrefs

Programs

  • Mathematica
    With[{nn = 10^7}, Union@ FoldList[Max, Differences@ #] &@ Union@ Flatten@ {#, 2 TakeWhile[#, # < Prime[nn]/2 &]} &@ Prime@ Range@ nn] (* Michael De Vlieger, Aug 06 2017 *)

Formula

a(n) = A290489(n) - A290488(n).

Extensions

a(36)-a(40) from Giovanni Resta, Aug 06 2017

A238268 The number of unordered ways that n can be written as the sum of two numbers of the form p or 2p, where p is prime.

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 3, 2, 3, 3, 3, 3, 4, 4, 3, 3, 4, 4, 3, 3, 5, 4, 4, 4, 5, 4, 4, 3, 4, 6, 4, 3, 7, 4, 3, 5, 6, 5, 5, 5, 6, 7, 4, 4, 9, 5, 5, 7, 6, 5, 5, 4, 5, 7, 4, 3, 10, 4, 4, 8, 8, 7, 7, 5, 6, 8, 5, 4, 10, 5, 5, 9, 8, 7, 8, 5, 7, 9, 5, 4, 13, 8, 6, 8, 8, 7
Offset: 4

Views

Author

Lei Zhou, Feb 21 2014

Keywords

Comments

p and 2p are terms of A001751.
Sequence defined for n >= 4.
It is conjectured that all terms of this sequence are greater than zero.

Examples

			n=4, 4=2+2, one case found. So a(4)=1;
...
n=24, 24 = 2+2*11 = 5+19 = 7+17 = 2*5+2*7 = 11+13, 5 cases found.  So a(24)=5;
...
n=33, 33 = 2+31 = 2*2+29 = 7+2*13 = 2*5+23 = 11+2*11 = 2*7+19, 6 cases found.  So a(33)=6.
		

Crossrefs

Programs

  • Mathematica
    Table[ct = 0; Do[If[((PrimeQ[i]) || (PrimeQ[i/2])) && ((PrimeQ[n - i]) || (PrimeQ[(n - i)/2])), ct++], {i, 2, Floor[n/2]}]; ct, {n, 4, 89}]
  • PARI
    isp(i) = isprime(i) || (((i % 2) == 0) && isprime(i/2));
    a(n) = sum(i=1, n\2, isp(i) && isp(n-i)); \\ Michel Marcus, Mar 07 2014

A298861 Rank of n-th prime when all the primes and twice-primes are jointly ranked.

Original entry on oeis.org

1, 2, 4, 6, 8, 9, 11, 12, 14, 16, 17, 19, 21, 22, 24, 25, 27, 28, 30, 31, 32, 34, 36, 38, 40, 41, 42, 44, 45, 46, 49, 50, 52, 53, 56, 57, 58, 60, 62, 63, 65, 66, 67, 68, 70, 71, 74, 77, 79, 80, 81, 82, 83, 84, 86, 88, 89, 90, 92, 94, 95, 96, 99, 100, 101
Offset: 1

Views

Author

Clark Kimberling, Feb 13 2018

Keywords

Examples

			A001751 = ordered sequence of primes and twice-primes: 2,3,4,5,6,7,10,... in which the primes occupy ranks 1,2,4,6,...
		

Crossrefs

Cf. A000040, A001751, A298862 (complement).

Programs

  • Mathematica
    z = 1000; u = Prime[Range[z]]; w = Take[Union[u, 2 u], z];
    p[n_] := If[MemberQ[u, w[[n]]], 0, 1];
    Take[w, z];  (* A001751 *)
    t = Table[p[n], {n, 1, z}];
    Flatten[Position[t, 0]];  (* A298861 *)
    Flatten[Position[t, 1]];  (* A298862 *)

A298862 Rank of n-th twice-prime when all the primes and twice-primes are jointly ranked.

Original entry on oeis.org

3, 5, 7, 10, 13, 15, 18, 20, 23, 26, 29, 33, 35, 37, 39, 43, 47, 48, 51, 54, 55, 59, 61, 64, 69, 72, 73, 75, 76, 78, 85, 87, 91, 93, 97, 98, 102, 104, 106, 108, 112, 114, 118, 120, 122, 124, 129, 134, 136, 138, 141, 143, 145, 149, 152, 155, 156, 158, 160
Offset: 1

Views

Author

Clark Kimberling, Feb 13 2018

Keywords

Examples

			A001751 = ordered sequence of primes and twice-primes:  2,3,4,5,6,7,10,... in which twice-primes occupy ranks 3,5,7,...
		

Crossrefs

Cf. A000040, A001751, A298861 (complement).

Programs

  • Mathematica
    z = 1000; u = Prime[Range[z]]; w = Take[Union[u, 2 u], z];
    p[n_] := If[MemberQ[u, w[[n]]], 0, 1];
    Take[w, z];  (* A001751 *)
    t = Table[p[n], {n, 1, z}];
    Flatten[Position[t, 0]];  (* A298861 *)
    Flatten[Position[t, 1]];  (* A298862 *)

A238269 Smallest number that can be written in n ways as the sum of two numbers of the form p or 2p, where p is prime.

Original entry on oeis.org

4, 6, 8, 16, 24, 33, 36, 63, 48, 60, 93, 140, 84, 108, 132, 189, 165, 144, 120, 210, 297, 168, 204, 180, 276, 252, 285, 288, 462, 240, 372, 432, 336, 300, 396, 609, 360, 492, 552, 468, 564, 528, 576, 504, 708, 1089, 648, 480, 420, 540, 768, 672, 600, 816, 792
Offset: 1

Views

Author

Lei Zhou, Feb 21 2014

Keywords

Examples

			4 is the smallest number that can be written in only one way as the sum of two primes or doubled primes, 4=2+2. So a(1)=4;
6 = 2+2*2 = 3+3, two ways, so a(2)=6;
...
33 = 2+31 = 2*2+29 = 7+2*13 = 2*5+23 = 11+2*11 = 2*7+19, 6 ways.  And all numbers smaller than 33 can only be split in 5 or fewer ways.  So a(6)=33.
		

Crossrefs

Programs

  • Mathematica
    target = 55; n = 3; a = {}; sc = 0; Do[AppendTo[a, 0], {i, 1, target}]; While[sc < target, n++; ct = 0; Do[If[((PrimeQ[i]) || (PrimeQ[i/2])) && ((PrimeQ[n - i]) || (PrimeQ[(n - i)/2])), ct++], {i, 2, Floor[n/2]}]; If[ct<=target,If[a[[ct]] == 0, a[[ct]] = n; sc++]]];a
Previous Showing 11-19 of 19 results.