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

A194591 Least k >= 0 such that n*2^k - 1 or n*2^k + 1 is prime, or -1 if no such value exists.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 1, 0, 1, 0, 2, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 5, 0, 3, 0, 1, 1, 1, 0, 2, 0, 1, 0, 2, 0, 2, 0, 1, 1, 2, 0, 1, 0, 1, 0, 1, 0, 4, 1
Offset: 1

Views

Author

Arkadiusz Wesolowski, Aug 29 2011

Keywords

Comments

Fred Cohen and J. L. Selfridge showed that a(n) = -1 infinitely often.
a(n) = 0 iff n is in A045718.

Examples

			For n=7, 7*2^0-1 and 7*2^0+1 are composite, but 7*2^1-1=13 is prime, so a(7)=1.
		

Crossrefs

Cf. A217892 and A194600 (indices and values of the records).

Programs

  • Mathematica
    Table[k = 0; While[! PrimeQ[n*2^k - 1] && ! PrimeQ[n*2^k + 1], k++]; k, {n, 100}] (* T. D. Noe, Aug 29 2011 *)

Formula

If a(n)>0, then a(2n)=a(n)-1.

A079364 Composite numbers having two composite neighbors.

Original entry on oeis.org

9, 15, 21, 25, 26, 27, 33, 34, 35, 39, 45, 49, 50, 51, 55, 56, 57, 63, 64, 65, 69, 75, 76, 77, 81, 85, 86, 87, 91, 92, 93, 94, 95, 99, 105, 111, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 129, 133, 134, 135, 141, 142, 143, 144, 145, 146, 147, 153, 154, 155
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 15 2003

Keywords

Comments

In other words, composite numbers that are not nearest-neighbors of primes. - Omar E. Pol, Jan 02 2009
Complement of A210940. - Omar E. Pol, Apr 18 2012

Crossrefs

Cf. A010051, A221309 (subsequence).

