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

A117406 Integer k such that 2^n + k = A117405(n).

Original entry on oeis.org

3, 2, 0, 1, -1, 1, 1, 1, -2, -1, 3, -1, 1, 1, -2, -3, -5, 1, -2, 1, 1, -3, 7, -1, 3, -3, 3, 3, 1, 6, -3, 1, 1, -3, -3, -3, -3, -1, 18, 3, 1, -1, 3, 1, -3, 3, 7, -9, 3, -1, 7, -5, 3, 11, -3, -5, 6, -9, -3, -1, -3, 1, -2, 9, 1, 5, 3, -1, -5, -13, 9, -3, -7, -3
Offset: 0

Views

Author

Jonathan Vos Post, Mar 13 2006

Keywords

Comments

After n=2, never again is a(n) = 0. Semiprime analog of A117388 Integer k such that 2^n + k = A117387(n). A117387(n) is prime nearest to 2^n. (In case of a tie, choose the smaller).

Examples

			a(0) = 3 because 2^0 + 3 = 4 = A001358(1) and no semiprime is closer to 2^0.
a(1) = 2 because 2^1 + 2 = 4 = A001358(1) and no semiprime is closer to 2^1.
a(2) = 0 because 2^2 + 0 = 4 = A001358(1) and no semiprime is closer to 2^2.
a(3) = 1 because 2^3 + 1 = 9 = 3^2 = A001358(3), no semiprime is closer to 2^3.
a(4) = -1 because 2^4 - 1 = 15 = 3 * 5 and no semiprime is closer.
a(5) = 1 because 2^5 + 1 = 33 = 3 * 11 and no semiprime is closer to 2^5.
a(6) = 1 because 2^6 + 1 = 65 = 5 * 13 and no semiprime is closer to 2^6.
a(7) = 1 because 2^7 + 1 = 129 = 3 * 43 and no semiprime is closer to 2^7.
a(8) = -2 because 2^8 - 2 = 254 = 2 * 127 and no semiprime is closer to 2^8.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Catch@Block[{p = 2^n, k = 0}, While[True, If[p > k && PrimeOmega[p - k] == 2, Throw[-k]]; If[PrimeOmega[p + k] == 2, Throw[k]]; k++]]; a /@ Range[0, 80] a /@ Range[0, 80] (* Giovanni Resta, Jun 15 2016 *)

Formula

a(n) = A117405(n) - 2^n. a(n) = Min{k such that A001358(i) + k = 2^j}.

Extensions

Corrected and extended by Giovanni Resta, Jun 15 2016

A113762 Numbers n with nonzero digits in their decimal representation such that when all numbers formed by inserting the exponentiation symbol between any two digits are added up, the sum is prime.

Original entry on oeis.org

21, 31, 51, 71, 121, 142, 161, 162, 164, 181, 211, 237, 326, 343, 412, 416, 456, 491, 494, 612, 616, 726, 817, 929, 1226, 1228, 1427, 1513, 1622, 1776, 1824, 1828, 1911, 1915, 1975, 2127, 2188, 3716, 5265, 6276, 6321, 6491, 6852, 7739, 14423, 14487, 15297, 16159
Offset: 1

Views

Author

Ray G. Opao, Jan 18 2006

Keywords

Examples

			a(6) = 142 because 1^42+14^2 = 197, which is prime.
		

Crossrefs

Cf. A117388.

Programs

  • Mathematica
    lst = {}; Do[ If[ Min@ IntegerDigits@n > 0, a=0; p=10; While[(w = Floor[n/p]) > 0, a += w^ Mod[n, p]; p*=10]; If[PrimeQ[a], Print[{n, a}]; AppendTo[lst, n]]], {n, 11, 9999}]; lst
  • Python
    from sympy import isprime
    from itertools import count, islice, product
    def agen():
        for d in count(2):
            for p in product("123456789", repeat=d):
                s = "".join(p)
                if isprime(sum(int(s[:i])**int(s[i:]) for i in range(1, d))):
                    yield int(s)
    print(list(islice(agen(), 44))) # Michael S. Branicky, Jun 27 2022

Extensions

More terms from Giovanni Resta, Jan 19 2006
More terms from Robert G. Wilson v, Apr 27 2006
a(47) and beyond from Michael S. Branicky, Jun 27 2022
Showing 1-2 of 2 results.