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 21-30 of 33 results. Next

A156983 Primes of the form 2^k + 21.

Original entry on oeis.org

23, 29, 37, 53, 149, 277, 2069, 32789, 65557, 524309, 17592186044437, 281474976710677, 2251799813685269, 4503599627370517, 2305843009213693973, 11692013098647223345629478661730264157247460343829
Offset: 1

Views

Author

Edwin Dyke (ed.dyke(AT)btinternet.com), Feb 20 2009

Keywords

Examples

			23 = 2^1 + 21 is in the sequence; 29 = 2^3 + 21 is in the sequence.
		

Crossrefs

Cf. A000040, A019434 (2^(2^k) + 1), A057201, A057733 (2^k + 3), A123250 (2^k + 5).

Programs

  • Magma
    [ a: n in [1..200] | IsPrime(a) where a is 2^n+21 ]; // Vincenzo Librandi, Nov 27 2010
  • Mathematica
    Delete[Union[Table[If[PrimeQ[2^n + 21], 2^n + 21, 0], {n, 1, 500}]],1]

Formula

a(n) = 2^A057201(n) + 21. - Elmo R. Oliveira, Nov 08 2023

Extensions

More terms from Vincenzo Librandi, Apr 29 2010

A197918 Pythagorean primes p such that for all primes q < p, p XOR q is not equal to p - q.

Original entry on oeis.org

2, 5, 17, 41, 73, 97, 137, 193, 257, 521, 577, 641, 1033, 1153, 2081, 2113, 4129, 7681, 8353, 8737, 9281, 10369, 10753, 12289, 16417, 17921, 18433, 21569, 25601, 32801, 32833, 36353, 37889, 38921, 39041, 40961, 50177, 53377, 65537, 131617, 133121, 136193, 139273, 139297, 139393, 147457, 163841
Offset: 1

Views

Author

Brad Clardy, Oct 24 2011

Keywords

Comments

It is conjectured that with the exception of the first three terms (2,5,17) all of the terms are a subset of all primes p such that p XOR 22 = p + 22.
If the inequality in the definition is replaced with equality the result are the Mersenne primes A000668, which is equivalent to for all primes q

This sequence is apparently a subset of A081091 Primes of the form 2^i + 2^j + 1, i>j>0, with the added conditions that j <> 1 or 2, and if j can be written as 2n then i cannot be 2n+1. This removes A123250 Primes of form 2^n + 5 (or 2^n + 2^2 +1) for n>0, primes from A140660 3*4^n + 1 (or 2^(2n+1) + 2^(2n) + 1) for n>0, and A057733 Primes of form 2^n + 3 (2^n + 2^1 + 1) for n>1.

Examples

			5 is a Pythagorean prime (1^2 + 2^2) and a member since ((5 XOR 2) <> (5 - 2)) and ((5 XOR 3) <> (5 - 3)).
13 is a Pythagorean prime (2^2 + 3^2) however it is not a member because 5, a prime less than 13, (13 XOR 5) = (13 - 5).
		

Programs

  • Magma
    XOR := func;
    i:=0; k:=0; pn:=0;
    for n:= 5 to 10000 by 4 do
           if IsPrime(n)  then  pn:=n;  end if;
           if (pn eq n) then k:=0;
               for j in [2 .. n-2] do
                    if IsPrime(j)  then pj:=j;
                         if (XOR(pn,pj) ne pn-pj) then i+:=1;
                             else k+:=1;
                         end if;
                    end if;
               end for;
           end if;
           if ((i ne 0) and (k eq 0))  then pn; end if;
           i:=0; k:=0;
    end for;
    
  • PARI
    forprime(p=2,1e6,if(p%4-3==0,next);forprime(q=2,p-1,if(bitxor(p,q)==p-q, next(2)));print1(p", ")) \\ Charles R Greathouse IV, Jul 31 2012

A228028 Primes of the form 5^n + 4.

Original entry on oeis.org

5, 29, 15629, 9765629
Offset: 1

Author

Vincenzo Librandi, Aug 11 2013

Keywords

Crossrefs