Programs

  • Haskell
    a079364 n = a079364_list !! (n-1)
    a079364_list = filter
       (\x -> a010051' (x - 1) == 0 && a010051' (x + 1) == 0) a002808_list
    -- Reinhard Zumkeller, Jan 10 2013
  • Mathematica
    Select[Range[6! ],!PrimeQ[ # ]&&!PrimeQ[ #-1]&&!PrimeQ[ #+1]&] (* Vladimir Joseph Stephan Orlovsky, Apr 26 2010 *)
    With[{r=Complement[Range[160],Prime[Range[PrimePi[160]]]]}, Transpose[ Select[ Partition[r,3,1], Differences[#]=={1,1}&]][[2]]] (* Harvey P. Dale, Feb 05 2012 *)
    Mean/@SequencePosition[Table[If[CompositeQ[n],1,0],{n,200}],{1,1,1}] (* Harvey P. Dale, May 10 2025 *)

A084925 Inverse hyperbolic cotangent irreducible numbers: positive integers such that the arccoth of these numbers form a basis for the space of arccoth of rationals >=1. The hyperbolic analog of the Stormer numbers (A005528).

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 28, 30, 32, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 58, 60, 62, 66, 68, 70, 72, 74, 78, 80, 82, 84, 88, 90, 92, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 122, 126, 128, 130, 132, 136, 138, 140, 142, 144, 148, 150
Offset: 1

Views

Author

Paul D. Hanna, Jun 12 2003

Keywords

Comments

n is in the sequence if y = (xn+1)/(x+n) is noninteger for all integer x where 1 < x < n. Equivalently, n is in the sequence when n cannot be formed by (xy-1)/(x-y) for all integers x and y where x < n and 1 < y < x, so n cannot satisfy ((n+1)/(n-1))*((x+1)/(x-1)) = ((y+1)/(y-1)). Thus all the nearest neighbors of the primes (A045718) appear in this sequence.

Crossrefs

Cf. A005528 (Stormer numbers), A045718, A084926.

Programs

  • PARI
    for(n=1,150,x=1; b=0; while(x=(x *n+1),b=b+1)); if(b<=0,print1(n,",")))

A100319 Even numbers m such that at least one of m-1 and m+1 is composite.

Original entry on oeis.org

8, 10, 14, 16, 20, 22, 24, 26, 28, 32, 34, 36, 38, 40, 44, 46, 48, 50, 52, 54, 56, 58, 62, 64, 66, 68, 70, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 104, 106, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 140, 142, 144, 146, 148
Offset: 1

Views

Author

Rick L. Shepherd, Nov 13 2004

Keywords

Comments

Subsequence of A100318. For each k >= 0, a(k+1) = a(k) + 2 unless a(k) + 1 and a(k) + 3 are twin primes, in which case a(k+1) = a(k) + 4 (as a(k) - 1 and a(k) + 5 are divisible by 3).
The even nonisolated primes(n+1). - Juri-Stepan Gerasimov, Nov 09 2009

Crossrefs

Cf. A100318 (supersequence containing odd and even n), A045718 (n such that at least one of n-1 and n+1 is prime).
Cf. A167692(the even nonisolated nonprimes). - Juri-Stepan Gerasimov, Nov 09 2009
Complement of A014574 (average of twin prime pairs) w.r.t. A005843 (even numbers), except for missing term 2.

Programs

  • Mathematica
    Select[2*Range[100], CompositeQ[#-1] || CompositeQ[#+1] &]  (* G. C. Greubel, Mar 09 2019 *)
  • PARI
    forstep(n=4,300,2,if(isprime(n-1)+isprime(n+1)<=1,print1(n,",")))
    
  • Sage
    [n for n in (3..250) if mod(n,2)==0 and (is_prime(n-1) + is_prime(n+1)) < 2] # G. C. Greubel, Mar 09 2019

Formula

a(n) = A167692(n+1). - Juri-Stepan Gerasimov, Nov 09 2009

A147819 Nearest-neighbors of odd primes.

Original entry on oeis.org

2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 28, 30, 32, 36, 38, 40, 42, 44, 46, 48, 52, 54, 58, 60, 62, 66, 68, 70, 72, 74, 78, 80, 82, 84, 88, 90, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 126, 128, 130, 132, 136, 138, 140, 148, 150, 152, 156, 158, 162
Offset: 1

Views

Author

Omar E. Pol, Nov 14 2008

Keywords

Crossrefs

Programs

  • Mathematica
    #+{-1,1}&/@Prime[Range[2,60]]//Flatten//Union (* Harvey P. Dale, Jun 13 2017 *)

A088259 Perfect powers which have at least one prime neighbor.

Original entry on oeis.org

1, 4, 8, 16, 32, 36, 100, 128, 196, 256, 400, 576, 676, 1296, 1600, 2916, 3136, 4356, 5476, 7056, 8100, 8192, 8836, 12100, 13456, 14400, 15376, 15876, 16900, 17956, 21316, 22500, 24336, 25600, 28900, 30976, 32400, 33856, 41616, 42436, 44100
Offset: 1

Views

Author

Amarnath Murthy, Sep 27 2003

Keywords

Comments

If K is a term and K-1 is the neighboring prime then it must be a Mersenne prime.
Conjecture: sequence is infinite.

Crossrefs

Intersection of A001597 and A045718.

Programs

  • Mathematica
    Join[{1},Select[Range[45000],GCD@@FactorInteger[#][[All,2]]>1 && AnyTrue[ #+{1,-1},PrimeQ]&]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 05 2020 *)

Extensions

Corrected and extended by Ray Chandler, Sep 28 2003
Offset changed by Andrew Howroyd, Sep 22 2024

A134924 Nearest-neighbors of isolated primes.

Original entry on oeis.org

1, 3, 22, 24, 36, 38, 46, 48, 52, 54, 66, 68, 78, 80, 82, 84, 88, 90, 96, 98, 112, 114, 126, 128, 130, 132, 156, 158, 162, 164, 166, 168, 172, 174, 210, 212, 222, 224, 232, 234, 250, 252, 256, 258, 262, 264, 276, 278, 292, 294, 306, 308
Offset: 1

Views

Author

Omar E. Pol, Nov 27 2007

Keywords

Crossrefs

Programs

  • Mathematica
    ip=Select[Prime[Range[65]],NoneTrue[{#-2,#+2},PrimeQ]&];Union[Flatten[Table[n+{1, -1}, {n, ip}]]] (* James C. McMahon, Apr 12 2025 *)

A210940 The prime numbers and their nonprime nearest-neighbors.

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Apr 17 2012

Keywords

Comments

The prime numbers and their nearest-neighbors without repetitions.

Crossrefs

Union of A210939 and A000040. Complement of A079364.

Programs

  • Mathematica
    {#-1,#,#+1}&/@Prime[Range[30]]//Flatten//Union (* Harvey P. Dale, Jul 06 2019 *)

Extensions

Corrected (74 added) by Harvey P. Dale, Jul 06 2019

A210939 Nonprime nearest-neighbors of the primes.

Original entry on oeis.org

1, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 28, 30, 32, 36, 38, 40, 42, 44, 46, 48, 52, 54, 58, 60, 62, 66, 68, 70, 72, 74, 78, 80, 82, 84, 88, 90, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 126, 128, 130, 132, 136, 138, 140, 148, 150, 152, 156
Offset: 1

Views

Author

Omar E. Pol, Apr 17 2012

Keywords

Comments

Essentially the same as A147819. R. J. Mathar, Jun 25 2012

Crossrefs

Nonprimes in A045718.

Programs

  • Mathematica
    Select[Range[156], ! PrimeQ[#] && (PrimeQ[# - 1] || PrimeQ[# + 1]) &] (* T. D. Noe, Apr 18 2012 *)
    Join[{1},Flatten[#+{-1,1}&/@Prime[Range[3,40]]]//Union] (* Harvey P. Dale, Oct 22 2022 *)

A128510 Composites c such that c*A001414(c) is adjacent to a prime.

Original entry on oeis.org

4, 6, 8, 9, 10, 12, 14, 16, 20, 21, 25, 26, 28, 33, 34, 35, 36, 38, 40, 42, 44, 46, 50, 51, 52, 54, 55, 56, 60, 64, 65, 68, 72, 74, 76, 80, 81, 82, 85, 90, 93, 95, 96, 98, 100, 102, 110, 111, 115, 119, 121, 122, 123, 124, 126, 132, 133, 135, 138, 140, 143, 144, 145, 146, 148, 150
Offset: 1

Views

Author

J. M. Bergot, May 07 2007

Keywords

Comments

The composites c of A002808 are multiplied by the sum of their prime factors (with multiplicity), and are placed into the sequence if that product is in A045718.

Examples

			c = 52= A002808(74) has prime factor sum A001414(52) = 17, and 52*17 = 883+1 is one away from the prime 883, which adds 52 to the sequence.
		

Crossrefs

Cf. A066073.

Programs

  • Maple
    A001414 := proc(n) local fcts,d ; fcts := ifactors(n)[2] ; add(op(1,d)*op(2,d),d=fcts) ; end proc:
    isA045718 := proc(n) isprime(n+1) or isprime(n-1) ; end proc:
    isA128510 := proc(n) local c; if not isprime(n) then c := n*A001414(n) ; isA045718(c) ; else false; end if ; end proc:
    for n from 4 to 500 do if isA128510(n) then printf("%d,",n) ; end if; end do: # R. J. Mathar, Nov 02 2009

Extensions

8 inserted and sequence extended by R. J. Mathar, Nov 02 2009
Showing 1-10 of 10 results.