login
A389751
Numbers k such that k^3 can be represented as the sum of k consecutive nonprimes.
3
1, 3, 9, 11, 17, 27, 35, 73, 163, 233, 433, 1044, 1723, 2477, 3474, 28388, 177493, 497393
OFFSET
1,2
COMMENTS
This may also be expressed as numbers k such that there exists a string of k consecutive nonprimes with a mean value of k^2.
EXAMPLE
a(1) = 1^3 = 1;
a(2) = 3^3 = 8+9+10;
a(3) = 9^3 = 76+77+78+80+81+82+84+85+86.
PROG
(PARI) \\ returns first nonprime in matching string, otherwise 0
is_a389751(n) = {my(m=n^2, t=n^3, k=0, cl, ch); if(n==1, return(1)); forcomposite(c=m, oo, k++; if(k==n, ch=c; break)); cl=2*m-ch; while( abs(ch-cl)>1 , my(cstart=(cl+ch)\2, s=0, k=0); forcomposite(c=cstart, oo, s+=c; k++; if(k==n, break)); if(s<t, cl=cstart, if(s==t, return(cstart+isprime(cstart)), ch=cstart))); 0}; \\ Hugo Pfoertner, Nov 11 2025
(Python)
from sympy import isprime
n, k = 1, 0
while True:
k+=1 ; l, r, s, k2 = 0, 0, 0, k**2
for c in range(1, k):
if s<0: r += 2 if isprime(k2+r+1) else 1 ; s+=r
else: l += 2 if isprime(k2-l-1) else 1 ; s-=l
if s==0: print("A389751(%d) = %d ; A390586(%d) = %d"%(n, k, n, k2-l)) ; n+=1
# Bert Dobbelaere, Nov 12 2025
CROSSREFS
A390586 gives the start of the strings of nonprimes.
Cf. A018252 (nonprimes).
Cf. A390584 (similar for squares).
Sequence in context: A062227 A111324 A107073 * A227245 A173394 A111211
KEYWORD
nonn,hard,more
AUTHOR
EXTENSIONS
a(12)-a(13) from Hugo Pfoertner, Nov 11 2025
a(14)-a(15) from Michael S. Branicky, Nov 11 2025
a(16) from Hugo Pfoertner, Nov 11 2025
a(17) from Bert Dobbelaere, Nov 12 2025
a(18) from Karl-Heinz Hofmann, Nov 22 2025
STATUS
approved