OFFSET
1,1
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)
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..30
EXAMPLE
a(5) = 123 = 2^7 + 2 - 7 = 5^3 - 5 + 3.
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 *)
PROG
(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])
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Mar 21 2015
STATUS
approved