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

A251966 Numbers representable as both b^c - b + c and x^y + x - y, where b, c, x, y are integers greater than 1.

Original entry on oeis.org

4, 14, 18, 27, 123, 256, 3125, 6556, 6566, 46656, 823543, 16777216, 387420489, 10000000000, 285311670611, 8916100448256, 95367431640610, 95367431640640, 302875106592253, 11112006825558016, 437893890380859375, 18446744073709551616, 827240261886336764177
Offset: 1

Views

Author

Alex Ratushnyak, Mar 21 2015

Keywords

Comments

A000312 except 1 is a subsequence.
Terms that are not in A000312: 14, 18, 123, 6556, 6566, 95367431640610, 95367431640640.
From Chai Wah Wu, May 18 2021: (Start)
Sequence is infinite.
If a, b > 1 and b^a+b == 0 mod a+1 then b^c-b+c is a term for c = ab(b^(a-1)+1)/(a+1), y = c/a, x = b^a.
If b > 1 and b <> 1 mod 3, then b^(2b(b+1)/3)+b(2b-1)/3 is a term.
If b > 2, then b^((b-1)(b^(b-2)+1))-b+(b-1)(b^(b-2)+1) is a term.
For a(n) with n > 1, either c>=3 or y>=3. If c=y=2, we get b^2-b+2=x^2+x-2, i.e.(x+b)(x-b+1) = 4.
Since x>1 and b>1 the only solution is x=b=2 which corresponds to the term a(1) = 4.
This allows for a faster search algorithm by assuming c>=3 and y>=3. The cases c=2 and y>=3 can be dealt with by picking y>=3 and solving for b in the quadratic equation b^2-b+2=x^y+x-y. Similarly for c>=3 and y=2.
(End)

Examples

			a(5) = 123 = 2^7 + 2 - 7 = 5^3 - 5 + 3.
		

Crossrefs

Programs

  • Mathematica
    Clear[b0, c0, x0, y0]; m = 100; max = 2^m; tb = Flatten[Table[b0[bc = b^c - b + c ] = b; c0[bc] = c; bc, {b, 2, m}, {c, 2, m}]]; tx = Flatten[Table[x0[xy = x^y + x - y] = x; y0[xy] = y; xy, {x, 2, m}, {y, 2, m}]]; inter = Intersection[Select[tb, # <= max &], Select[tx, # <= max &]]; Table[Print[n = inter[[k]], " b = ", b0[n], " c = ", c0[n], " x = ", x0[n], " y = ", y0[n]]; n, {k, Length[inter]}] (* Jean-François Alcover, Mar 23 2015 *)
  • Python
    TOP = 10000000
    a = [0]*TOP
    for y in range(2, TOP//2):
      if 2**y+2-y>=TOP: break
      for x in range(2, TOP//2):
        k = x**y+x-y
        if k>=TOP: break
        if k>=0: a[k]=1
    for y in range(2, TOP//2):
      if 2**y-2+y>=TOP: break
      for x in range(2, TOP//2):
        k = x**y-x+y
        if k>=TOP: break
        if k>=0: a[k]|=2
    print([n for n in range(TOP) if a[n]==3])
Showing 1-1 of 1 results.