login
Numbers k such that k+1 is composite and A371641(k) != p^2 where p = A020639(k+1) is the smallest prime factor of k+1.
2

%I #15 Apr 13 2024 23:17:03

%S 406,766,988,1036,1072,1138,1246,1396,1402,1456,1500,1642,1738,1762,

%T 1768,1816,1918,1926,1942,2076,2116,2158,2182,2278,2506,2716,2746,

%U 2812,2866,2920,2992,3076,3148,3172,3286,3316,3382,3496,3568,3682,3706,3712,3742,3762

%N Numbers k such that k+1 is composite and A371641(k) != p^2 where p = A020639(k+1) is the smallest prime factor of k+1.

%C If k+1 is composite, then A371641(k) <= A020639(k+1)^2. This sequence lists numbers k where the inequality is strict.

%H Chai Wah Wu, <a href="/A371900/b371900.txt">Table of n, a(n) for n = 1..10000</a>

%o (Python)

%o from itertools import count, islice

%o from sympy import isprime, primefactors, factorint, integer_log

%o def A371900_gen(startvalue=2): # generator of terms >= startvalue

%o for n in count(max(startvalue,2)):

%o if not isprime(n+1):

%o q = min(primefactors(n+1))

%o for m in range(4,q**2):

%o f = factorint(m)

%o if sum(f.values()) > 1:

%o c = 0

%o for p in sorted(f):

%o a = pow(n,integer_log(p,n)[0]+1,m)

%o for _ in range(f[p]):

%o c = (c*a+p)%m

%o if not c:

%o yield n

%o break

%o A371900_list = list(islice(A371900_gen(),30))

%Y Cf. A020639, A027746, A259047, A322843, A248915, A371641.

%K nonn,base

%O 1,1

%A _Chai Wah Wu_, Apr 11 2024