Cf. A124621 (associated n).
Cf. Primes of the form k^n + h: A092506 (k=2, h=1), A057733 (k=2, h=3), A123250 (k=2, h=5), A104066 (k=2, h=7), A104070 (k=2, h=9), A057735 (k=3, h=2), A102903 (k=3, h=4), A102870 (k=3, h=8), A102907 (k=3, h=10), A290200 (k=4, h=1), A228027 (k=4, h=9), A182330 (k=5, h=2), this sequence (k=5, h=4), A228029 (k=5, h=6), A102910 (k=5, h=8), A182331 (k=6, h=1), A104118 (k=6, h=5), A104115 (k=6, h=7), A104065 (k=7, h=4), A228030 (k=7, h=6), A228031 (k=7, h=10), A228032 (k=8, h=3), A228033 (k=8, h=5), A144360 (k=8, h=7), A145440 (k=8, h=9), A228034 (k=9, h=2), A159352 (k=10, h=3), A159031 (k=10, h=7).

Programs

  • Magma
    [a: n in [0..200] | IsPrime(a) where a is  5^n+4];
  • Mathematica
    Select[Table[5^n + 4, {n, 0, 200}], PrimeQ]

Extensions

Corrected cross-references - Robert Price, Aug 01 2017

A286843 Even k such that k - A001065(k) = 2^m (for some m > 0).

Original entry on oeis.org

10, 14, 22, 38, 44, 92, 110, 130, 134, 136, 152, 170, 184, 248, 250, 262, 284, 376, 410, 442, 632, 730, 752, 884, 988, 1012, 1052, 1276, 1292, 1370, 1628, 2144, 2168, 2272, 2332, 2528, 3068, 4064, 4124, 5210, 6112, 6364, 6556, 7372, 8198, 8312, 8384, 8648
Offset: 1

Author

XU Pingya, Aug 01 2017

Keywords

Comments

Tianxin Cai conjectured that the sequence is infinite.
When p is prime, A001065(2p) = 1 + 2 + p = 3 + p. 2p - A001065(2p) = 2^m iff 2^m + 3 = p. Therefore if A057733 is infinite, Cai's conjecture is correct.
In general, for j = 2, 3, ..., if the number of primes of the form 2^m + 2^j - 1 is infinite, then Cai's conjecture is correct.
When 2^p - 1 is prime, let k = 2^p*(2^p - 1). A001065(k) = 1 + 2 + 2^2 + ... + 2^p + 2^p - 1 + 2(2^p - 1) + 2^2*(2^p - 1) + ... + 2^(p - 1)*(2^p - 1) = 2^(p + 1) - 1 + (2^p - 1)^2 = 2^(2p). k - A001065(k) = -2^p. Therefore if the number of Mersenne primes (A000668) is infinite, then there are infinitely many even k such that k - A001065(k) = -2^p.

Examples

			10 is a term as 10 - A001065(10) = 10 - 8 = 2.
22 is a term as 22 - A001065(22) = 22 - 14 = 2^3.
		

Crossrefs

