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-20 of 38 results. Next

A118954 Numbers that cannot be written as 2^k + prime.

Original entry on oeis.org

1, 2, 16, 22, 26, 28, 36, 40, 46, 50, 52, 56, 58, 64, 70, 76, 78, 82, 86, 88, 92, 94, 96, 100, 106, 112, 116, 118, 120, 122, 124, 126, 127, 134, 136, 142, 144, 146, 148, 149, 154, 156, 160, 162, 166, 170, 172, 176, 178, 184, 186, 188, 190, 196, 202, 204, 206, 208
Offset: 1

Views

Author

Reinhard Zumkeller, May 07 2006

Keywords

Comments

A109925(a(n)) = 0.

Crossrefs

Complement of A118955. Subsequence of A118956. Supersequence of A006285.

Programs

  • Haskell
    a118954 n = a118954_list !! (n-1)
    a118954_list = filter f [1..] where
       f x = all (== 0) $ map (a010051 . (x -)) $ takeWhile (< x) a000079_list
    -- Reinhard Zumkeller, Jan 03 2014
    
  • Magma
    lst:=[]; for n in [1..208] do k:=-1; repeat k+:=1; a:=n-2^k; until a lt 1 or IsPrime(a); if a lt 1 then Append(~lst, n); end if; end for; lst; // Arkadiusz Wesolowski, Sep 02 2016
  • PARI
    is(n)=my(k=1);while(kCharles R Greathouse IV, Sep 01 2015
    

Formula

n < a(n) < kn for some k < 2 and all large enough n, see Romanoff and either Erdős or van der Corput. - Charles R Greathouse IV, Sep 01 2015

A350957 Number of ways to write 2*n as 3^i (i >= 0) plus a prime.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Feb 05 2022

Keywords

Crossrefs

Formula

a(n) = A282432(2*n). - R. J. Mathar, Mar 07 2022

A255967 Odd numbers m that are neither of the form p + 2^k nor of the form p - 2^k with 2^k < m, k >= 1, and p prime.

Original entry on oeis.org

1, 1973, 3181, 3967, 4889, 5617, 7747, 7913, 8363, 8587, 8923, 11437, 11993, 12517, 13285, 13973, 14101, 14231, 14489, 16117, 16769, 16849, 18391, 18611, 19583, 19819, 21289, 21683, 21701, 21893, 22147, 22817, 22949, 23651, 24943, 25829, 27197, 27437
Offset: 1

Views

Author

Arkadiusz Wesolowski, Mar 12 2015

Keywords

Comments

Odd numbers m such that for all 2^k < m the numbers m + 2^k and m - 2^k are composite, with k >= 1.

Crossrefs

Cf. A076335.
Subsequence of A006285. Supersequence of A256163.
A153352 gives the primes.

Programs

  • Magma
    lst:=[]; for n in [1..27437 by 2] do t:=0; k:=0; while 2^k lt n do if IsPrime(n-2^k) or IsPrime(n+2^k) then t:=1; break; end if; k+:=1; end while; if IsZero(t) then Append(~lst, n); end if; end for; lst;
    
  • Mathematica
    q[m_] :=  If[EvenQ[m], False, Module[{pow = 2},While[pow < m && !PrimeQ[m - pow] && !PrimeQ[m + pow], pow *= 2]; pow > m]]; Select[Range[30000], q] (* Amiram Eldar, Jul 19 2025 *)
  • PARI
    isok(m) = if(!(m % 2), 0, my(pow = 2); while(pow < m && !isprime(m - pow) && !isprime(m + pow), pow *= 2); pow > m); \\ Amiram Eldar, Jul 19 2025

A350628 Number of ways to write 2*n as 3^i (i >= 1) plus a prime.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Feb 05 2022

Keywords

Crossrefs

A350630 Positive numbers k such that 2k cannot be written as 3^i (i >= 1) plus a prime.

Original entry on oeis.org

1, 2, 9, 12, 18, 21, 24, 27, 30, 33, 36, 39, 45, 48, 51, 54, 57, 60, 63, 66, 69, 72, 75, 78, 81, 84, 87, 90, 93, 96, 99, 102, 105, 108, 111, 114, 117, 120, 126, 129, 132, 135, 138, 141, 144, 147, 150, 153, 156, 159, 162, 164, 165, 168, 171, 174, 177, 180, 183, 186, 189, 192
Offset: 1

Views

Author

N. J. A. Sloane, Feb 05 2022

Keywords

Comments

A350629 divided by 2.

Crossrefs

A350958 Positive numbers k such that 2k cannot be written as 3^i (i >= 0) plus a prime.

Original entry on oeis.org

1, 18, 33, 39, 48, 60, 63, 72, 78, 81, 93, 102, 105, 108, 111, 138, 144, 150, 153, 162, 164, 165, 168, 171, 183, 186, 189, 198, 204, 207, 213, 219, 228, 237, 243, 249, 258, 264, 267, 270, 273, 276, 281, 288, 291, 303, 306, 312, 315, 318, 333, 336, 345, 348, 354, 357
Offset: 1

Views

Author

N. J. A. Sloane, Feb 05 2022

Keywords

Comments

A058517 halved.

Crossrefs

A256163 Odd numbers m such that for all 2^k < m the numbers m + 2^k, m - 2^k, m*2^k + 1, and m*2^k - 1 are composite, with k >= 1.

Original entry on oeis.org

1, 7913, 8923, 24943, 34009, 35437, 42533, 52783, 60113, 83437, 100727, 105953, 116437, 120521, 126631, 132211, 133241, 137171, 145589, 164729, 172331, 181645, 183671, 192173, 196633, 199513, 203069, 204013, 215113, 215279, 218503, 220523, 253519, 254329, 254587
Offset: 1

Views

Author

Arkadiusz Wesolowski, Mar 17 2015

Keywords

Crossrefs

Subsequence of A255967.
A256237 gives the primes.

Programs

  • Magma
    lst:=[]; for n in [1..254587 by 2] do t:=0; k:=0; while 2^k lt n do if IsPrime(n-2^k) or IsPrime(n+2^k) or IsPrime(n*2^k-1) or IsPrime(n*2^k+1) then t:=1; break; end if; k+:=1; end while; if IsZero(t) then Append(~lst, n); end if; end for; lst;
    
  • Mathematica
    q[m_] :=  If[EvenQ[m], False, Module[{pow = 2},While[pow < m && !PrimeQ[m - pow] && !PrimeQ[m + pow] && !PrimeQ[m * pow - 1] && !PrimeQ[m * pow + 1], pow *= 2]; pow > m]]; Select[Range[300000], q] (* Amiram Eldar, Jul 19 2025 *)
  • PARI
    for(n=1, 1e6, if(n%2==1, k=0; prim=0; while(2^k < n, if(ispseudoprime(n+2^k) || ispseudoprime(n-2^k) || ispseudoprime(n*2^k+1) || ispseudoprime(n*2^k-1), prim++; break({1})); k++); if(prim==0, print1(n, ", ")))) \\ Felix Fröhlich, Apr 01 2015

A263644 Odd numbers that are neither of the form p + 2^k nor of the form p - 2^k with k > 0, and p prime.

Original entry on oeis.org

30666137, 31210219, 52109063, 52504261, 55414847, 55876981, 57816799, 60097043, 63723707, 68748319, 79933129, 87747827, 88486403, 93034073, 104218883, 131873509, 138385817, 152485283, 155269609, 158241023, 165795677, 166441831, 177702619, 197903207
Offset: 1

Views

Author

Arkadiusz Wesolowski, Oct 22 2015

Keywords

Comments

Odd n such that for all k > 0 the numbers n + 2^k and n - 2^k are nonprimes.

Crossrefs

Cf. A006285, A076335, A076336. Subsequence of A255967. A263645 gives the primes.

Formula

A006285 INTERSECT A076336.

A133122 Odd numbers which cannot be written as the sum of an odd prime and 2^i with i > 0.

Original entry on oeis.org

1, 3, 127, 149, 251, 331, 337, 373, 509, 599, 701, 757, 809, 877, 905, 907, 959, 977, 997, 1019, 1087, 1199, 1207, 1211, 1243, 1259, 1271, 1477, 1529, 1541, 1549, 1589, 1597, 1619, 1649, 1657, 1719, 1759, 1777, 1783, 1807, 1829, 1859, 1867, 1927, 1969, 1973
Offset: 1

Views

Author

David S. Newman, Sep 18 2007

Keywords

Comments

The sequence of "obstinate numbers", that is, odd numbers which cannot be written as prime + 2^i with i >= 0 is the same except for the initial 3. - N. J. A. Sloane, Apr 20 2008
The reference by Nathanson gives on page 206 a theorem of Erdos: There exists an infinite arithmetic progression of odd positive integers, none of which is of the form p+2^k.
Essentially the same as A006285. - R. J. Mathar, Jun 08 2008

Examples

			The integer 7 can be represented as 2^2 + 3, therefore it is not on this list. - _Michael Taktikos_, Feb 02 2009
a(2)=127 because none of the numbers 127-2, 127-4, 127-8, 127-16, 127-32, 127-64 is a prime.
		

References

  • Nathanson, Melvyn B.; Additive Number Theory: The Classical Bases; Springer 1996
  • Clifford A. Pickover, A Passion for Mathematics, Wiley, 2005; see p. 62.

Crossrefs

Programs

  • Maple
    (Maple program which returns -1 iff 2n+1 is obstinate, from N. J. A. Sloane, Apr 20 2008): f:=proc(n) local i,t1; t1:=2*n+1; i:=0; while 2^i < t1 do if isprime(t1-2^i) then RETURN(1); fi; i:=i+1; end do; RETURN(-1); end proc;
  • Mathematica
    s = {}; Do[Do[s = Union[s, {Prime[n] + 2^i}], {n, 2, 200}], {i, 1, 10}]; Print[Complement[Range[3, 1000, 2], s]]
    zweier = Map[2^# &, Range[0,30]]; primes = Table[Prime[i], {i, 1, 300}]; summen = Union[Flatten[ Table[zweier[[i]] + primes[[j]], {i, 1, 30}, {j, 1, 300}]]]; us = Select[summen, OddQ[ # ] &]; odds = Range[1, 1001, 2]; Complement[odds, us] (* Michael Taktikos, Feb 02 2009 *)

Extensions

More terms and corrected definition from Stefan Steinerberger, Sep 24 2007
Edited by N. J. A. Sloane, Feb 12 2009 at the suggestion of R. J. Mathar

A188903 a(n) is the least power of 2 such that 2n+1 - a(n) is prime, or 0 if no such prime exists.

Original entry on oeis.org

0, 1, 2, 2, 2, 4, 2, 2, 4, 2, 2, 4, 2, 4, 16, 2, 2, 4, 8, 2, 4, 2, 2, 4, 2, 4, 16, 2, 4, 16, 2, 2, 4, 8, 2, 4, 2, 2, 4, 8, 2, 4, 2, 4, 16, 2, 4, 16, 8, 2, 4, 2, 2, 4, 2, 2, 4, 2, 4, 16, 8, 16, 16, 0, 2, 4, 2, 4, 64, 2, 2, 4, 8, 8, 0, 2, 2, 4, 8, 2, 4, 32, 2, 4, 2, 4, 16, 2, 4, 16, 2, 2, 4, 8, 8, 64, 2, 2, 4, 2, 2, 4, 8, 8, 16, 32, 2, 4, 128, 8, 64, 32, 2, 4, 2, 2, 4, 2, 4, 16, 2, 2, 4, 8, 8, 0, 2
Offset: 0

Views

Author

Michel Lagneau, Apr 13 2011

Keywords

Comments

The second Polignac's Conjecture states that every odd positive integer is the sum of a prime and a power of two. This conjecture was proved false, and the smallest counterexample is 127 because subtracting powers of 2 from 127 produces the composite numbers 126, 123, 119, 111, 95, and 63.
The sequence A006285 gives the odd numbers for which the conjecture fails. Hence, a(n) = 0 for n = (A006285(k)-1)/2 = {0, 63, 74, 125, 165, 168, 186, ...}.

Examples

			a(1) = 1 because 2*1 + 1 = 3 = 1 + 2 ;
a(2) = 2 because 2*2 + 1 = 5 = 2 + 3 ;
a(3) = 2 because 2*3 + 1 = 7 = 2 + 5 ;
a(63) = 0 ; a(74) = 0 ; a(125) = 0, ....
		

References

  • David Wells, Prime Numbers: The Most Mysterious Figures In Math, John Wiley & Sons, 2005, p. 175-176.

Crossrefs

Cf. A065381 (primes not of the form p + 2^k, p prime and k >= 0), A156695.

Programs

  • Maple
    with(numtheory):for n from 1 to 126 do:x:=2*n+1:id:=0:for k from 0 to 50 while(id=0)
      do: for q from 1 to 100 while(id=0) do: p:=ithprime(q): y:=2^k+p:if y=x then
      id:=1:printf(`%d, `,2^k):else fi:od:od:if id=0 then printf(`%d, `,0):else fi:od:
  • Mathematica
    Table[d = 2*n + 1; k = 1; While[k < d && ! PrimeQ[d - k], k = 2*k]; If[k < d, k, 0], {n, 0, 126}]
  • Sage
    def A188903(n):
        return next((2**k for k in (0..floor(log(2*n+1,2))) if is_prime(2*n+1-2**k)), 0)
    # D. S. McNeil, Apr 14 2011
Previous Showing 11-20 of 38 results. Next