login
A089091
a(n) is the smallest composite number coprime to n and n+1.
0
9, 25, 25, 9, 49, 25, 9, 25, 49, 9, 25, 25, 9, 121, 49, 9, 25, 25, 9, 121, 25, 9, 25, 49, 9, 25, 25, 9, 49, 49, 9, 25, 25, 9, 121, 25, 9, 25, 49, 9, 25, 25, 9, 49, 49, 9, 25, 25, 9, 49, 25, 9, 25, 49, 9, 25, 25, 9, 49, 49, 9, 25, 25, 9, 49, 25, 9, 25, 121, 9, 25, 25, 9, 49, 49, 9, 25, 25
OFFSET
1,1
FORMULA
a(n) = A053670(n)^2.
MATHEMATICA
m=0; Table[fla=1; Do[s=GCD[n, k]; s1=GCD[n, k+1]; s2=GCD[n, k+2]; s3=GCD[n, k+3]; If[Equal[s, 1]&&Equal[s1, 1]&&!PrimeQ[n]&&!Equal[n, 1]&& Equal[fla, 1], m=m+1; Print[n]; fla=0], {n, 1, 1000}], {k, 1, 256}]
PROG
(Python)
from math import gcd
def a(n):
k, m = 3, n*(n+1)
while gcd(k, m) != 1: k += 2
return k*k
print([a(n) for n in range(1, 79)]) # Michael S. Branicky, Sep 25 2021
KEYWORD
easy,nonn
AUTHOR
Labos Elemer, Nov 26 2003
EXTENSIONS
Offset corrected by Mohammed Yaseen, Aug 15 2023
STATUS
approved