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

A228033 Primes of the form 8^k + 5.

Original entry on oeis.org

13, 2787593149816327892691964784081045188247557, 15177100720513508366558296147058741458143803430094840009779784451085189728165691397
Offset: 1

Views

Author

Vincenzo Librandi, Aug 11 2013

Keywords

Comments

a(4) = 8^64655 + 5 = 1.919...*10^58389 is too large to include. - Amiram Eldar, Jul 23 2025

Crossrefs

Cf. A217355 (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), A182330 (k=5, h=2), 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), this sequence (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 [1..300] | IsPrime(a) where a is 8^n+5];
  • Mathematica
    Select[Table[8^n + 5, {n, 4000}], PrimeQ]

A296806 Take a prime, convert it to base 2, remove its most significant digit and its least significant digit and convert it back to base 10. Sequence lists primes that generate another prime by this process.

Original entry on oeis.org

13, 23, 31, 37, 43, 47, 59, 71, 79, 103, 127, 139, 151, 163, 167, 191, 211, 223, 251, 263, 271, 283, 331, 379, 463, 523, 547, 571, 587, 599, 607, 619, 631, 647, 659, 691, 719, 727, 739, 787, 811, 827, 839, 859, 907, 911, 967, 971, 991, 1031, 1039, 1051, 1063, 1087
Offset: 1

Views

Author

Paolo P. Lava, Paolo Iachia, Dec 21 2017

Keywords

Comments

From an idea of Ken Abbott (see link).
From Paolo Iachia, Dec 21 2017: (Start)
Let us call these numbers "core of a prime".
Let C(q) be the core of a prime q.
Then C(q) = (q - 2^floor(log_2(q)) - 1)/2.
Examples: C(59) = (59 - 2^5 - 1)/2 = 13; C(71) = (71 - 2^6 - 1)/2 = 3; C(73) = (73 - 2^6 - 1)/2 = 4; C(251) = (251 - 2^7 - 1)/2 = 61.
0 <= C(q) <= 2^(floor(log_2(q)) - 1) - 1. The minimum (0) occurs when q = 2^n+1, with n > 2. Example: 17 = 2^4+1, C(17) = (17 - 2^4 - 1)/2 = 0. The maximum is reached when q = 2^n-1 is a Mersenne prime. Example: 127 = 2^7 - 1, C(127) = (127 - 2^6 - 1)/2 = 31 = 2^5 - 1.
The last example is particularly interesting, as both the prime q and its core are Mersenne primes. The same holds for C(31) = 7 and for C(524247) = 131071, with 524247 = 2^19-1 and 131071 = 2^17-1, both Mersenne primes. Are there more such cases?
Note that the core of Mersenne number (prime or not) is a Mersenne number by definition. Counterexamples include C(8191) = 2047, with 8191 = 2^13 - 1, a Mersenne prime, but 2047 = 2^11 - 1 = 23*89, a Mersenne number not prime, and C(131071) = 32767 = 2^15 - 1 = 7*31*151, with 2 of its factors being Mersenne primes.
Primes whose binary expansion is of the form q = 1 0 ... 0 c_1 c_2 ... c_k 1 - with none or any number of consecutive 0's and with binary core c_1 c_2 ... c_k, k >= 0 - share the same core value. Let p = C(q), then we can write, in decimal form, q = (2p+1) + 2^n, for an appropriate n. While the property is true for p prime, it can be generalized to any positive integer.
Conjecture: for any positive integer p, there are infinitely many primes q for which there exists an integer n such that q-(2p+1) = 2^n. (End)

Examples

			13 in base 2 is 1101 and 10 is 2;
23 in base 2 is 10111 and 011 is 3;
31 in base 2 is 11111 and 111 is 7.
		

Crossrefs

