OFFSET
0,3
COMMENTS
Index of first occurrence of n in A077773 if there is any, otherwise -1. - Rainer Rosenthal, Jul 07 2023
LINKS
Hugo Pfoertner, PARI program for calculating a single term, Jul 2023.
Rainer Rosenthal, Illustrating a(5) = 7.
Rainer Rosenthal, First terms of A363763 illustrated.
FORMULA
If a(n) != -1, then a(n) >= n/2. - Chai Wah Wu, Jun 22 2023
a(n) < (n+1)^2/2. - Jon E. Schoenfield and Chai Wah Wu, Jun 24-26 2023
EXAMPLE
From Rainer Rosenthal, Jul 09 2023: (Start)
a(46) = -1, since a(46) < ((46+1)^2)/2 < 1105 and A077773(k) != 46 for all k < 1105.
See illustrations in the links section. (End)
PROG
(PARI) \\ a4018(n) after Michael Somos
a4018(n) = if( n<1, n==0, 4 * sumdiv( n, d, (d%4==1) - (d%4==3)));
a363763 (upto) = {for (n=0, upto, my(kfound=-1); for (k=0, (n+1)^2\2+1, my(kp=k^2+1, km=(k+1)^2-1, m=0); for (j=kp, km, if (a4018(j), m++); if (m>n, break)); if (m==n, kfound=k; break)); print1 (kfound, ", "); )};
a363763(75)
(Python)
from sympy import factorint
def A363763(n):
for k in range(n>>1, ((n+1)**2<<1)+1):
c = 0
for m in range(k**2+1, (k+1)**2):
if all(p==2 or p&3==1 or e&1^1 for p, e in factorint(m).items()):
c += 1
if c>n:
break
if c==n:
return k
return -1 # Chai Wah Wu, Jun 20-26 2023
CROSSREFS
KEYWORD
sign
AUTHOR
Hugo Pfoertner, Jun 20 2023
STATUS
approved