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 41-50 of 80 results. Next

A106092 Even numbers and primes.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 22, 23, 24, 26, 28, 29, 30, 31, 32, 34, 36, 37, 38, 40, 41, 42, 43, 44, 46, 47, 48, 50, 52, 53, 54, 56, 58, 59, 60, 61, 62, 64, 66, 67, 68, 70, 71, 72, 73, 74, 76, 78, 79, 80, 82, 83, 84, 86, 88, 89, 90, 92, 94, 96, 97
Offset: 1

Views

Author

Zak Seidov, May 07 2005

Keywords

Crossrefs

Cf. A000720.
Complement of A014076.

Programs

  • Maple
    map(op,[seq([2*k,`if`(isprime(2*k+1),2*k+1,NULL)],k=1..100)]); # Robert Israel, Jan 01 2019
  • Mathematica
    Union[Prime[Range[30]], Select[Range[113], EvenQ]]
    DeleteCases[Range[2,100],?(OddQ[#]&&CompositeQ[#]&)] (* _Harvey P. Dale, Dec 04 2021 *)
  • PARI
    isok(n) = isprime(n) || ((n%2) == 0); \\ Michel Marcus, Feb 24 2020
    
  • Python
    from sympy import primepi
    def A106092(n):
        m, k = n, 1+(n<<1)-primepi(n)-(n>>1)
        while m != k:
            m, k = k, 1+n+k-primepi(k)-(k>>1)
        return m # Chai Wah Wu, Jul 31 2024

Formula

From Robert Israel, Jan 01 2019: (Start)
a(k-1+A000720(2*k)) = 2*k.
a((prime(k)-3)/2 + k) = prime(k) for k >= 2. (End)

A121091 Smallest nexus prime of the form n^p - (n-1)^p, where p is an odd prime.

Original entry on oeis.org

7, 19, 37, 61, 4651, 127, 1273609, 2685817, 271, 331, 397, 6431804812640900941, 547, 631, 5613125740675652943160572913465695837595324940170321, 371281, 919
Offset: 2

Views

Author

Alexander Adamchuk, Aug 11 2006, revised Dec 01 2006, Feb 15 2007

Keywords

Comments

a(19) = 19^1607 - 18^1607, which is too large to include. It has 2055 decimal digits. See A062585(1) = 1607.
a(20)-a(21) = {723901, 8005616640331026125580781}. a(n) is currently known for all n up to n = 96. Corresponding smallest odd primes p such that (n+1)^p - n^p is prime are listed in A125713(n) = {3,3,3,3,5,3,7,7,3,3,3,17,3,3,43,5,3,10957,5,19,127,229,3,3,3,13,3,3,149,3,5,3,23,3,5,83,3,3,37,7,3,3,37,5,3,5,58543,...}. a(n+1) = A065013(n) for n = {4, 7, 10, 12, 13, 16, 17, 19, 22, 24, 25, 27, 28, 31, ...} = A047845(n) = (n-1)/2, where n runs through odd nonprimes (A014076), for n>1.

Crossrefs

Cf. A125713 = Smallest odd prime p such that (n+1)^p - n^p is prime. Cf. A065913 = Smallest prime of form (n+1)^k - n^k. Cf. A058013 = Smallest prime p such that (n+1)^p - n^p is prime. Cf. A047845, A014076.
Cf. A062585 = numbers n such that k^n - (k-1)^n is prime, where k is 19. Cf. A000043, A057468, A059801, A059802, A062572-A062666.

Formula

a(n) = n^A125713(n) - (n-1)^A125713(n).

A143791 A positive integer k is included if no prime divisor p of k, when p is represented in binary, occurs within k represented in binary.

Original entry on oeis.org

1, 9, 21, 25, 33, 35, 49, 65, 69, 77, 81, 115, 121, 129, 133, 143, 145, 161, 169, 203, 209, 217, 253, 259, 261, 265, 273, 275, 289, 295, 297, 299, 301, 305, 319, 321, 323, 329, 341, 361, 377, 385, 391, 403, 415, 427, 437, 451, 481, 505, 513, 515, 517, 527, 529
Offset: 1

Views

Author

Leroy Quet, Sep 01 2008

Keywords

Comments

This sequence contains no primes.
This sequence contains no even numbers (A014076). - Robert G. Wilson v, Sep 22 2008

Examples

			21 is binary is 10101. The prime divisors of 21 are 3 and 7. 3 is 11 in binary, which does not occur within 10101. 7 is 111 in binary, which also does not occur within 10101. So 21 is in the sequence.
On the other hand, 27 in binary is 11011. The only prime divisor of 27 is 3, which is 11 in binary. 11 does occur (twice) within 11011 like so: (11)0(11). So 27 is not in the sequence.
		

Crossrefs

Cf. A143792.

Programs

  • Mathematica
    f[n_] := Block[{nb = ToString@ FromDigits@ IntegerDigits[n, 2], psb = ToString@ FromDigits@ IntegerDigits[ #, 2] & /@ First@ Transpose@ FactorInteger@ n, c = 0, k = 1}, lmt = 1 + Length@ psb; While[ k < lmt, If[ StringCount[ nb, psb[[k]]] > 0, c++ ]; k++ ]; c]; f[1] = 0; Select[ Range@ 1000, f@# == 0 &] (* Robert G. Wilson v, Sep 22 2008 *)
    npdQ[k_]:=Max[SequenceCount[IntegerDigits[k,2],IntegerDigits[#,2]]&/@FactorInteger[k][[;;,1]]]==0; Join[{1},Select[Range[600],npdQ]] (* Harvey P. Dale, Dec 03 2024 *)

Extensions

a(7) and further terms from Robert G. Wilson v, Sep 22 2008

A153309 Numbers k such that 3*k + 1 is not prime.

Original entry on oeis.org

0, 1, 3, 5, 7, 8, 9, 11, 13, 15, 16, 17, 18, 19, 21, 23, 25, 27, 28, 29, 30, 31, 33, 35, 37, 38, 39, 40, 41, 43, 44, 45, 47, 48, 49, 51, 53, 55, 56, 57, 58, 59, 61, 62, 63, 65, 67, 68, 69, 71, 72, 73, 75, 77, 78, 79, 81, 82, 83, 84, 85, 86, 87, 88, 89, 91, 93, 95
Offset: 1

Views

Author

Vincenzo Librandi, Dec 23 2008

Keywords

Comments

Terms (except 0) can be written as 3xy +- (x + y) for x > 0, y > 0. - Ron R Spencer, Aug 01 2016
Apart from a(2) = 1 the sequence comprises those numbers k such that (3*k)!/(3*k + 1) is an integer. - Peter Bala, Jan 25 2017

Examples

			Distribution of the even terms in the following triangular array:
                        *;
                      *   8;
                    *   *  16;
                  *   *   *   *;
                *  18   *   *  40;
              *   *  30   *   *  56;
            *   *   *   *   *   *   *;
          *  28   *   *  62   *   *  96;
        *   *  44   *   *  82   *   *  120;
      *   *   *   *   *   *   *   *   *   *;
    *  38   *   *  84   *   *  130  *   *  176;
  *   *  58   *   *  108  *   *  158  *   *  208;
etc., where * marks the noninteger values of (4*h*k + 2*k + 2*h)/3 with h >= k >= 1. - _Vincenzo Librandi_, Jan 17 2013
		

Crossrefs

Programs

  • Magma
    [n: n in [0..150] | not IsPrime(3*n + 1)]; // Vincenzo Librandi, Jan 12 2013
    
  • Maple
    # produces the sequence apart from the term equal to 1
    for n from 0 to 100 do
    if irem(factorial(3*n), 3*n+1) = 0 then print(n); end if;
    end do: # Peter Bala, Jan 25 2017
  • Mathematica
    Select[Range[0, 200], !PrimeQ[3*# + 1]&] (* Vincenzo Librandi, Jan 12 2013 *)
  • PARI
    is(n)=!isprime(3*n+1) \\ Charles R Greathouse IV, Aug 01 2016

Extensions

Erroneous comment deleted by N. J. A. Sloane, Jun 23 2010
0 added by Arkadiusz Wesolowski, Jun 25 2011

A226025 Odd composite numbers that are not squares of primes.

Original entry on oeis.org

15, 21, 27, 33, 35, 39, 45, 51, 55, 57, 63, 65, 69, 75, 77, 81, 85, 87, 91, 93, 95, 99, 105, 111, 115, 117, 119, 123, 125, 129, 133, 135, 141, 143, 145, 147, 153, 155, 159, 161, 165, 171, 175, 177, 183, 185, 187, 189, 195, 201, 203, 205, 207, 209, 213, 215, 217
Offset: 1

Views

Author

Arkadiusz Wesolowski, Jun 07 2013

Keywords

Comments

Numbers that are in A071904 (odd composite numbers) but not in A001248 (squares of primes).
First differs from its subsequence A082686 in a(16)=81 which is not in A082686. More precisely, A226025 \ A082686 = A062532 \ {1} = A014076^2 \ {1}. - M. F. Hasler, Oct 20 2013
Odd numbers that are greater than the square of their least prime factor - Odimar Fabeny, Sep 08 2014

Crossrefs

Subsequence of A071904. Cf. A226603.

Programs

  • Haskell
    a226025 n = a226025_list !! (n-1)
    a226025_list = filter ((/= 2) . a100995) a071904_list
    -- Reinhard Zumkeller, Jun 15 2013
    
  • Magma
    [n: n in [3..217 by 2] | not IsPrime(n) and not IsSquare(n) or IsSquare(n) and not IsPrime(Floor(n^(1/2)))];
    
  • Maple
    select(n -> not(isprime(n)) and (not(issqr(n)) or not(isprime(sqrt(n)))), [seq(2*i+1,i=1..1000)]); # Robert Israel, Sep 08 2014
  • Mathematica
    Select[Range[3, 217, 2], ! PrimeQ[#] && ! PrimeQ@Sqrt[#] &]
    r = Prime@Range[2, 6]^2; Complement[Select[Range[3, Last[r] - 2, 2], ! PrimeQ[#] &], Most[r]]
    Select[Range[3,251,2],NoneTrue[{#,Sqrt[#]},PrimeQ]&] (* Harvey P. Dale, Sep 06 2021 *)
  • PARI
    is_A226025(n)={bittest(n,0)&&!isprime(n,0)&&!(issquare(n)&&isprime(sqrtint(n)))&&n>1} \\ - M. F. Hasler, Oct 20 2013

Formula

A226025 = { odd x>1 | A100995(x) = 0 or A100995(x) > 2 }. - M. F. Hasler, Oct 20 2013

A336406 a(n) = number of primes c + d, where c < d = odd composite(n), and c is composite.

Original entry on oeis.org

2, 3, 4, 6, 6, 7, 7, 8, 9, 10, 10, 13, 13, 12, 12, 13, 14, 14, 14, 16, 16, 18, 18, 17, 19, 18, 17, 20, 21, 21, 23, 23, 22, 23, 24, 24, 26, 27, 27, 27, 26, 26, 29, 28, 27, 29, 28, 30, 30, 30, 31, 32, 31, 32, 33, 33, 34, 34, 33, 35, 35, 37, 37, 37, 38, 38, 40
Offset: 1

Views

Author

Clark Kimberling, Jul 20 2020

Keywords

Examples

			The 5th odd composite is 27, so that a(5) counts these 6 primes:
4 + 27, 10 + 27, 14 + 27, 16 + 27, 20 + 27, 26 + 27.
		

Crossrefs

Programs

  • Mathematica
    z = 400; p = Prime[Range[z]];
    c = Select[Range[2, z], ! PrimeQ@# &];  (* A002808 *)
    d = Select[Range[2, z], ! PrimeQ@# && OddQ@# &];  (* A014076 *)
    f[n_] := Select[c, # < d[[n]] &];
    g[n_] := d[[n]] + Select[c, # < d[[n]] &];
    q[n_] := Length[Intersection[p, g[n]]];
    tq = Table[q[n], {n, 1, 120}] (* A336406 *)
    tc = Table[Length[f[n]], {n, 1, 120}] (* A336407 *)
    m = Min[Length[tq], Length[tc]]; Take[tc, m] - Take[tq, m] (* A336408 *)

A336407 a(n) is the number of composites < n-th odd composite.

Original entry on oeis.org

3, 7, 11, 14, 16, 20, 22, 25, 29, 32, 34, 37, 39, 43, 45, 48, 52, 54, 57, 60, 62, 65, 67, 69, 72, 76, 80, 83, 85, 87, 89, 91, 93, 96, 99, 101, 105, 107, 109, 111, 115, 117, 120, 122, 125, 128, 130, 133, 135, 139, 141, 143, 145, 149, 153, 155, 157, 159, 161
Offset: 1

Views

Author

Clark Kimberling, Jul 20 2020

Keywords

Examples

			a(2) is the number of the numbers 4, 6, 8, 9, 10, 12, 14, these being the composites that are less than 15, which is the 2nd odd composite.
		

Crossrefs

Programs

  • Mathematica
    z = 400; p = Prime[Range[z]];
    c = Select[Range[2, z], ! PrimeQ@# &];  (* A002808 *)
    d = Select[Range[2, z], ! PrimeQ@# && OddQ@# &];  (* A014076 *)
    f[n_] := Select[c, # < d[[n]] &];
    g[n_] := d[[n]] + Select[c, # < d[[n]] &];
    q[n_] := Length[Intersection[p, g[n]]];
    tq = Table[q[n], {n, 1, 120}] (* A336406 *)
    tc = Table[Length[f[n]], {n, 1, 120}] (* A336407 *)
    m = Min[Length[tq], Length[tc]]; Take[tc, m] - Take[tq, m] (* A336408 *)
  • PARI
    n=0;forcomposite(x=4,210,if(x%2,print1(n,", "));n++) \\ Hugo Pfoertner, Jul 26 2020
    
  • Python
    from sympy import primepi
    def A336407(n):
        if n == 1: return 3
        m, k = n, (r:=primepi(n)) + n + (n>>1)
        while m != k:
            m, k = k, (r:=primepi(k)) + n + (k>>1)
        return m-r-2 # Chai Wah Wu, Jul 31 2024

A336408 a(n) = number of composites c+d such that c is a composite and d is the n-th odd composite.

Original entry on oeis.org

1, 4, 7, 8, 10, 13, 15, 17, 20, 22, 24, 24, 26, 31, 33, 35, 38, 40, 43, 44, 46, 47, 49, 52, 53, 58, 63, 63, 64, 66, 66, 68, 71, 73, 75, 77, 79, 80, 82, 84, 89, 91, 91, 94, 98, 99, 102, 103, 105, 109, 110, 111, 114, 117, 120, 122, 123, 125, 128, 129, 131, 131
Offset: 1

Views

Author

Clark Kimberling, Jul 20 2020

Keywords

Comments

The n-th odd composite is A014076(n+1); the n-th composite is A002808(n).

Examples

			a(1) counts this sum: 6+9.
a(2) counts these sums: 6+15, 9+15, 10+15, 12+15.
a(3) counts these: 4+21, 6+21, 9+21, 12+21, 14+21, 15+21, 18+21.
		

Crossrefs

Programs

  • Mathematica
    z = 400; p = Prime[Range[z]];
    c = Select[Range[2, z], ! PrimeQ@# &];  (* A002808 *)
    d = Select[Range[2, z], ! PrimeQ@# && OddQ@# &];  (* A014076 *)
    f[n_] := Select[c, # < d[[n]] &];
    g[n_] := d[[n]] + Select[c, # < d[[n]] &];
    q[n_] := Length[Intersection[p, g[n]]];
    tq = Table[q[n], {n, 1, 120}] (* A336406 *)
    tc = Table[Length[f[n]], {n, 1, 120}] (* A336407 *)
    m = Min[Length[tq], Length[tc]]; Take[tc, m] - Take[tq, m] (* A336408 *)

A336409 Distance from prime(n) to the nearest odd composite that is < prime(n).

Original entry on oeis.org

2, 4, 2, 4, 2, 2, 4, 2, 2, 4, 2, 2, 2, 4, 2, 2, 4, 2, 2, 2, 2, 2, 4, 2, 4, 2, 2, 2, 2, 4, 2, 4, 2, 2, 2, 2, 2, 4, 2, 4, 2, 4, 2, 2, 2, 4, 2, 2, 4, 2, 2, 2, 2, 4, 2, 2, 4, 2, 2, 2, 4, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 4, 2, 2, 2, 2, 2, 4
Offset: 5

Views

Author

Clark Kimberling, Sep 06 2020

Keywords

Examples

			Beginning with prime(5) = 11:  11-9 = 2, 13-9 = 4, 17-15 = 2, 19-15 = 4.
		

Crossrefs

Programs

  • Maple
    A336409 := proc(n)
        local p;
        p := ithprime(n) ;
        for a from p-2 by -2 do
            if not isprime(a) then
                return p-a ;
            end if;
        end do:
    end proc:
    seq(A336409(n),n=5..100) ; # R. J. Mathar, Oct 02 2020
    # second Maple program:
    a:= n-> `if`(isprime(ithprime(n)-2), 4, 2):
    seq(a(n), n=5..100);  # Alois P. Heinz, Oct 02 2020
  • Mathematica
    z = 5000; d = Select[Range[2, z], ! PrimeQ@# && OddQ@# &];  (* A014076 *)
    f[n_] := Select[d, # < Prime[n] &];
    t = Table[Prime[n] - Max[f[n]], {n, 5, 300}]  (* A336409 *)
    Flatten[Position[t, 2]]  (* A336410 *)
    Flatten[Position[t, 4]]  (* A336411 *)

Formula

a(n) = 2 * A175191(n-1). - Alois P. Heinz, Oct 02 2020
a(n) = 2 * (A062301(n) + 1). - Hugo Pfoertner, Oct 02 2020

A255763 Odd numbers that are not twin primes.

Original entry on oeis.org

1, 9, 15, 21, 23, 25, 27, 33, 35, 37, 39, 45, 47, 49, 51, 53, 55, 57, 63, 65, 67, 69, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 105, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, 141, 143, 145, 147, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 183, 185, 187, 189, 195, 201
Offset: 1

Views

Author

Omar E. Pol, Mar 30 2015

Keywords

Comments

UNION of A014076 and A134797.

Crossrefs

Previous Showing 41-50 of 80 results. Next