OFFSET
1,1
COMMENTS
Conjectures: 1) for n >= 2, the sequence does not decrease; 2) for n > 1, a(n) is odd; 3) a(n) can be equal to a(n+1) only for twins: p_(n+1) - p_n = 2 (although there also exist twins for which a(n) < a(n+1)).
All these conjectures are proved using the formula a(n) = p_n - 2*floor(sqrt(2p_n)) + 2, n > 1. See also A145701 and A145714. - Vladimir Shevelev, Oct 18 2008
MAPLE
A145236 := proc(n) local p, k, a ; p := ithprime(n) ; for k from 1 do ceil(sqrt(ceil(k*p))) ; a := %^2-k*p ; if issqr(a) then return k ; end if; end do: end proc:
for n from 1 do printf("%d, \n", A145236(n)) ; end do: # R. J. Mathar, Aug 02 2010
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Oct 05 2008, Oct 07 2008
EXTENSIONS
a(12)=23 (not 21). - Vladimir Shevelev, Oct 16 2008
Extended by R. J. Mathar, Aug 02 2010
STATUS
approved