Programs

  • Maple
    with(numtheory): P:=proc(q) local a,b,c,j,n,ok,x;  x:=5; for n from x to q do ok:=1; a:=convert(ithprime(n),base,2); b:=nops(a)-1; while a[b]=0 do b:=b-1; od; c:=0;
    for j from b by -1 to 2 do c:=2*c+a[j]; od;if isprime(c) then x:=n; print(ithprime(n)); fi; od; end: P(10^6);
    # simpler alternative:
    select(t -> isprime(t) and isprime((t - 2^ilog2(t) - 1)/2), [seq(i,i=3..10^4,2)]); # Robert Israel, Dec 28 2017
  • Mathematica
    Select[Prime[Range[200]],PrimeQ[FromDigits[Most[Rest[IntegerDigits[ #,2]]],2]]&] (* Harvey P. Dale, Jul 19 2020 *)
  • PARI
    lista(nn) = forprime(p=13, nn, if(isprime((p - 2^logint(p, 2) - 1)/2), print1(p, ", "))) \\ Iain Fox, Dec 28 2017
    
  • Python
    from itertools import islice
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        p = 7
        while True:
            if isprime(int(bin(p)[3:-1], 2)):
                yield p
            p = nextprime(p)
    print(list(islice(agen(), 54))) # Michael S. Branicky, May 16 2022

Formula

Primes q such that C(q) = (q - 2^floor(log_2(q)) - 1)/2 is prime too.

A156973 Primes of the form 2^k + 17.

Original entry on oeis.org

19, 8209, 2097169, 8589934609, 2417851639229258349412369, 680564733841876926926749214863536422929, 62165404551223330269422781018352605012557018849668464680057997111644937126566671941649
Offset: 1

Views

Author

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

Keywords

Examples

			19 = 2^1 + 17 is in the sequence;
8209 = 2^13 + 17 is in the sequence.
		

Crossrefs

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

Programs

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

Formula

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

Extensions

a(7) from Vincenzo Librandi, Apr 29 2010

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

A261078 Semiprimes p*q such that q = p + 2^k for some k >= 0.

Original entry on oeis.org

6, 15, 21, 33, 35, 57, 65, 77, 143, 161, 185, 201, 209, 221, 323, 377, 393, 437, 473, 497, 713, 899, 1073, 1457, 1517, 1529, 1577, 1763, 1769, 1841, 1961, 2021, 2537, 2993, 3233, 3473, 3497, 3599, 3713, 3737, 3953, 4553, 4601, 4757, 5183, 5561, 5609, 5753, 6497, 6557, 7217, 7313, 8633, 8777, 9593, 9797, 10001, 10265, 10403, 10841, 10961, 11009, 11021
Offset: 1

Author

Antti Karttunen, Sep 22 2015

Keywords

Comments

Terms ending with digit 5 (in decimal) are very rare, because terms of A123250 are rare.

Examples

			6 = 2*3 is present as 3 = 2 + 2^0.
15 = 3*5 is present as 5 = 3 + 2^1.
35 = 5*7 is present as 7 = 5 + 2^1.
		

Crossrefs

Cf. also A261073, A261077 (subsequences).

Programs

  • PARI
    A020639(n) = if(1==n,n,vecmin(factor(n)[, 1]));
    isA261078(n) = { my(d); if(bigomega(n)!=2, return(0), d = (n/A020639(n)) - A020639(n); (d && !bitand(d,d-1))); };
    i=0; n=0; while(i < 10000, n++; if(isA261078(n), i++; write("b261078.txt", i, " ", n)));
    
  • Scheme
    ;; With Antti Karttunen's IntSeq-library.
    (define A261078 (MATCHING-POS 1 1 (lambda (n) (and (= 2 (A001222 n)) (pow2? (- (A006530 n) (A020639 n)))))))
    (define (pow2? n) (and (> n 0) (zero? (A004198bi n (- n 1))))) ;; A004198bi implements bitwise-AND (Cf. A004198)

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

A123370 Primes of the form (2^n + 7)/3.

Original entry on oeis.org

3, 5, 13, 173, 699053, 3301173438094347399730997933, 15589350798196297794172638215640352209663280458413
Offset: 1

Author

Zak Seidov, Oct 12 2006

Keywords

Comments

Corresponding n's are 1,3,5,9,21,93 (all but n=3 are of the form n=4m+1, m=0,1,2,5,23...). Cf. A123250 = primes of the form 2^n + 5.

Crossrefs

Cf. A123250.

Programs

  • Mathematica
    Select[(2^Range[0,1000]+7)/3,PrimeQ] (* Harvey P. Dale, May 20 2013 *)

Extensions

a(7) from Harvey P. Dale, May 20 2013

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
Previous Showing 11-20 of 21 results. Next