OFFSET
0,2
COMMENTS
All elements occur only finitely often.
LINKS
David A. Corneth, Table of n, a(n) for n = 0..9999
EXAMPLE
a(5) = 0 which gives a(1 * 4) = a(2 * 3) = 1 which give a(1 * 3) = 2 and a(2 * 4) = a(3 * 3) = 2.
PROG
(PARI) /* to get all elements up to n, have the program return v instead of v[n+1]; replace "; v[n+1]}" with "; v}". */
a(n) = {my(nn = max(6, n + isprime(n)), l1=listcreate(), l2 = listcreate(), v = vector(nn + 1, i , -1)); v[1]=1; v[6]=0; q = 1; listput(l1, 5);
while(#l1>0, for(i=1, #l1, u=min(l1[i] \ 2, ((l1[i] / 2) - sqrt(max(0, (l1[i] / 2) ^2 -nn))))\1; for(j=1, u, p=(l1[i] - j) * j; if(v[p+1] == -1, listput(l2, p); v[p + 1] = q))); l1 = l2; listsort(l1, 1); l2=listcreate(); q++); v[n+1]}
CROSSREFS
KEYWORD
nonn
AUTHOR
David A. Corneth, May 30 2015
STATUS
approved