A075789 Value of i, when n is written as r^i - s^j with the smallest possible r^i (with minimal i) and r, s > 0, i, j > 1; or 0 if n is not of this form.
2, 3, 2, 3, 2, 0, 3, 2, 2, 3, 3, 2, 2, 0, 2, 2, 2, 3, 3, 2, 2, 2, 3, 2, 3, 3, 2, 5, 2, 2, 5, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 0, 2, 3, 2, 2, 7, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 3, 0, 2, 2, 2, 0, 2, 2, 2, 0, 2, 2, 2, 5, 2, 3, 2, 0, 7, 2, 2, 0, 2, 2, 2, 0, 2, 2, 2, 0, 2, 2, 3, 2, 2, 2, 2, 3, 2, 3, 7, 0, 7, 2, 2
Offset: 1
Keywords
Examples
1 = 3^2 - 2^3, 2 = 3^3 - 5^2, 3 = 2^2 - 1^2, 4 = 2^3 - 2^2, etc. a(10) = 3 because 10 = 13^3 - 3^7.
Programs
-
PARI
a(n,LIM=999*n)=for(k=1,LIM,(ispower(k)||k==1)&&ispower(n+k)&&return(factor(ispower(n+k))[1,1])) \\ M. F. Hasler, May 29 2018
Extensions
More terms from David Wasserman, Jan 23 2005
Edited and data double-checked with given PARI code by M. F. Hasler, May 29 2018
Comments