login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A372457 a(n) is the least k such that k^2 + k + 1 is divisible by the n-th power of a prime. 1
1, 18, 18, 1047, 1353, 34967, 82681, 2387947, 14906455, 135967276, 700917774, 4655571260, 18496858461, 272170172759, 950393245608, 10445516265494, 43678446835095, 654213095126525, 654213095126525, 22143577275619760, 101935843573231761, 1777573435823083782, 6042068661342892315 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
For n > 1 the prime is in A002476. Conjecture: it is always 7.
LINKS
EXAMPLE
a(4) = 1047 because 1047^2 + 1047 + 1 = 1097257 is divisible by 7^4.
MAPLE
g:= proc(n) local p, t, tm, r, s, S;
tm:= infinity; r:= infinity;
for p from 7 by 6 do
if p^n > r then return tm fi;
if not isprime(p) then next fi;
S:= [msolve(t^2+t+1, p^n)];
if S = [] then next fi;
s:= min(map(rhs@op, S));
if s < tm then tm:= s; r:= s^2 + s + 1 fi;
od;
end proc:
g(1):= 1:
map(g, [$1..30]);
PROG
(Python)
from sympy import sqrt_mod_iter, nextprime
def A372457(n):
if n == 1: return 1
p, m, r = 7, None, None
while (m is None or p**n <= m):
if (k:=min((r>>1 for r in sqrt_mod_iter(-3, p**n) if r&1), default=None)) is not None:
m = (r:=k if r is None else min(r, k))*(r+1)+1
while (p:=nextprime(p))%6!=1: pass
return r # Chai Wah Wu, May 02 2024
CROSSREFS
Cf. A002476.
Sequence in context: A352365 A050686 A165839 * A177014 A355045 A357800
KEYWORD
nonn
AUTHOR
Robert Israel, May 01 2024
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 2 08:37 EDT 2024. Contains 374822 sequences. (Running on oeis4.)