login
a(n) is the minimum numbers of ks in the sum of a=b_k+c_k, b_k is positive even number and c_k is odd number greater than or equal to -1, and b and c has only prime factors smaller than sqrt(prime(n)), such that the prime factors of all b_k and c_k contain every primes that is smaller than the square root of n-th prime.
1

%I #27 Feb 14 2023 02:18:34

%S 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,

%T 2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,

%U 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2

%N a(n) is the minimum numbers of ks in the sum of a=b_k+c_k, b_k is positive even number and c_k is odd number greater than or equal to -1, and b and c has only prime factors smaller than sqrt(prime(n)), such that the prime factors of all b_k and c_k contain every primes that is smaller than the square root of n-th prime.

%C From A196526, every prime number can be written into at least one ways in the form p=b+c, while b is a positive even number, and c is an odd number that is -1 or greater, and all prime factors of b and c are smaller than square root of the n-th prime or equal to 2.

%C Defining the set of 2 and all primes that are smaller than square root prime(n) as set PP.

%C In principle any pair of b and corresponding c=p-b are coprimes.

%C For each pair of b and c in the set of SS={{b1,c1},{b2,c2},...,{bk,ck}}, if we make a set s_k that lists all prime factors (no repetition) of bk and ck, s_k will be a subset of the set PP.

%C Then we can pick up a few elements of set SS, say {b_s1,cs1},{b_s2,c_s2}...{b_sm,c_sm}, such that the union of prime factor set s_s1, s_s1...s_sm, define as set TT, will be equal to the set PP.

%C a(n) is the minimum needed number of element m, such that the prime factors of the b and c in these picked elements will traverse all element of set PP.

%e for n=2, prime(2)=3, 3=2+1, PP={2}, b=2, c=1, TT={2}=PP, so a(2)=1;

%e for n=3, prime(3)=5, 5=2^2+1, PP={2}, b=2^2, c=1, TT={2}=PP, so a(3)=1;

%e ...

%e for n=37, prime(37)=157, 157=2*5+3*7^2=2*11+3^3*5, PP={2,3,5,7,11}, b1=2*5, c1=3*7^2; b2=2*11, c2=3^3*5; TT={2,3,5,7,11}=PP, so a{37}=2

%t AllPrimes[k_] :=

%t Module[{p, maxfactor, pset}, p = Prime[k];

%t maxfactor = NextPrime[IntegerPart[Sqrt[p]] + 1, -1];

%t If[maxfactor == -2, pset = {2}, p0 = 2; pset = {2};

%t While[p0 = NextPrime[p0]; p0 <= maxfactor,

%t pset = Union[pset, {p0}]]]; pset];

%t NextIntegerWithFactor[seed_, fset_] :=

%t Module[{m, a, l, i, fset1}, m = seed - 1;

%t While[m++; If[Mod[m, 2] == 1, m++]; a = FactorInteger[m];

%t l = Length[a]; fset1 = {};

%t Do[fset1 = Union[fset1, {a[[i]][[1]]}], {i, 1, l}];

%t Intersection[fset1, fset] != fset1]; m];

%t FactorSet[seed_] :=

%t Module[{fset2, a, l, i}, a = FactorInteger[seed]; l = Length[a];

%t fset2 = {}; Do[fset2 = Union[fset2, {a[[i]][[1]]}], {i, 1, l}];

%t fset2]; SplitPrime[n_, q0_] :=

%t Module[{p, pset, q, r, rp, fs, rs, qs}, p = Prime[n];

%t pset = AllPrimes[n]; q = q0;

%t While[q++; q = NextIntegerWithFactor[q, pset]; r = p - q;

%t rp = Abs[r]; fs = FactorSet[rp];

%t rs = Complement[pset, FactorSet[q]];

%t qs = Intersection[fs,

%t rs]; (fs != {1}) && (fs != qs) && (q <= (p + 1))]; {p, q, r} ];

%t AllSplits[n_] :=

%t Module[{q, ss, spls}, q = 0; spls = {};

%t While[ss = SplitPrime[n, q]; q = ss[[2]];

%t If[q <= (Prime[n] + 1), spls = Union[spls, {ss}]];

%t q < (Prime[n] + 1)]; spls];

%t Checkk[k_, n_] :=

%t Module[{allp, checkp, fsp, alls, subs, esubs, lsub, found, i, j},

%t allp = AllPrimes[n]; alls = AllSplits[n]; subs = Subsets[alls, {k}];

%t lsub = Length[subs]; i = 0; found = 0;

%t While[(found == 0) && (i < lsub), i++; esubs = subs[[i]];

%t checkp = {};

%t Do[fsp = FactorSet[esubs[[j]][[2]]]; checkp = Union[checkp, fsp];

%t If[Abs[esubs[[j]][[3]]] != 1, fsp = FactorSet[esubs[[j]][[3]]];

%t checkp = Union[checkp, fsp]], {j, 1, k}];

%t If[Length[checkp] == Length[allp], found = 1]]; found];

%t Checks[n_] :=

%t Module[{found, i}, found = 0; i = 0;

%t While[found == 0, i++; found = Checkk[i, n]]; i]; Table[

%t Checks[i], {i, 2, 100}]

%Y Cf. A196526.

%K nonn,easy,uned

%O 2,35

%A _Lei Zhou_, Oct 03 2011