[go: up one dir, main page]

login
A361934
Numbers k such that k and k+1 are both primitive Zumkeller numbers (A180332).
1
82004, 84524, 158235, 516704, 2921535, 5801984, 10846016, 12374144, 12603824, 18738224, 24252074, 24887655, 25691984, 32409530, 33696975, 35356544, 36149295, 41078114, 42541190, 43485584
OFFSET
1,1
EXAMPLE
82004 is a term since 82004 and 82005 are both primitive Zumkeller numbers.
MATHEMATICA
q[n_, d_, s1_, m1_] := Module[{s = s1, m = m1}, If[m == 0, False, While[d[[m]] > n, s -= d[[m]]; m--]; d[[m]] == n || If[s > n, q[n - d[[m]], d, s - d[[m]], m - 1] || q[n, d, s - d[[m]], m - 1], n == s]]];
(* after M. F. Hasler's pari code at A006037 *)
zumQ[n_] := Module[{d = Most[Divisors[n]], m, s}, m = Length[d]; s = Total[d]; If[OddQ[s + n], False, q[(s + n)/2, d, s, m]]];
primZumQ[n_] := zumQ[n] && AllTrue[Most[Divisors[n]], ! zumQ[#] &];
seq[kmax_] := Module[{s = {}, zq1 = False, zq2}, Do[zq2 = primZumQ[k]; If[zq1 && zq2, AppendTo[s, k - 1]]; zq1 = zq2, {k, 2, kmax}]; s]; seq[3*10^6]
PROG
(PARI)
is1(n, d, s, m) = {m||return; while(d[m]>n, s-=d[m]; m--||return); d[m]==n || if(n<s, is1(n-d[m], d, s-d[m], m-1) || is1(n, d, s-d[m], m-1), n==s); } \\ after M. F. Hasler at A006037
isZum(n) = {my(d = divisors(n)[^-1], s = vecsum(d), m = #d); if((s+n)%2, return(0), is1((s+n)/2, d, s, m)); }
isPrimZum(n) = {if(!isZum(n), return(0)); fordiv(n, d, if(d < n && isZum(d), return(0))); 1; }
lista(kmax) = {my(is1 = 0, is2); for(k = 2, kmax, is2 = isPrimZum(k); if(is1 && is2, print1(k-1, ", ")); is1 = is2); }
CROSSREFS
Subsequence of A180332 and A328327.
Similar sequences: A283418, A330872, A334882.
Sequence in context: A138044 A098187 A146025 * A283418 A330872 A253957
KEYWORD
nonn,more
AUTHOR
Amiram Eldar, Mar 31 2023
STATUS
approved