Programs

  • Mathematica
    Select[Table[2n, {n, 1, 5000}], DivisorSigma[1, 2# - DivisorSigma[1, #]] + 1 == 2(2# - DivisorSigma[1, #]) > 2 &] (* or *)
    Select[2 Range[5000], IntegerQ@ Log2[2 # - DivisorSigma[1,#]] && !IntegerQ@ Log2@ # &] (* Giovanni Resta, Aug 07 2017 *)
  • PARI
    ispower2(n) = n > 1 && n >> valuation(n, 2) == 1;
    is(n) = !(n%2) && ispower2(2*n - sigma(n)); \\ Amiram Eldar, Mar 22 2024

A156974 Primes of the form 2^k + 29.

Original entry on oeis.org

31, 37, 61, 157, 541, 8221, 32797, 131101, 8388637, 134217757, 8589934621, 137438953501, 8796093022237, 9223372036854775837, 590295810358705651741, 9444732965739290427421, 604462909807314587353117, 618970019642690137449562141, 166153499473114484112975882535043101, 170141183460469231731687303715884105757, 883423532389192164791648750371459257913741948437809479060803100646309917
Offset: 1

Author

Edwin Dyke (ed.dyke(AT)btinternet.com), Feb 19 2009

Keywords

Crossrefs

Cf. A057733 (2^k+3), A123250 (2^k+5), A104066 (2^k+7), A156940 (2^k+11).

Programs

  • Magma
    [a: n in [0..300] | IsPrime(a) where a is 2^n+29 ]; // Vincenzo Librandi, Nov 27 2010
  • Maple
    a := proc (n) if isprime(2^n+29) = true then 2^n+29 else end if end proc: seq(a(n), n = 1 .. 110); # Emeric Deutsch, Mar 14 2009
  • Mathematica
    Delete[Union[Table[If[PrimeQ[2^n + 29], 2^n + 29, 0], {n, 1, 500}]],1]

Formula

a(n) = 2^A156982(n) + 29. - Elmo R. Oliveira, Nov 08 2023

Extensions

More terms from Emeric Deutsch, Mar 14 2009
More terms from Vincenzo Librandi, Nov 27 2010

A193109 Least k such that 2^x + k produces primes for x=1..n and composite for x=n+1.

Original entry on oeis.org

0, 1, 9, 3, 225, 15, 65835, 1605, 19425, 2397347205, 153535525935
Offset: 1

Author

Arkadiusz Wesolowski, Jul 21 2011

Keywords

Comments

All terms except the first four are congruent to 15 mod 30.
a(10) was found in 2005 by T. D. Noe and a(11) was found in the same year by Don Reble.
Other known values: a(13) = 29503289812425.
a(12) > 10^13. - Tyler Busby, Feb 19 2023

Crossrefs

Another version of A110096.

Programs

  • Mathematica
    Table[k = 0; While[i = 1; While[i <= n && PrimeQ[2^i + k], i++]; i <= n || PrimeQ[2^i + k], k++]; k, {n, 9}] (* T. D. Noe, Jul 21 2011 *)
  • PARI
    is(k, n) = for(x=1, n, if(!isprime(k+2^x), return(0))); 1;
    a(n) = {my(s=2); forprime(p=3, n, if(znorder(Mod(2, p))==(p-1), s*=p)); forstep(k=s*(n>1)/2, oo, s, if(is(k, n) && !isprime(k+2^(n+1)), return(k))); } \\ Jinyuan Wang, Jul 30 2020

A229222 Smallest prime p such that p contains a digit larger than 1 and the sum of the n-th powers of the decimal digits of p is a prime number.

Original entry on oeis.org

2, 23, 113, 23, 191, 223, 191, 41, 223, 113, 157, 191, 137, 113, 113, 43, 137, 191, 179, 337, 577, 223, 227, 113, 263, 113, 199, 229, 263, 199, 467, 89, 223, 179, 223, 113, 443, 683, 1279, 337, 661, 463, 827, 2281, 577, 223, 223, 661, 137, 229, 11399, 461, 577
Offset: 1

Author

Michel Lagneau, Sep 16 2013

Keywords

Comments

We impose the condition that p is not in A020449 in order to avoid trivial sequences with infinite repetitions with the numbers 11 if p>1, or 101 if p>11, or 101111 if p > 101, ... for example if p > 1 the sequence is {2, 11, 11, 11, ...}, if p > 11 the sequence is {23, 23, 101, 23, 101, 101, 41, 101, 101, 101, 101, 101, ...}.
a(n) is an unification of a family of sequences mentioned hereafter:
A082101: primes of the form 2^n+3^n => 23 is in the sequence;
A057735: primes of the form 3^n+2 => 113 is in the sequence;
A153133: primes of the form 2^n+3^(n-1) => 223 is in the sequence;
A228034: primes of the form 9^n+2 => 191 is in the sequence;
A057733: primes of the form 2^n+3 => 2111 is in the sequence;
A228026: primes of the form 4^n+3 => 4111 is in the sequence;
A228034: primes of the form 9^n+2 => 191 is in the sequence;
A182330: primes of the form 5^n+2 => 151 is in the sequence;
A111974: primes of the form 2*3^n+1 => 313 is in the sequence;
A102903: primes of the form 3^n+4 => 11113 is in the sequence.
In this sequence, we observe repetitions of numbers such that 23, 113, 223, 191, 199, 223,... and this problem is very difficult, because it is probable that there exists both finite and infinite repetitions according to the numbers: for example, if we consider the number 23 of this sequence, it is probable that the number of element "23" is finite (see the comment in A082101 for the primes of form 2^k + 3^k). But, if we consider the number 113 of this sequence, is the number of the elements "113" infinite ? (see A057735 with the primes of the form 2+3^n). We observe that a(n) = 113 for n = 3, 14, 15, 24, 26,..., 123, 126, 139,..., 386, 391, 494, ....

Examples

			a(3) = 113 because 1^3+1^3+3^3 = 29 is prime.
		

Crossrefs

Cf. A020449.

Programs

  • Maple
    with(numtheory) :lst:={11, 101, 101111, 10011101, 10101101, 10110011, 10111001, 11000111, 11100101, 11110111, 11111101 }:for n from 1 to 300 do :ii:=0:for k from 1 to 10^8 while(ii=0) do:x:=convert(k,base,10):n1:=nops(x):it:=0:jj:=0:s:= sum('x[i]^n', 'i'=1..n1):lst1:={k} intersect lst:if type(k,prime)=true and type(s,prime)=true and (lst1<>{k}) then ii:=1: printf(`%d, `,k):else fi:od:od:
  • Mathematica
    Table[p = 2; While[d = IntegerDigits[p]; Union[d][[-1]] < 2 || ! PrimeQ[Total[d^n]],  p = NextPrime[p]]; p, {n, 60}]
  • PARI
    a(n)=forprime(p=2,,my(d=digits(p)); if(vecmax(d)>1 && isprime(sum(i=1,#d,d[i]^n)), return(p))) \\ Charles R Greathouse IV, Sep 19 2013

A267413 Dropping any binary digit gives a prime number.

Original entry on oeis.org

6, 7, 11, 15, 35, 39, 63, 135, 255, 999, 2175, 8223, 16383, 57735, 131075, 131079, 262143, 524295, 1048575, 536870919, 1073735679, 2147483655, 4294967295, 17179770879, 4260641103903, 4611686018427387903, 4720069647059686260735, 1237940039285380274899124223
Offset: 1

Author

Stanislav Sykora, Jan 14 2016

Keywords

Comments

This is the binary analog of A034895. The sequence contains mostly numbers with very few binary digit runs (BDR, A005811). Those with one BDR are of the type 2^k-1, such that 2^(k-1)-1 is a Mersenne prime (A000668). Vice versa, if M is any Mersenne prime, then 2*M+1 is a term. The number 6 is the only term with an even number of BDRs. There are many terms with 3 BDRs. The first term with 5 BDRs is 57735. The next terms with at least 5 BDRs (if they exist at all) are larger than 10^10. So far, I could test that a(24) > 10^10.
From Robert Israel, Jan 14 2016: (Start)
For n >= 2, a(n) == 3 (mod 4).
2^k+3 is in the sequence if 2^(k-1)+1 and 2^(k-1)+3 are primes, i.e., 2^(k-1)+1 is in the intersection of A019434 and A001359. The only known terms of the sequence in this class are 7, 11, 35, 131075.
2^k+7 is in the sequence if 2^(k-1)+3 and 2^(k-1)+7 are primes: thus 2^(k-1)+3 is in A057733 and 2^(k-1)+7 is in A104066. Terms of the sequence in this class include 15, 39, 135, 131079, 524295, 536870919, 2147483655 (but no more for k <= 2000).
(End)
a(25) > 2^38. - Giovanni Resta, Apr 10 2016
For n > 1, a(n) = 2p+1 for some prime p. - Chai Wah Wu, Aug 27 2021
From Bert Dobbelaere, Aug 07 2023: (Start)
There are no more terms with an odd number of binary digits: from any number having an odd number of binary digits, one can always drop a digit and obtain a multiple of 3. Numbers of the form 2^k+3 (k even and k > 2) cannot be terms because 2^(k-1)+1 is a multiple of 3.
(End)

Examples

			Decimal and binary forms of the known terms:
   1           6                                110
   2           7                                111
   3          11                               1011
   4          15                               1111
   5          35                             100011
   6          39                             100111
   7          63                             111111
   8         135                           10000111
   9         255                           11111111
  10         999                         1111100111
  11        2175                       100001111111
  12        8223                     10000000011111
  13       16383                     11111111111111
  14       57735                   1110000110000111 <--- (a binary palindrome
  15      131075                 100000000000000011       with 5 digit runs)
  16      131079                 100000000000000111
  17      262143                 111111111111111111
  18      524295               10000000000000000111
  19     1048575               11111111111111111111
  20   536870919     100000000000000000000000000111
  21  1073735679     111111111111111110011111111111
  22  2147483655   10000000000000000000000000000111
  23  4294967295   11111111111111111111111111111111
  24 17179770879 1111111111111111100111111111111111
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local B,k,y;
       if not isprime(floor(n/2)) then return false fi;
       B:= convert(n,base,2);
       for k from 2 to nops(B) do
         if B[k] <> B[k-1] then
           y:= n mod 2^(k-1);
           if not isprime((y+n-B[k]*2^(k-1))/2) then return false fi
         fi
       od;
       true
    end proc:
    select(filter, [6, seq(i,i=7..10^6,4)]); # Robert Israel, Jan 14 2016
  • Mathematica
    Select[Range[2^20], AllTrue[Function[w, Map[FromDigits[#, 2] &@ Drop[w, {#}] &, Range@ Length@ w]]@ IntegerDigits[#, 2], PrimeQ] &] (* Michael De Vlieger, Jan 16 2016, Version 10 *)
  • PARI
    DroppingAnyDigitGivesAPrime(N,b) = {
    \\ Property-testing function; returns 1 if true for N, 0 otherwise
    \\ Works with any base b. Here used with b=2.
      my(k=b,m); if(N=(k\b), m=(N\k)*(k\b)+(N%(k\b));
        if ((m<2)||(!isprime(m)),return(0)); k*=b);
      return(1);
    }
    
  • Python
    from sympy import isprime
    def ok(n):
        if n < 7 or n%4 != 3: return n == 6
        b = bin(n)[2:]
        return all(isprime(int(b[:i]+b[i+1:], 2)) for i in range(len(b)))
    print(list(filter(ok, range(2, 2**20)))) # Michael S. Branicky, Jun 07 2021

Extensions

a(24) from Giovanni Resta, Apr 10 2016
a(25)-a(28) from Bert Dobbelaere, Aug 07 2023

A172183 a(n) is the smallest prime of the form p^q+n, where p and q are prime, or zero if no such prime exists.

Original entry on oeis.org

5, 11, 7, 13, 13, 31, 11, 17, 13, 19, 19, 37, 17, 23, 19, 41, 8209, 43, 23, 29, 29, 31, 31, 73, 29, 53, 31, 37, 37, 79, 0, 41, 37, 43, 43, 61, 41, 47, 43, 67, 73, 67, 47, 53, 53, 71, 79, 73, 53, 59, 59, 61, 61, 79, 59, 83, 61, 67, 67, 109, 0, 71, 67, 73, 73, 191, 71, 193, 73, 79
Offset: 1

Author

Cheng Zhang (cz1(AT)rice.edu), Jan 28 2010, Mar 02 2010

Keywords

Comments

If n mod 6 = 1, both p and q must be 2, and a(n)=0 if n + 4 is not a prime. The values of a(n) for n=257,297,353,383,557 are either greater than 176 000 or 0. Several large entries: a(87) = 2^25633 + 87, a(717) = 2^3217 + 717, a(773) = 2^2539 + 773, a(927) = 2^1117 + 927.

Examples

			a(1)=5 because 5=2^2+1 is the smallest prime of the form p^q+1. a(2)=11 because 11=3^2+2. a(3)=7, because 7=2^2+3. a(17)=8209, because 8209=2^13+17. a(31)=0, because p^q+31 cannot be a prime.
		

Programs

  • Mathematica
    For[l = {}; n = 1, n <= 70, n++, found = False; If[Mod[n, 2] == 0, For[rm = Infinity; i = 1, i < 100, i++, For[j = 1, j < 100, j++, p = Prime[i]; q = Prime[j]; r = p^q + n; If[r >= rm, Break[], If[PrimeQ[r], rm = r; found = True]]; ]; ], (* if n is odd, r=2^q+n *) If[Mod[n, 6] == 1, r = 4 + n; If[PrimeQ[r], found = True], For[j = 1, j < 1000, j++, q = Prime[j]; r = 2^q + n; If[PrimeQ[r], found = True; rm = r; Break[]]; ]; ]; ]; If[ ! found, rm = 0]; l = Append[l, rm]; ]; l

A238739 Numbers n such that 2^n + 3 and 3*2^n + 1 are both prime.

Original entry on oeis.org

1, 2, 6, 12, 18, 30
Offset: 1

Author

Juri-Stepan Gerasimov, Mar 04 2014

Keywords

Comments

Intersection of A057732 and A002253. - Joerg Arndt, Mar 04 2014
By checking primality of 2^n+3 for values n in A002253, it follows a(7) > 7033641. - Giovanni Resta, Mar 08 2014
Exponents of second Fermat prime pairs. - Juri-Stepan Gerasimov, Mar 08 2014
From Juri-Stepan Gerasimov, Mar 04 2014: (Start)
If prime pair {2^n + (2k+1), (2k+1)*2^n + 1} is called a Fermat prime pair, then numbers n such that 2^n + (2k + 1) and (2k + 1)*2^n + 1 are both prime:
for k = 0: 0, 1, 2, 4, 8, 16, ... the exponents first Fermat prime pairs;
for k = 1: 1, 2, 6, 12, 18, 30, ... the exponents second Fermat prime pairs;
for k = 2: 1, 3, ... the exponents third Fermat prime pairs;
for k = 3: 2, 4, 6, 20, 174, ... the exponents fourth Fermat prime pairs;
for k = 4: 1, 2, 3, 6, 7, ... the exponents fifth Fermat prime pairs;
for k = 5: 1, 3, 5, 7, ... the exponents sixth Fermat prime pairs;
for k = 6: 2, 8, 20, ... the exponents seventh Fermat prime pairs;
for k = 7: 1, 2, 4, 10, 12, ... the exponents eighth Fermat prime pairs;
for k = 8:
for k = 9: 6, ... the exponents tenth Fermat prime pairs;
for k = 10: 1, 4, 5, 7, 16, ... the exponents eleventh Fermat prime pairs;
for k = 11:
for k = 12: 2, 4, 6, 10, 20, 22, ...the exponents thirteenth Fermat prime pairs;
for k = 13: 2, 4, 16, 40, 44, ... the exponents fourteenth Fermat prime pairs;
for k = 14: 1, 3, 5, 27, 43, ... the exponents fifteenth Fermat prime pairs.
Semiprimes of the form (2^m+2k+1)*((2k+1)*2^m+1): 4, 9, 25, 35, 77, 91, 209, 289, 319, 481, 527, 533, 901, 989, ...
(End)

Examples

			a(1) = 1 because 2^1 + 3 = 5 and 3*2^1 + 1 = 7 are both prime,
a(2) = 2 because 2^2 + 3 = 7 and 3^2^2 + 1 = 13 are both prime,
a(3) = 6 because 2^6 + 3 = 67 and 3*2^6 + 1 = 193 are both prime.
		

Programs

  • Magma
    [n: n in [0..30] | IsPrime(2^n+3) and IsPrime(3*2^n+1)]; // Arkadiusz Wesolowski, Jan 23 2016
  • Mathematica
    Select[Range[30],AllTrue[{2^#+3,3*2^#+1},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Aug 08 2015 *)
  • PARI
    isok(n) = isprime(2^n + 3) && isprime(3*2^n + 1); \\ Michel Marcus, Mar 04 2014
    
Previous Showing 21-30 of 33 results. Next