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

A117417 Integer k such that 3^n + k = A117416(n).

Original entry on oeis.org

3, 1, 0, -1, 1, 4, 2, -1, -2, -4, -2, 2, -2, -1, 10, -2, 1, -4, 4, -2, -2, -2, -12, -4, 8, -2, -7, 2, -2, 8, 14, -5, 1, -4, -8, -4, 16, 6, -6, -2, 2, -8, -2, 12, -2, -5, -8, 10, -2, 4, -10, 40, 8, -10, 4, -2, -34, -2, 4, -20, -2
Offset: 0

Views

Author

Jonathan Vos Post, Mar 13 2006

Keywords

Comments

Distance from 3^n to the nearest semiprime. If there are two semiprimes at the same distance, take the negative k-value.
See also: A117405 Semiprime nearest to 2^n. A117387 Prime nearest to 2^n.

Examples

			a(0) = 3 because 3^0 + 3 = 4 = A001358(1) and no semiprime is closer to 3^0.
a(1) = 1 because 3^1 + 1 = 4 = A001358(1) and no semiprime is closer to 3^1.
a(2) = 0 because 3^2 + 0 = 9 = 3^2 = A001358(3), no semiprime is closer to 3^2 [this is the only 0 element].
a(3) = -1 because 3^3 - 1 = 26 = 2 * 13, no semiprime is closer.
a(4) = 1 because 3^4 + 1 = 82 = 2 * 41, no semiprime is closer.
a(5) = 4 because 3^5 + 4 = 247 = 13 * 19, no semiprime is closer.
		

Crossrefs

Formula

a(n) = Integer k such that 3^n + k = A117416(n). a(n) = A117416(n) - 3^n. a(n) = Min{k such that A001358(i) + k = 3^n}.

A117429 Semiprime nearest to 5^n. In case of a tie, choose the smaller.

Original entry on oeis.org

4, 4, 25, 123, 626, 3127, 15623, 78123, 390623, 1953122, 9765627, 48828127, 244140623, 1220703121, 6103515629, 30517578127, 152587890617, 762939453119, 3814697265623, 19073486328122, 95367431640623
Offset: 0

Views

Author

Jonathan Vos Post, Mar 14 2006

Keywords

Examples

			a(0) = 4 because 5^0 + 3 = 4 = A001358(1) and no semiprime is closer to 5^0.
a(1) = 4 because 5^1 - 1 = 4 = A001358(1) and no semiprime is closer to 5^1.
a(2) = 25 because 5^2 + 0 = 25 = A001358(9), no semiprime is closer to 5^2.
a(3) = 123 because 5^3 - 2 = 123 = 3 * 41 = A001358(42), no semiprime is closer.
a(4) = 626 because 5^4 + 1 = 626 = 2 * 313, no semiprime is closer.
a(5) = 3127 because 5^5 + 2 = 3127 = 53 * 59, no semiprime is closer.
a(6) = 15623 because 5^6 - 2 = 15623 = 17 * 919, no semiprime is closer.
a(7) = 78123 because 5^7 - 2 = 78123 = 3 * 26041, no semiprime is closer.
a(8) = 390623 because 5^8 - 2 = 390623 = 73 * 5351, no semiprime is closer.
a(9) = 1953122 because 5^9 - 3 = 1953122 = 2 * 976561, no semiprime is closer.
a(10) = 9765627 because 5^10 + 2 = 9765627 = 3 * 3255209, no semiprime closer.
		

Crossrefs

Cf. A117416 = Semiprime nearest to 3^n, A117405 = Semiprime nearest to 2^n, A117387 = Prime nearest to 2^n.

Programs

  • Maple
    nsp:= proc(n) uses numtheory; local k;
      if bigomega(n)=2 then return n fi;
      for k from 1 do
        if n-k > 0 and bigomega(n-k)=2 then return n-k fi;
        if bigomega(n+k)=2 then return n+k fi
      od
    end proc:
    seq(nsp(5^k),k=0..30); # Robert Israel, May 03 2018
  • Mathematica
    sp1[n_]:=Module[{k=0},While[PrimeOmega[n-k]!=2,k++];n-k]; sp2[n_]:= Module[ {k=1}, While[ PrimeOmega[n+k]!=2,k++];n+k]; Join[{4},Nearest[ {sp1[#], sp2[#]}, #][[1]]&/@(5^Range[20])] (* Harvey P. Dale, Aug 11 2019 *)

Formula

a(n) = 5^n + A117430(n).

Extensions

Edited by Robert Israel, May 03 2018

A117430 Integer k such that 5^n + k = A117429(n).

Original entry on oeis.org

3, -1, 0, -2, 1, 2, -2, -2, -2, -3, 2, 2, -2, -4, 4, 2, -8, -6, -2, -3, -2, -2, 4, 2, -6, -2, 4, 2, -3, 17, 9, -4, -8, -6, 12, 14, -2, -6, -8, -2, -6, 24, -2, 14, -6, -4, -18, -6, -3, -6, 16, -10, 16, -12, 12, -2, 16, 6, 16, -12, -2, -6, 12, -12, -8, -19, -6, 6, 24, -16, 4, 2, 16, -4, -8, -4, 16
Offset: 0

Views

Author

Jonathan Vos Post, Mar 14 2006

Keywords

Comments

(+/-) distance from 5^n to the nearest semiprime.
a(0)=3 and a(1)=-1 are the only terms == 3 (mod 4), as 5^n + 3 is divisible by 4. - Robert Israel, May 03 2018

Examples

			a(0) = 3 because 5^0 + 3 = 4 = A001358(1) and no semiprime is closer to 5^0.
a(1) = -1 because 5^1 - 1 = 4 = A001358(1) and no semiprime is closer to 5^1.
a(2) = 0 because 5^2 + 0 = 25 = A001358(9), no semiprime is closer to 5^2 [this is the only 0 element].
a(3) = -2 because 5^3 - 2 = 123 = 3 * 41 = A001358(42), no semiprime is closer.
a(4) = 1 because 5^4 + 1 = 626 = 2 * 313, no semiprime is closer.
a(5) = 2 because 5^5 + 2 = 3127 = 53 * 59, no semiprime is closer.
		

Crossrefs

Programs

  • Maple
    nsp:= proc(n) uses numtheory; local k;
      if bigomega(n)=2 then return n fi;
      for k from 1 do
        if n-k > 0 and bigomega(n-k)=2 then return n-k fi;
        if bigomega(n+k)=2 then return n+k fi
      od
    end proc:
    seq(nsp(5^n)-5^n, n=0..30); # Robert Israel, May 03 2018
  • Mathematica
    nsp[n_] := Module[{k}, If[PrimeOmega[n] == 2, Return[n]]; For[k = 1, True, k++, If[n-k > 0 && PrimeOmega[n-k] == 2, Return[n-k]]; If[PrimeOmega[n+k] == 2, Return[n+k]]]];
    a[n_] := a[n] = nsp[5^n] - 5^n;
    Table[Print[n, " ", a[n]]; a[n], {n, 0, 76}] (* Jean-François Alcover, Jul 23 2020, after Maple *)

Formula

a(n) = Integer k such that 5^n + k = A117429(n). a(n) = A117429(n) - 5^n. a(n) = Min{k such that A001358(i) + k = 5^n}.

Extensions

More terms from Robert Israel, May 03 2018
Showing 1-3 of 3 results.